Forum Replies Created
-
AuthorPosts
-
almostretiredParticipant
Sorry for the delay on this. Thanks so much for working this out. We did change one line of the code for our purposes.
if ( array_key_exists( ‘composite_parent’, $item->object ) ) {
I don’t think our client will ever make a sale on quantities that includes the components, so this version should be easier than checking for specific codes.
This works! Thanks again for all of your help!
almostretiredParticipantThis gives the same result as excluding based on the category. The count matches, but the percentage discount is based on the two included items only. Toggling Allow discount on the cart with excluded items does not change this behavior.
almostretiredParticipantWe’re using the official WooCommerce Composite Products plugin. https://woocommerce.com/products/composite-products/
The ‘composite_parent’ parent property should do what we need. For our purposes we don’t want to check specific coupon codes, since I doubt the client will ever include components in the quantity.
Page with info: https://woocommerce.com/document/composite-products-data-structures-storage/
We haven’t found the right combination of hooks and functions at the moment.
Excluding by price doesn’t work because our component items alter the price. We would end up with a free product and a discount.
almostretiredParticipantYes, here’s the screenshot. https://capture.dropbox.com/5aRbS53GGbovkDH3
In this image, the product “Amateur Radio Coax Builder” is one product. That product is made up of 1 wire with a choice of the number of feet, and up to two connectors. The cart is applying a 3+ discount since it is counting each foot of wire and each connector.
-
AuthorPosts