Please submit a private ticket if you need to share sensitive information, such as license details and admin credentials.

Okay
  Public Ticket #3782649
get compoenent product list by code
Open

Comments

  •  2
    Angelo started the conversation

    Hi, we want to use your great plugin to create bundle products: for example a veggie box composed by 1 kg carrots, 3 Kg apples and so on…

    We have another plugin that creates a txt with all the products of the order and their quantities.

    How can we get the products bundle list and data by code? Do you have any get_bundle funcion or so on?

    Thank you very much

  •  1,281
    Dustin replied

    Hi Angelo,

    Please try this one:

    if ( is_a( $product, 'WC_Product_Woosb' ) && ( $items = $product->get_items() ) ) {
    	var_dump( $items );
    }

    Best regards,
    Dustin

  •  2
    Angelo replied

    Hi Dustin, thank you I will check how it is working... 

    One more thing: we decided to use you other composite product plugin, can you give me the code for that kind of product too? 

    And, we created a test pruct here https://huertapavon.compra-eco.com/producto/combibox1/, as you can see you can choose veggie and fruit... but how can we limit the veggie to only 3 of them ? I mean, the user can select a maximum of 3 product of all the listed in the veggie section? thank you and Merry Christmas!

  •  2
    Angelo replied

    ouch, I think I found the key for the composite... maybe "WC_Product_Composite" ? 

    Now I just need to know If I can limit the product selection as explained before. ... 

    thank you very much!!!

  •  1,281
    Dustin replied

    Unfortunately, our plugin doesn't allow you to limit the number of selections. Instead, you can create three single-selection components. In each component, buyers can choose one veggie.

    Best regards,
    Dustin

  •  2
    Angelo replied

    ok, I will do like that, but i think the count limitation would be a good feature for your great plugin. thank you very much!