סקירת התקלה
כאשר משתמשים ב־WooCommerce Bookings עם הגדרת ריבוי מטבעות ומגדירים את המטבעות כך שישתנו בהתאם למדינות הנבחרות (ללא בורר מטבעות גלוי), המחירים אינם מותאמים למדינה שנבחרה בתהליך הקופה. בעוד שסמל המטבע משתנה, המחיר בפועל נשאר קבוע, דבר הגורם לאי־התאמות בסכומים המוצגים.
פתרון עוקף
ודא שיש לך גיבוי מלא של האתר לפני שתמשיך.
- פתח את הקובץ functions.php של ערכת העיצוב שלך.
- הוסף את הקטע הבא:
add_filter( 'woocommerce_checkout_update_order_review', function() { $cartItems = WC()->cart->get_cart(); if ( is_array( $cartItems ) ) { foreach ( $cartItems as &$cartItem ) { if ( isset( $cartItem['booking'] ) && isset( $cartItem['data'] ) ) { $product = $cartItem['data']; $product->check_in_cart = false; $calculatedCost = WC_Bookings_Cost_Calculation::calculate_booking_cost( $cartItem['booking'], $product ); $cartItem['booking']['_cost'] = $calculatedCost; $cartItem['data']->set_price( $calculatedCost ); } } } } );