Woocommerce_locate_template
-
Salve,
ho un problema con la gestione template del mio plugin.Questo e il codice interessato:
function btm_template_checkout($template, $template_name, $template_path) {
if ($template_name == ‘checkout/form-checkout.php’) {
$template = ‘wp-content/plugins/baltramm/templates/woocommerce/checkout/form-checkout.php’;
}
return $template;
}function btm_template_content_product($template, $template_name, $template_path) {
if ($template_name == ‘content-product.php’) {
$template = ‘wp-content/plugins/baltramm/templates/woocommerce/content-product.php’;
}
return $template;
}
add_filter(‘woocommerce_locate_template’, ‘btm_template_content_product’, 20, 3);
add_filter(‘woocommerce_locate_template’, ‘btm_template_checkout’, 20, 3);Perchè il file form-checkout.php viene regolarmente sostituito mentre content-product.php resta quello originale?
I file sono presenti e i percorsi sono corretti; premetto che non sono ancora un professionista wordpress.Grazie
Antonio
Il topic ‘Woocommerce_locate_template’ è chiuso a nuove risposte.