• Hi all,
    I’d like to edit my product page in a way that is depending on the selected variation. Meaning: I want action-A to occur when option a is selected, when option-B is selected as variation, I want action-B to happen.

    So basically I just want to “catch” what variation is selected and use that information to make something happen on the product page.

    Any suggestions?

    https://www.ads-software.com/extend/plugins/woocommerce/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter TimoVeld

    (@timoveld)

    I’m gessing I need something like

    <?php
    if ($selected_value == 'AttributeValue')
     {$phpVar = 1;}
    else
    {$phpVar = 5;}
    ?>

    But I can’t seem to get it to work

    If you want to do that when the variation is selected ( e.g. not added to cart yet ) then you should use jQuery. Or do you want to do this after it’s added to the cart?

    Thread Starter TimoVeld

    (@timoveld)

    No I want to do it before it is added to cart.
    So are you saying I’m in the right direction with $selected value? Only I have to make the change with jQuery, not with php?

    Thread Starter TimoVeld

    (@timoveld)

    What I’m actually keen on finding, is how the prices are generated when selecting an attribute. If I could see how this functions works, I could just copy and modify it’s code to my needs.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Product variations variable’ is closed to new replies.