Support » Plugin: WooCommerce » Variations conditional logic

  • Resolved bynejc

    (@bynejc)


    Hello,

    I have been trying a lot of plugins regarding this question and no plugin is good enough for what im trying to do. (Gravity forms, Exta Product options, YITH product add on options..). I have been trying to do this for a few days with no results. I have little knowledge of the code.

    All of these plugins is not what I am looking for. I want to create three ‘quanitity boxes’ (like on these sites: https://www.kupi-hitro.si/izdelek/brezzicne-slusalke/ or https://vigoshop.si/izdelek/pametno-drzalo-z-brezzicnim-polnjenjem-deluxe/)

    Basically three quantity selection boxes with conditional logic. If a customer chooses quantity box 2 the button opens two swatch options, if a customer selects quantity 3, three swatch options show.

    This is what im going for. I cant seem to find the plugins, do you think this is custom code?

    Thank you for your help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • I may be misunderstanding what you’re trying to accomplish, but I think WooCommerce will do this for you out-of-the box using variable products with the relevant attributes.

    For example, you’d create two attributes, quantity and swatches. The quantity attribute would have values “1|2|3”. The swatches would have the values you want for them, say “red|yellow|green|blue”. Next, you’d create variations combining the quantities and swatches that correspond. When you’re done, the customer’s choice of quantity will only show the swatch values that you paired with it.

    There is one “gotcha” you have to be cautious with. By default, the variations threshold is 30. If the number of variations is less than the threshold, WooCommerce uses AJAX to check the available variations on the fly, and the user interface will work the way you want it.and the customer is only able to select available variations. If the number of variations is greater than the threshold, AJAX isn’t used, and the customer may get the “unavailable variation” message.

    If you have more than 30 variations for a product, you can increase the threshold by adding the following code to your child theme’s functions.php, replacing the “150” with whatever you need, but keeping in mind the higher the number, the more resource-intensive the AJAX call:

    
    add_filter( 'woocommerce_ajax_variation_threshold', 'wc_ajax_variation_threshold' );
    function wc_ajax_variation_threshold() {
        return 150;
    }
    

    No, this is not doable with basic woocommerce attributes and variations because I am looking for conditional logic not a product page full of options that the customer may not need. Please check the links I attached.

    Thank you

    Plugin Support EtienneP

    (@etiennep)

    Hi @bynejc

    We do have the Composite Products extension that will get you close to what you need.

    It has conditional logic and can display options based on a customer’s previous choice.

    Here is a use case that is similar to the examples you included – https://docs.woocommerce.com/document/composite-products/composite-products-use-case-configurable-product/

    If you want to try it, we have a 30-day refund policy. If the product doesn’t work the way you need or you think another product would work better, we are more than happy to provide a full refund.
    You can read more about our refund policy on our website here: http://woocommerce.com/refund-policy/

    Plugin Support EtienneP

    (@etiennep)

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.