• I have a basic system what use PHP and WOO to add products in a cart.

    Like:

    if (condition){
    $woocommerce->cart->empty_cart();
    $woocommerce->cart->add_to_cart('123');
    // and here add a product variation or product along with the variation
    }else{
    // do anithing
    }

    The question: I want to add the product along with a variation of the product itself.

    I have this variation: http://prntscr.com/gcmio4 then if Sim == R$400,00 if Não == R$310,00

    Can I set this with PHP? Or with the code above?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Set product variation via PHP’ is closed to new replies.