View Single Post
  #13  
Old 05-14-2014, 04:02 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Custom Product Tabs

Hi Mark!

Thank you for the attach.

As for HTML text in the attribute values. The problem is that attribute values are already htmlentity encoded: http://www.php.net/htmlentities

and you need to decode them in your PHP code. So, your method getExtendedSpecAttributes() will look like this:

PHP Code:
protected function getExtendedSpecAttributes() 
    { 
        
$attributesToDisplay = array ('EXTENDED_SPECIFICATIONS'); 

        
$return = array(); 

        
$widgets $this->getAttributesWidgets(); 

        foreach (
$widgets as $widget) { 

            foreach (
$widget->getAttrList() as $attribute) { 

                if (
in_array(strtoupper($attribute['name']), $attributesToDisplay)) { 

                    
// this is the most recent change
                    
$attribute['value'] = html_entity_decode($attribute['value']);

                    
$return[] = $attribute;
                    
                } 

            } 

        } 

        return 
$return
    } 

The same change needs to be applied to getWhereUsedAttributes() method.

2) As regards to deleting these attributes from Specification section. I will publish code example in a couple of days.

Quote:
Originally Posted by Mark N
Sure - see attached.
Reply With Quote