Home › Forums › WooCommerce Personalized Product Options Manager (PPOM) › Issue with bundled Products
- This topic has 68 replies, 5 voices, and was last updated 5 years, 10 months ago by
Jane Brian.
-
AuthorPosts
-
September 27, 2018 at 1:31 pm #9474
Lievelabels.nl
Participant@Nmedia For me the issue is solved!
I have added the filter in my functions.php.
However, I do suggest you implement the fix, as I started with, adding it to woocommerce.php.
Then it’s compatible with product bundles all the way.For the issue of Michel, I get the feeling the issue is somewhat different then I have.
Michel, are you adding PPOM, to the subitems of the bundle, this is not compatible in any way…… PPOM can only be added to the top item of a bundle!I just don’t get your mix of PPOM & BUNDLES
-
This reply was modified 6 years, 5 months ago by
Lievelabels.nl.
September 27, 2018 at 1:37 pm #9476Michel
ParticipantMichel, are you adding PPOM, to the subitems of the bundle, this is not compatible in any way…… PPOM can only be added to the top item of a bundle!
Yes, each sub product of the bundle also has the same PPOM, so the customer also has to choose to buy one of the separate sub products. All sub-products of this bundle are available for purchase separately, and each has the option to select the “hotel” and add a “privatized service”. (The same category of PPOM).
September 27, 2018 at 1:44 pm #9477Lievelabels.nl
ParticipantThis is not supported by the PPOM plugin I think.
Currently PPOM only see’s the parent PPOM I think, and does not show the PPOM for subitems…
My filter actually removes ANY PPOM data from subitems!September 27, 2018 at 1:48 pm #9478Michel
ParticipantWhat I’ve tried to say is that both my Bundle and my products (some of which are sub-products of this bundle) use the same PPOM list:
http://prntscr.com/kzen06It turns out that it was not for the Addon selected within the bundle to affect the addon that is of a sub product, since the user did not interact with that of the sub product, only with that of the bundle.
September 27, 2018 at 1:50 pm #9479Lievelabels.nl
ParticipantMy currently working setup:
Product A, has PPOM X
Product B, has PPOM Y
Product C, has PPOM Z
Product Bundle W (existing out of A,B,C), has PPOM VSituation before filter:
Shopping cart shows:
Product W
PPOM DATA V
Product A
PPOM DATA V
Product B
PPOM DATA V
Product C
PPOM DATA VAfter filter:
Product W
PPOM DATA V
Product A
Product B
Product CSeptember 27, 2018 at 1:56 pm #9480Michel
ParticipantI understand, maybe if I create a different list for the sub products and another for the bundle, even they have the same options.
PPOM LIST A: “hotel” + “privatized services”;
PPOM LIST B: “hotel” + “privatized services”;BUNDLE (PPOM A)
– SUB PRODUCT 1 (PPOM B);
– SUB PRODUCT 2 (PPOM B);
– SUB PRODUCT 3 (PPOM B);Maybe he’ll create different ids, I do not know, I’m going to test this option … (I do not see much sense in this, since both lists will have the same fields).
-
This reply was modified 6 years, 5 months ago by
Michel.
September 27, 2018 at 2:09 pm #9482nmedia
KeymasterOk in summary, I got:
1. PPOM should only be applied to main product when used with Bundle Not the sub items.
2. i will apply the filter suggested by @Lievelabels.nl@Lievelabels.nl, can you please paste this filter again here?
September 27, 2018 at 2:10 pm #9483Lievelabels.nl
ParticipantThat will not work…
PPOM is not compatible with bundles, that it will show or store PPOM data of the bundled items!
In fact, my fix is only for visibility in cart……
PPOM data of the container item (parent) is added to every single bundle item, as I see in the $cart_item array.
@nmedia, is that something you could fix?
Making sure that PPOM data is only added to the parent.Showing PPOM data on bundle children is quite hard I think…
September 27, 2018 at 2:12 pm #9486Lievelabels.nl
Participantwoocommerce.php
function ppom_woocommerce_add_item_meta($item_meta, $cart_item) { if( ! isset($cart_item['ppom']['fields']) ) return $item_meta; if ( class_exists('WC_Bundles') && wc_pb_is_bundled_cart_item( $cart_item )) { return $item_meta; } $ppom_meta = ppom_make_meta_data( $cart_item ); //rest of function
But this is only cosmetic, we should also make sure, its actually not applied to the children as well.
-
This reply was modified 6 years, 5 months ago by
Lievelabels.nl.
September 27, 2018 at 2:13 pm #9488nmedia
KeymasterOk share how bundle products works? means how sub items added to bundle products?
September 27, 2018 at 2:20 pm #9491Lievelabels.nl
ParticipantAfter a quick look this function adds meta data to the cart item:
function ppom_woocommerce_add_cart_item_data($cart, $product_id) { if( ! isset($_POST['ppom']) ) return $cart; if( ! $selected_meta_id = ppom_has_product_meta( $product_id ) ) { return $cart; } $ppom_settings = PPOM() -> get_product_meta ( $selected_meta_id ); if( empty($ppom_settings) ) return $cart; // PPOM also saving cropped images under this filter. $ppom_posted_fields = apply_filters('ppom_add_cart_item_data', $_POST['ppom'], $_POST); $cart['ppom'] = $ppom_posted_fields; // ppom_pa($_POST); exit; return $cart; }
So if we implement tha same here?
if ( class_exists('WC_Bundles') && wc_pb_is_bundled_cart_item( $cart_item )) { return $item_meta; }
@nmedia, its a very complex plugin, it adds also extra data like you, but the best thing is to check if the cart item is a bundled item by using the functions the have available: wc_pb_is_bundled_cart_item($cart_item)For more information:
-
This reply was modified 6 years, 5 months ago by
Lievelabels.nl.
September 27, 2018 at 2:21 pm #9492Michel
ParticipantThis is the bundle:
http://prntscr.com/kzf47dThis is one of the sub products of the bundle, which can also be purchased separately (if the customer wants):
http://prntscr.com/kzf4klBoth need to have the same additional fields, both the bundle and the separate product … “hotel” and “privatized service”.
It turns out that when the customer buys the bundle, he needs to select which hotel and whether or not he wants the privatized service for that bundle, I want these options to only affect the bundle, not the sub products, even if the sub products have the same additional if purchased separately.
It was clear ? If not, just go to the store you’ll understand there: https://loja.neumanntour.com.br/pacotes/
-
This reply was modified 6 years, 5 months ago by
Michel.
September 27, 2018 at 2:35 pm #9495Lievelabels.nl
Participant@michel, have you tried my filter with a higher priority?
For me it worked with 9, but maybe you need 5 to get it working?September 27, 2018 at 2:46 pm #9497Michel
ParticipantWell, the last problem I managed to solve, I created a separate PPOM list, one for the package and another for the products.
Now it’s no longer adding anything to the sub products (even without the filter)
What is happening now is that the additional information I put in the bundle, are not going to the cart.
As it is in the bundle: http://prntscr.com/kzfh8u (total value of 2,276)
After adding the bundle to the cart: http://prntscr.com/kzfi4f
He did not add 100% of the value over the bundle price (it was to add because the customer selected the “privatized service” inside the bundle), in fact, it increased by 100 the price of the product, as you can see in print ..Inside PPOM looks like this:
http://prntscr.com/kzfiwt-
This reply was modified 6 years, 5 months ago by
Michel.
September 27, 2018 at 2:54 pm #9499Lievelabels.nl
ParticipantI’m closing off for today….. will see where you got tomorrow!
-
This reply was modified 6 years, 5 months ago by
-
AuthorPosts
- The topic ‘Issue with bundled Products’ is closed to new replies.