Paypal Express default select the cheapest method regardless the customers' selection
I were running a testing Zen-Cart 1.39 site with Paypal IPN as a payment method. This site was running smoothly and with correct calculations for the payment. A few weeks ago, I decided to upgraded to Zen-Cart 1.51. After upgrade, Paypal IPN can not grab the shipping charge. I searched our forum for the similar problem and decided to switch to Paypal Express-checkout. The good thing about Express-checkout is that it does give all detail lines about the transaction. However, regarless which shipping method during checkout, it always chooses the cheapest shipping method.
I did search the forum and turned off the cheapest shipping default setting in the Paypal Express payment module in admin. That did not solve the problem. Wire Trasfer payment module can display correctly.
I check the header.php of checkout_shipping. There is a code:
if ( !$_SESSION['shipping'] || ( $_SESSION['shipping'] && ($_SESSION['shipping'] == false) && (zen_count_shipping_modules() > 1) ) ) $_SESSION['shipping'] = $shipping_modules->cheapest();
No matter what customer choose, the condition inside "if " is always true. I have several shipping modules installed which can display correctly in shipping estimator as well as checkout_shipping. I suspected this problem arised when the selected shipping information was not properly saved in session during checkout, or the information was not transferred to Paypal properly or there was a change in system itself or code mess up during upgrade (my fault).
It has been several days, This problem has still not been solved. Therefore, I would like someone in the forum shed some light on this issue. Thank you!
Zen-cart version: 1.39 upgraded to 1.51
Database Patch Level: 1.51
PHP Version: 5.2.17 (Zend: 2.2.0)
Database: MySQL 5.5.34
custom: checkout_payment was merged into checkout_shipping to make a faster checkout process, same was its header.php.
If you need more information, please let me know.
Re: Paypal Express default select the cheapest method regardless the customers' selec
Forgot to mention a few thing in the initial post:
The Paypal Express icon was disable in shoppping cart page. Therefore, customers have to log into this site and choose the shipping and payment information before going to Paypal.
When I used wire transfer module, the shipping charge was calculated corrrectly based on my selection( which may imply this problem may exist with Paypal Express).
Re: Paypal Express default select the cheapest method regardless the customers' selec
Just want to give everyone an update.
Finally, I figured it out myself. The cause of the problem is that my custom header_php.php for checkout_shipping has a code to bypass the shipping information for the Paypal Express Checkout. Therefore, no shipping method will be used for Paypal Express and customer will automatically get the cheapsest shipping by default based on the code for Paypal Express. When I deleted this extra code, customers can go through normal checkout with the selected shipping method. Everything is good for now. Thank you!
Re: Paypal Express default select the cheapest method regardless the customers' selec
Glad you figured it out, and have it working now. Also thank you for giving the feedback of the solution, so that it may help others