WOOCS - WooCommerce-Währungsumschalter

Rollenbasierter Preis für WooCommerce

Plugin-Link: https://wordpress.org/plugins/woocommerce-role-based-price/

Fügen Sie in der Datei functions.php des aktuellen WordPress-Themas den nächsten Code hinzu:

add_filter("wc_rbp_product_get_price", function($wcrbp_price, $product, $rbp_this) { if (class_exists('WOOCS')) { $sale_price = $product->get_sale_price(); global $WOOCS; if ($WOOCS->is_multiple_allowed AND ( $sale_price !== '' && $sale_price > 0 )) { $currrent = $WOOCS->current_currency;if ($currrent != $WOOCS->default_currency) { $currencies = $WOOCS->get_currencies(); $rate = $currencies[$currrent]['rate']; $wcrbp_price = $wcrbp_price / $rate;} } } return $wcrbp_price;}, 99, 3);

 

Im Ordner wp-content\plugins\woocommerce-role-based-price\includes\class-product-pricing.php nächsten Code hinzufügen:

if (class_exists('WOOCS')) { global $WOOCS; if ($WOOCS->is_multiple_allowed) { $prices['min_price'] = $WOOCS->woocs_exchange_value(floatval($prices['min_price'])); $prices['max_price'] = $WOOCS->woocs_exchange_value(floatval($prices['max_price'])); $prices['min_reg_price'] = $WOOCS->woocs_exchange_value(floatval($prices['min_reg_price'])); $prices['max_reg_price'] = $WOOCS->woocs_exchange_value(floatval($prices['max_reg_price'])); } }


Im Ordner \wp-content\plugins\woocommerce-role-based-price\includes\class-product-pricing.php Code ändern:

if ($ is_hook == TRUE OR (class_exists ('WOOCS') AND defined ('DOING_AJAX'))) {


Hinweis: funktioniert leider nicht mit Option “Ich verwende das Cache-Plugin auf meiner Website"