jiro Posted January 28, 2014 Share Posted January 28, 2014 Hello, is there a posibility to change a category description to plain text? Now when I add some text then it is added to <p></p>. I need this to xml products export(category description is exported in html tags). Prestashop 1.5.6.1 Regards. Link to comment Share on other sites More sharing options...
vekia Posted January 28, 2014 Share Posted January 28, 2014 how you generating this xml file? everything depends on it. Link to comment Share on other sites More sharing options...
jiro Posted January 28, 2014 Author Share Posted January 28, 2014 I have module to generate several xml files with products(for price comparison sites)... and in one of these I need to change category name to category description. I will show you a fragment of code: private function generateCategoryPath() { $Categories = self::getCategories($this->_id_lang, false, false, 'AND c.`id_category` > 1'); $Array = array(); foreach ($Categories as $c) { $Array[$c['id_category']] = $c; } foreach ($Array as $c) { $cParentId = $c['id_parent']; $pp = $c['name']; while ($cParentId) { if (isset($Array[$cParentId]['id_parent'])) { $pp = $Array[$cParentId]['name'] . "/" . $pp; $cParentId = $Array[$cParentId]['id_parent']; } else $cParentId = 0; } $Array[$c['id_category']]['path'] = $pp; this is original code, when I change "name" to "desc", then the description is shown but with html tags. Link to comment Share on other sites More sharing options...
vekia Posted January 29, 2014 Share Posted January 29, 2014 you can use strip_tags php function for example: $description = strip_tags($Array[$cParentId]['description']); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now