Prestashop: add customized product to cart

前端 未结 2 1053
情深已故
情深已故 2020-12-15 14:48

I\'m writnig a custom controller for Prestashop. It is suposed to do a simple task: 1. Create a new cart if it wasn\'t created (working fine) 2. Get attribute ID from databa

2条回答
  •  我在风中等你
    2020-12-15 15:09

    The most simple to validate a cart:

    // Validate the object cart $this->context->cart->save(); $this->context->cookie->id_cart = (int)$this->context->cart->id;

    the save() method upate the cart if exists or create a new if not. Then force the cookie to have the same id.

提交回复
热议问题