Jump to content

Edit History

AminaM

AminaM

Hi everyone!

I am really struggling with a problem and would like to know if anyone has a solution to offer. I want to, as an admin of my site, create a cart for another user of my shop and add a product to my cart.

This, to me, seems logical but it's not working (I get the ids before so that's not the problem):

                        $cart = new Cart();

                        $cart->id_customer = $id_customer;

                        $cart->id_currency = $currency->id;

                        $cart->id_lang = $id_lang;

                        $cart->id_shop = $id_shop;

                        $cart->add();

 

                        $productId = XXX (a valid product id);

                        $quantity = 1;

 

                        $cart->updateQty($quantity, $productId );

                        $cart->update();

 

Any help would be appreciated!

 

AminaM

AminaM

Hi everyone!

I am really struggling with a problem and would like to know if anyone has a solution to offer. I want to, as an admin of my site, create a cart for another user of my shop and add a product to my cart.

This, to me, seems logical but it's not working (I get the ids before so that's not the problem):

                        $cart = new Cart();

                        $cart->id_customer = $id_customer;

                        $cart->id_currency = $currency->id;

                        $cart->id_lang = $id_lang;

                        $cart->id_shop = $id_shop;

                        $cart->add();

 

                        $productId = $client[1];

                        $quantity = 1;

 

                        $cart->updateQty($quantity, $productId );

                        $cart->update();

 

Any help would be appreciated!

 

×
×
  • Create New...