Open mikejolley opened 1 year ago
Hey folks, I have pushed some changes on add/blocks-local-pickup
which can be used to kick start the work on integrating with WC blocks.
Please note the PR in WC blocks to add LocalPickupSelect
is still under review, so no guarantee it will be merged yet.
To summarise the changes so far on that branch:
PickupControl
which is used to render the pickup options for a package. It is a wrapper for LocalPickupSelect
from WC Blocks which allows you to add your own class name and styling for anything rendered in this slot/fill.SubscriptionsPickupRecurringPackages
which is an analogue to SubscriptionsRecurringPackages
(you may want to rename the SubscriptionsRecurringPackages
component in index.js
to make it more obvious that one refers to shipping and one refers to local pickup) - it renders a PickupControl
, described above.SubscriptionsPickupRecurringPackages
is rendered in the WC Blocks local pickup section.Let me know if this is a good approach, or if you need help with anything, I'll be happy to assist.
Describe the bug
WooCommerce Blocks has a dedicated block for selecting Local Pickup during checkout. There is a dedicated P2 about this functionality here for reference.
Due to the way subscriptions splits carts into multiple carts to handle recurring billing, there is a conflict when it comes to shipping method selection. This screenshot shows the behaviour you see:
To Reproduce
Expected behavior
When you select Local Pickup, the shipping method for the recurring carts should also switch to Local Pickup.
Actual behavior
When you select Local Pickup, the shipping method for the recurring carts remains as default and cannot be changed.
Product impact
Additional context
A potential/partial solution to keep recurring and regular carts in sync was created here https://github.com/Automattic/woocommerce-subscriptions-core/pull/264 however this is no longer applicable because we're not passing a
null
package ID. The action would receive package ID 0 (when local pickup is used, only one package is supported).Therefore the logic in subscriptions needs to be either:
or
cc @senadir