View Single Post
  #10  
Old 05-08-2014, 08:14 AM
 
Mark N Mark N is offline
 

Senior Member
  
Join Date: Sep 2011
Posts: 121
 

Default Re: Custom Product Tabs

Tony,

Thanks for getting back to me.

Regarding {a.value:h}, it definitely doesn't work. Here is the full code from that tab - (extended_spec.tpl):
PHP Code:
{**  
 * @
ListChild(list="product.details.page.tab.extended_spec"
 *} 

<
ul class="extra-fields">

{foreach:
getExtendedSpecAttributes(),a}
<
div class="description product-description">{a.value:h}</div>
{
end:}
</
ul

Content for that tab is loaded using the function I developed with your assistance, which is in the View\Product\Details\Customer\Page\APage.php:

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)) { 

                    
$return[] = $attribute;
                    

                } 

            } 

        } 

        return 
$return
    } 

And no, HTML is definitely not being parsed - did some simple HTML code, it just renders it all as text.

Regarding the second piece, can you elaborate as to what I would put into the foreach ($widget->getAttrList() as $attribute) routine? Just to see what it would do, I put that code in, leaving the routine in question empty, it renders the "Description" tab with no attributes now, but it also empties out the code so no other tabs show up at all.
__________________
X-Cart Gold Plus 4.6.5
Mods - WebsiteCM Dynamic Product Tabs, Smack Digital CDSEO Pro, AlteredCart Smart Search, AlteredCart One Page Checkout, Cart Works Power Filter, Firetank Software Feed Manager
Reply With Quote