Ich würde gerne je nach Produktkategorie unterschiedliche Preistemplates verwenden. Die price.php wird mit folgendem hook in das Template integriert:
welcher sich dann so aufbaut:
PHP
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_sharing', 50 );
Soweit ist alles in Ordnung. Nun möchte ich aber, dass bei allen Produkten der Kategorie-X, die price_x.php und nicht die price.php verwendet wird. Der aktuelle Code hierfür schaut so aus:
PHP
if ( ! function_exists( 'woocommerce_template_single_price' ) ) {
function woocommerce_template_single_price() {
wc_get_template( 'single-product/price.php' );
}
}
Ich wäre euch für einen Lösungsvorschlag sehr dankbar, da ich langsam echt am verzweiflen bin.
Vielen Dank und Grüße