How can i save the options user selected to the user's session?
Please if you don't have a solution, Give a suggestion.. I understand that I can ask or hire someone.. I'll be very happy to do so if i have the cash or if my project is up and running already.. Thanks
This is what i have tried.
function fn_save_product_options($product_id) {
if (empty($save_options)) {
if (fn_get_session_data('selected_options')) {
$save_options = fn_get_session_data('selected_options');
} else {
fn_set_session_data('selected_options', $save_options, COOKIE_ALIVE_TIME);
}
}
}
Use should pass $save_options array to the function parameters. E.g.
function fn_save_product_options($product_id, $save_options = array()) {
if (empty($save_options)) {
if (fn_get_session_data('selected_options')) {
$save_options = fn_get_session_data('selected_options');
} else {
fn_set_session_data('selected_options', $save_options, COOKIE_ALIVE_TIME);
}
}
}
Tried it but it didn't work, I'm just wondering if selected_options is the right thing to use..
How do you call this function?
How do you call this function?
I just place the snippet below inside "blocks/product_templates/default_template.tpl"
{$product.product_id|fn_save_product_options}
Then I place the snippet you shared inside "app/addons/my_changes/func.php"
It will not work. Looks like you do not understand CS-Cart cor well. So I suggest you again to hire someone to perform modification according to your needs