Kann gerne archiviert werden. Habe mich eingelesen.
Falls jemand irgendwann vor dem gleichen Problem steht.
Ich habe ein eigenes Feld zugefügt und dann folgende Funktion eingefügt:
Code
// Preisgestaltung
add_filter( 'woocommerce_product_get_price', 'conditional_product_sale_price', 20, 2 );
add_filter( 'woocommerce_product_get_sale_price', 'conditional_product_sale_price', 20, 2 );
function conditional_product_sale_price( $price, $product ) {
$new_price = get_post_meta( $product->get_id(), 'preis-neu', true ); //new sale price
if( ! empty($new_price) ) {
$price = $new_price;
}
return $price;
}
Alles anzeigen