HI, I’m using the template of online shop, but it doesn’t work.
none of the products are being added to the cart.
Some knows why this happens and how can I fix it?
Thanks in advance.
Edit:
It seems like the problem was in blank_add_cart App, the code is:
sc_exec_sql("INSERT INTO CART (session_id, productid, quantity) VALUES ('". session_id() ."', ". [v_product] .", 1)");
but in database the record added shows in session_id field: . session_id() . So, when the form_cart App ask in where statement for sesi?n_id the result is nothing.
What can I do, to solve this issue??
Edit2: I solved the problem, but I can’t explain why the original code didn’t work.
Original code of blan_add_cart App:
sc_exec_sql("INSERT INTO CART (session_id, productid, quantity) VALUES ('". Session_id() . "', ". [v_product] .", 1)");
sc_redir(form_cart);
Replaced code:
$sid = session_id();
sc_exec_sql("INSERT INTO CART (session_id, productid, quantity) VALUES ('".$sid. "', ". [v_product] .", 1)");
sc_redir(form_cart);
With this change all Works fine