I need to get the id of the cart_Rule in the command, until now and tried with
$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