WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Product variations variable (5 posts)

  1. TimoVeld
    Member
    Posted 1 year ago #

    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?

    http://wordpress.org/extend/plugins/woocommerce/

  2. TimoVeld
    Member
    Posted 1 year ago #

    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

  3. IgniteWoo
    Member
    Posted 1 year ago #

    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?

  4. TimoVeld
    Member
    Posted 1 year ago #

    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?

  5. TimoVeld
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.