I am adding a new product from another site and then I need to add that product into the cart.
All is working until I view the Cart in CS-Cart.
Here is what I’m doing…
in CS_Cart I’ve created my own controller which does the following.
I define all product information in a $data array() and
CALL - $product_id = fn_update_product($data); …
Product is added ok and shows up in the Catalog/Products
Then I tried to add the product to the cart.
$product = array(
$product_id => array(
‘product_id’ => $product_id,
‘amount’ => 1
)
);
$cart = $_SESSION[‘cart’];
$ids = fn_add_product_to_cart($product, $cart, $auth);
$_SESSION[‘cart’] = $cart;
I view $cart in the error_log() and all looks very good. New Item is in the cart:smile: .
But when I View the Cart in CS-Cart the new items are removed.
I also called the following functions hoping it would help.
fn_save_cart_content($_SESSION[‘cart’], $auth[‘user_id’]);
fn_calculate_cart_content($_SESSION[‘cart’], $auth, ‘S’);
What am I missing ?
Would the cart cache affect this ? and how do I update the cart cache ?
Some times if I log into the user account the new items show. I need this to work 100%.
Thanks,
Robert Campbell