[SOLVED]Remember options in session

Home – SaaS Forums Support questions WooPrice Calculator (Pro) [SOLVED]Remember options in session

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #5740
    Marnick Menting
    Participant

    Hi, is it possible to remember the options in session? I want to be able to direct the user back to the product page from the cart page, and let them change options in case they change their mind. Or using GET parameters like WooCommerce does with handling product attributes.

    #5742
    Enrico
    Participant

    Hi Marnick,

    If you have a little of PHP knowledge you could get the calculator fields which are saved in the WooCommerce cart session:

    So for example if you write this code in your custom theme:


    cart->get_cart();

    foreach($items as $item => $values) {
    if(!empty($values['simulator_id'])){
    print_r($values['simulator_fields_data']);
    }
    }
    ?>

    This simple piece of code will print the saved cart values of the calculator.

    Of course you need some more work to rewrite this code for get the value and set values in your calculator fields.

    Kind Regards,
    Enrico
    AT139

    #5741
    Marnick Menting
    Participant

    Awesome, thanks!

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