简体   繁体   English

按顺序获取 id_cart_rules prestashop

[英]Get id_cart_rules prestashop in order

I need to get the id of the cart_Rule in the command, until now and tried with我需要在命令中获取 cart_Rule 的 id,直到现在并尝试使用

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

But I don't get a result但我没有得到结果

I managed to do it as follows:我设法做到了如下:

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

Working with version 1.7使用 1.7 版

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM