What’s going on in this code? Specifically,
$ title = trim($ title);
Because it looks like $ title is being assigned a value, then the entire value is being trimmed. It doesn’t make much sense to me.
$ title = $ address->getDiscountDescription(); $ description = $ address->getDiscountDescriptionArray(); //array(); foreach($ this->_cards as $ _id => $ value){ $ description[$ _id] = 'Gift Cards '.= $ value['card_code']; } $ description[$ quote->getRuleId()] = $ quote->getCouponCode(); $ codes = implode(",", $ this->_cardCodes); if(strlen($ codes) && !strpos($ title, 'Cards')){ $ title .= Mage::helper('giftcards')->__(' Gift Cards %s', $ codes); } $ title = trim($ title); $ address->setDiscountDescription($ title); $ address->setDiscountDescriptionArray($ description);