- Posts: 24
- Thank you received: 1
×
WooPrice Calculator PRO
[SOLVED]Remember options in session
- Marnick Menting
-
Topic Author
- Offline
Less
More
2 years 10 months ago #1216
by Marnick Menting
Marnick Menting replied the topic: [SOLVED]Remember options in session
Awesome, thanks!
Please Log in or Create an account to join the conversation.
- Enrico
-
- Offline
Less
More
- Posts: 367
- Thank you received: 18
2 years 10 months ago - 2 years 10 months ago #1197
by Enrico
Enrico replied the topic: [SOLVED]Remember options in session
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:
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
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:
<?php
global $woocommerce;
$items = $woocommerce->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
Last Edit: 2 years 10 months ago by Enrico.
Please Log in or Create an account to join the conversation.
- Marnick Menting
-
Topic Author
- Offline
Less
More
- Posts: 24
- Thank you received: 1
2 years 11 months ago #1128
by Marnick Menting
Marnick Menting created the topic: [SOLVED]Remember options in session
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.
Please Log in or Create an account to join the conversation.
Moderators: david
Time to create page: 0.158 seconds