WOOCS - WooCommerce-Währungsumschalter

YITH WooCommerce Rollenbasierte Preise

Plug-in-URL: https://yithemes.com/themes/plugins/yith-woocommerce-role-based-prices/

Dies behebt keinen Fehler mit Mini-Korb und hängt nicht vom WOOCS-Code ab

// Fügen Sie in Ihrer Datei wp theme functions.php den nächsten Code hinzu: add_filter('yith_ywcrbp_sale_price', 'woocs_yith_ywcrbp_sale_price', 10, 2); Funktion woocs_yith_ywcrbp_sale_price($sale_price, $product) { if (class_exists('WOOCS')) { global $WOOCS; if ($WOOCS->is_multiple_allowed) { $aktuell = $WOOCS->aktuelle_Währung; if ($currrent != $WOOCS->default_currency) { $currencies = $WOOCS->get_currencies(); $rate = $currencies[$currrent]['rate']; $verkaufspreis = $verkaufspreis * ($preis); } } } return $sale_price; } add_filter('yith_ywrbp_regular_price', 'woocs_yith_ywrbp_regular_price', 10, 2); Funktion woocs_yith_ywrbp_regular_price($regular_price, $product = NULL) { if (class_exists('WOOCS')) { global $WOOCS; if ($WOOCS->is_multiple_allowed) { $aktuell = $WOOCS->aktuelle_Währung; if ($currrent != $WOOCS->default_currency) { $currencies = $WOOCS->get_currencies(); $rate = $currencies[$currrent]['rate']; $regulärer_Preis = $regulärer_Preis * ($rate); } } } return $regular_price; } //ywcrbp_product_replace_roleprices add_filter('ywcrbp_product_replace_roleprices', 'woocs_ywcrbp_product_replace_roleprices', 9999, 4); Funktion woocs_ywcrbp_product_replace_roleprices($role_price, $user_role, $price, $product) { if (class_exists('WOOCS')) { global $WOOCS; if ($WOOCS->is_multiple_allowed) { $aktuell = $WOOCS->aktuelle_Währung; if ($currrent != $WOOCS->default_currency) { $currencies = $WOOCS->get_currencies(); $rate = $currencies[$currrent]['rate']; $rollenpreis = $rollenpreis * ($preis); } } } return $role_price; } //yith_wcrbp_get_role_based_price CART FIX add_filter('yith_wcrbp_get_role_based_price', 'woocs_yith_wcrbp_get_role_based_price', 10, 2); Funktion woocs_yith_wcrbp_get_role_based_price($regular_price, $product) { if (class_exists('WOOCS')) { global $WOOCS; if ($WOOCS->is_multiple_allowed) { $aktuell = $WOOCS->aktuelle_Währung; if ($currrent != $WOOCS->default_currency AND ( is_cart() ODER is_checkout())) { $currencies = $WOOCS->get_currencies(); $rate = $currencies[$currrent]['rate']; $regulärer_Preis = $regulärer_Preis / ($rate); } } } return $regular_price; }