Extra product options For WooCommerce | Custom Product Addons and Fields By ThemeHigh
- Dans le fichier functions.php de votre thème enfant WordPress actuel, ajoutez le code suivant :
add_filter('thwepo_extra_cost_option_price', function ($price, $price_type, $option, $name) { if (class_exists('WOOCS') AND $price > 0) { global $WOOCS; $price = $WOOCS->woocs_exchange_value(floatval($price)); } return $price; }, 99, 4);add_filter('thwepo_extra_cost_unit_price', function ($price, $name, $product_price, $price_type) { if (class_exists('WOOCS') AND $price > 0) { global $WOOCS; $price = $WOOCS->woocs_exchange_value(floatval($price)); } return $price; }, 99, 4); - Dans le fichier wp-content\plugins\woocommerce-extra-product-options-pro\includes\utils\class-thwepo-utils-field.php, ajoutez le code suivant :
if (class_exists('WOOCS') AND $price > 0) { global $WOOCS; $price = $WOOCS->woocs_exchange_value(floatval($price)); }
- Dans le fichier wp-content\plugins\woocommerce-extra-product-options-pro\includes\class-thwepo-price.php, ajoutez le code suivant :
if (class_exists('WOOCS') AND isset($result['extra_price'])) { global $WOOCS; $result['extra_price'] = $WOOCS->woocs_exchange_value(floatval($result['extra_price'])); }
- Dans le même fichier, ajoutez le code suivant :
if (class_exists('WOOCS')) { global $WOOCS; if ($WOOCS->is_multiple_allowed) { $currrent = $WOOCS->current_currency; if ($currrent != $WOOCS->default_currency) { $currencies = $WOOCS->get_currencies(); $rate = $currencies[$currrent]['rate']; $new_price = $new_price / $rate; } } }
- Dans le même fichier, ajoutez le code suivant :
if (class_exists('WOOCS') AND $product_price > 0) { global $WOOCS; $product_price = $WOOCS->woocs_exchange_value(floatval($product_price)); }
- Dans le même fichier, ajoutez le code suivant :
if (class_exists('WOOCS') AND $price > 0) { global $WOOCS; $price = $WOOCS->woocs_exchange_value(floatval($price)); }
Cette modification se trouve dans le fichier d'un autre plugin, donc une mise à jour du plugin l'annulera. Notez la modification et réappliquez-la après chaque mise à jour de ce plugin — ou demandez à ses auteurs d'inclure le correctif de leur côté, ce qui est la seule version qui perdure. Si la modification se trouve à l'intérieur de FOX lui-même, dites-le-nous : un correctif qui doit être réappliqué manuellement est un bug de notre côté, pas une solution.