-
Notifications
You must be signed in to change notification settings - Fork 219
Disable quantity selector and remove item link if item is a synced force sell #5745
Conversation
Size Change: +57 B (0%) Total Size: 813 kB
ℹ️ View Unchanged
|
Might be a good idea to address these issues in an integration on the Force Sells side. In addition to helping keep concerns separated, doing so will also help surface extensibility needs, which need to be served using publicly accessible APIs. |
Yeah you might be right there, it's not the neatest solution. I couldn't see a solution on the Force Sells side so I'd love to hear your thoughts on how we can make that work |
Hey @alexflorisca 👋 Check out our work here. One of the extensibility themes we have identified as part of that work is:
Force Sells relies primarily on the second part (the syncing side of things), but there are many similarities between the two products (Force Sells / Product Bundles) that make it possible to borrow a lot from here (WIP). I'd be happy to help with integrating Force Sells once we're done with the integrations lined up ahead of us now! The 3 integrations we have prioritized (Bundles, Gift Cards, Conditional Shipping and Payments) have a very large surface area that can help inform other integrations (both internal and by 3PDs). |
Nice one, I'll check out your work soon and make a decision on where to take this PR. Thanks for sharing! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Alex, thanks for working on this, seems like a simple fix, but I don't think we should be adding plugin-specific code to our repository, instead we should create extensibility points to allow other plugins to decide the behaviour.
I think we should maybe look into adding a filter like allowCartItemQuantityChange
or something, or allowCartItemRemoval
. What do you think?
I agree this should be fixed on the plugin's side. There is an open PR for Box office fixing a similar issue, where the quantity selector is disabled using the This filter was introduced by this PR and it could also be used by WC Force Sells |
Thanks for all your points everyone - nice work on the integration work @manospsyx, look forward to diving deeper into that and applying those principles here. I'll close this PR and will open a new PR on the Force Sells side with the integration work. At the very least, it looks like we can disable the quantity selectors, even if we might not be able to remove the "Remove product" button |
This solves an integration issue with the WooCommerce Force Sells plugin. When a product is forced to sync to another product, the user should not be able to change the quantity or remove the linked product. This PR disables those options for a sync forced product.
Fixes 57-gh-woocommerce/woocommerce-force-sells
Screenshots
Testing
Automated Tests
Manual Testing
How to test the changes in this Pull Request:
product A
and addproduct B
asSynced Force Sells
product.product A
to the cart.product B
User Facing Testing
These are steps for user testing (where "user" is someone interacting with this change that is not editing any code).
Changelog