如何在prestashop中为用户更改购物车?

时间:2013-07-03 10:27:42

标签: prestashop

我需要创建一个链接,用来改变用户购物车的链接。

这是我试过的,但它不起作用

<?php
if (!defined('_PS_ADMIN_DIR_'))
    define('_PS_ADMIN_DIR_', (getcwd().'/../../') );//prima del require_once
require_once(dirname(__FILE__).'/../../config/config.inc.php');

...

$this->context->cookie->id_cart = 6;
$this->context->cart = new Cart(6);
$this->context->cookie->write();
$this->context->cookie->update();
Tools::redirect('index.php?controller=order');

1 个答案:

答案 0 :(得分:0)

怎么样:$ this-&gt; context-&gt; cart-&gt; id = 6?