X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   [Product Page] Tab for Short Description/Detailed Description (https://forum.x-cart.com/showthread.php?t=66751)

ADDISON 05-01-2013 09:55 AM

[Product Page] Tab for Short Description/Detailed Description
 
I wanted to add a tab in product page. It is called Description. If Short description or Detailed description variables are not empty to show one of them or both (if available) inside this tab.

I did this task easy:

1) I edit include/product_tabs.php as following:

after (line 50 v4.5.5 Gold+):

PHP Code:

$product_tabs = array(); 


I added:

PHP Code:

$empty_descr        $GLOBALS['smarty']->_tpl_vars['product']['descr'];
$empty_fulldescr    $GLOBALS['smarty']->_tpl_vars['product']['fulldescr'];

if(!empty(
$empty_descr) || !empty($empty_fulldescr)){
        
$product_tabs[] = array(
        
'title'  => func_get_langvar_by_name('lbl_description'),
        
'tpl'    => 'customer/main/product_descr.tpl',
        
'anchor' => 'descr'
    
);



2) I created a smarty template inside /common_files/customer/main/product_descr.tpl with the following content:

PHP Code:

{*
c863034063dde05a16bb4f2a2984f56cd779cc10v1 (xcart_4_5_5), 2013-05-01 14:29:28product_descr.tplrandom
vim
set ts=2 sw=2 sts=2 et:
*}

{if 
$product.descr}
    <
strong style="font-size:14px;">{$product.descr}.</strong>
{/if}
{
$product.fulldescr


but ...

QUESTION: I would like to ask an expert if I have already Short Description and Full Description available as PHP variables inside product_tabs.php file, and not using $GLOBALS (as I did above). Just a simple array $product['fulldescr']. Without adding no other statements!


All times are GMT -8. The time now is 06:08 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.