Changing the discount description.
In my store, discounts vary depending on the customer logged in
I have a number of discount rules, which use session values, allocated from a recordset, filtered by the current customer
This all seems to work pretty well, but I would like to alter the description of the discount rule, as it appears in the cart.
(I realise I will need to hand code this on the cart_PHP.php page and not be able to re-enter the ecart object interface)
As an example, I have a discounts rule which appears as
$this->Discounts[] = new WA_eCart_Rule(urldecode("10%25%20Summer%20Special"), true, "WAEC_cscart_10SummerSpecial");
If I replace the string 10%25%20Summer%20Special with a different string, the function WAEC_cscart_10SummerSpecial is still called, so that’s great.
So
$this->Discounts[] = new WA_eCart_Rule(urldecode("15%25%20Winter%20Special "), true, "WAEC_cscart_10SummerSpecial");
Gives me a different description
However if I try to replace the string or part of the string with say, a session value, nothing appears for the session value, which I know is set.
I have tried the following, and neither work for me
$this->Discounts[] = new WA_eCart_Rule(urldecode($_SESSION[‘'VoucherCode']."%25%20Winter%20Special "), true, "WAEC_cscart_10SummerSpecial");
$this->Discounts[] = new WA_eCart_Rule($_SESSION['VoucherCode'].urldecode("10%25%20Summer%20Special"), true, "WAEC_cscart_10SummerSpecial");
I assume I'm missing something