In WC Subscriptions 3.1, the recurring cart package keys are now in the {$recurring_cart_key}_{$package_index} format (2021_05_25_weekly_0). When using the cart SPB, when you arrive on the complete PayPal order page, we copy the PayPal address data into the shipping packages, however we assumed the package index was always 0. This PR changes that so we get the package index dynamically using key().
Steps to test:
With WC Subscriptions 3.1 and above, place a subscription product in the cart.
On the cart page, use the PPEC smart payment buttons.
Complete PayPal popup and when you arrive back on the Confirm your PayPal order page:
On trunk there will be 2 shipping methods displayed for the recurring cart. You will also get a lot of PHP warnings and errors.
On this branch, there's only 1 shipping method displayed and no errors.
Issue: 4106-gh-woocommerce/woocommerce-subscriptions
Description
In WC Subscriptions 3.1, the recurring cart package keys are now in the
{$recurring_cart_key}_{$package_index}
format (2021_05_25_weekly_0
). When using the cart SPB, when you arrive on the complete PayPal order page, we copy the PayPal address data into the shipping packages, however we assumed the package index was always0
. This PR changes that so we get the package index dynamically usingkey()
.Steps to test:
trunk
there will be 2 shipping methods displayed for the recurring cart. You will also get a lot of PHP warnings and errors.https://d.pr/i/lFCZea
Documentation
Changelog entry