按顺序获取id_cart_rules prestashop

问题描述 投票:0回答:1

到目前为止,我需要在命令中获取cart_Rule的ID,然后尝试使用

$this->context->cart->getCartRules();

但是我没有得到结果

php prestashop cart
1个回答
0
投票

我设法做到了,如下所示:

  $regla =  $this->context->cart->getCartRules();//returns an array
  $codigo = $regla[0]["code"];

使用1.7版

© www.soinside.com 2019 - 2024. All rights reserved.