babyewok Posted June 20, 2014 Share Posted June 20, 2014 (edited) I am using the short product description as a subtitle for my products as teh short description section on its own isn't really needed. I have manage to append description_short after the product name (and strip the html tags) on pretty much the whole site. I have also managed to do so in the pdfs. However, I have now come across a hurdle: When the product has attributes, on the PDFs and also on the order detail section of the history and guest tracking pages, the attributes are included in the name and so my description is put last. The result is something like this: Name - Attribute: attibute value short description when it should be Name short description - Attribute: attibute value I have discovered that this is because $product.product_name and $order_detail.product_name values contain the attributes. I tracked this down to classes/order/OrderDetail.php, line 558: $this->product_name = $product['name']. ((isset($product['attributes']) && $product['attributes'] != null) ? ' - '.$product['attributes'] : ''); However, no matter what I do to try and change this section, there is never any change on the PDF of the order history/ guest page. What am I missing? I was assuming I could do something like this: $this->product_name = $product['name'].' '.$product['description_short']. ((isset($product['attributes']) && $product['attributes'] != null) ? ' - '.$product['attributes'] : ''); but it has had absolutely no effect whatsoever, even with refreshing the smarty cache, and deleting class_index.php I am using PS 1.5.6.2 Help! Edit: Eugh! and the same is also happening to the template change I made to _product_line.tpl in the admin theme as it also uses $product['product_name'] There must be an obvious way around this but everything I try is failing! Edited June 20, 2014 by babyewok (see edit history) Link to comment Share on other sites More sharing options...
babyewok Posted June 20, 2014 Author Share Posted June 20, 2014 (edited) Well I have at least managed to sort that out in the order confirmation email by editing the PaymentModule.php controller - but can't strip out the html form the description - strip_tags doesn't seem to work - any ideas on that? Edit: Aha - figured this one out! Now just to find out why my other override isn't working Edited June 20, 2014 by babyewok (see edit history) Link to comment Share on other sites More sharing options...
Mario_p Posted June 26, 2014 Share Posted June 26, 2014 May I know how you manage to strip the html tags from short description? Link to comment Share on other sites More sharing options...
babyewok Posted June 26, 2014 Author Share Posted June 26, 2014 In the case of the controller, it was simply: $this->product_name = $product['name'].' '.strip_tags($product['description_short']). ((isset($product['attributes']) && $product['attributes'] != null) ? ' - '.$product['attributes'] : ''); Link to comment Share on other sites More sharing options...
Recommended Posts