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.