Paypal + VirtueMart : Error Currency Coverter & Shipping When send to Paypal
สกุลเงินและ ค่าขนส่งไม่ถูกต้องเมื่อถูกส่งไปยัง Paypal
** หมายเหตุ แต่ก่อนอื่นต้องทำการติดตั้งและทำการแก้ไข Code Paypal ให้สามารถ Covert สกุลเงินต่างๆ เสียก่อน วิธีการตั้งตั้งดูได้ที่ Click !!!
There are two major bugs that we have uncovered when you are using the currency converter that affects Paypal and shipping.
หากคุณใช้การ Covert สกุลเงิน จะมีผลกับค่าสินค้าและค่าขนส่ง ที่ส่งไปยัง Paypal เรามาดู Error และ วิธีแก้ไขกันนะครับ
1. Error Currency Coverter Shipping Cost ค่าขนส่งไม่ถูกต้องเมื่อถูกส่งไปยัง Paypal
The next problem is also very serious.
VM is "converting" the shipping costs again AFTER the order is confirmed. This affects the amount of shipping in the order totals, either increasing or decreasing the amount a second time by the conversion ratio. All looks OK on the confirm page, but once the order is placed, the shipping amount is wrong, and this also affects the amount passed to any payment processor as this adjusted shipping rate is also passed to the payment module.
We are using the Standard Shipping Module - if you are using a different shipping module test to ensure our suggested fix works for your configuration.
ให้ทำการไปยังไฟล์ที่ :
In line 1598 of the file "administrator/components/com_virtuemart/classes/ps_checkout.php", comment out the below lines:

$d['shipping_tax'] = $GLOBALS['CURRENCY']->convert( $d['shipping_tax'] );
$d['shipping_total'] = $GLOBALS['CURRENCY']->convert( $d['shipping_total']);
ให้ใส่ Comment ทั้งสองบรรทัดนี้ จะได้เป็น

//$d['shipping_tax'] = $GLOBALS['CURRENCY']->convert( $d['shipping_tax'] );
//$d['shipping_total'] = $GLOBALS['CURRENCY']->convert( $d['shipping_total']);
แล้วทำการอัพโหลดไฟล์ไปทับไฟล์เก่าได้เลย
2. Error Currency Coverter สกุลเงินไม่ถูกต้องเมื่อถูกส่งไปยัง Paypal
VM sends the converted order total amount to Paypal but sends the shop's base currency code, resulting in a mismatch between the order total amount and the currency. Say the cost of the item was 10 Euro (in the shop/vendor currency) and when converted that is USD 14.70. VM passes 14.70 to Paypal but says the currency is Euro when it should be USD.


Here is the fix: วิธีการแก้ไข
In the "Configuration" tab of the PayPal module ("Store > List Payment Profiles > "PayPal"), "Payment extra info" change the below code:


"currency_code" => $_SESSION['vendor_currency'],
เปลี่ยนใหม่เป็น
"currency_code" => $_SESSION['product_currency'],
จากนั้นก็ทำการทดสอบดูนะครับ ก็เป็นอันเรียบร้อย ที่นี้ เราจะส่งสกุลเงินอะไรไป ค่าขนส่งเป็นเท่าไหร่ Paypal ก็จะรับข้อมูลได้อย่างถูกต้อง





