Начало и ответ на вопрос зачем это было нужно тут >>
Решение:
В файле \media\zoo\applications\jbuniversal\elements\jbpriceadvance\jbpriceadvance.xml добавляем шаблон в список
<!-- custom params ######################################################################################### --> <param name="@custom_label" type="jbspacer" default="JBZOO_JBPRICE_TEMPLATE_CUSTOM_PARAMS_SPACER"/> <param name="template" type="list" default="default" label="JBZOO_JBPRICE_TEMPLATE" description="JBZOO_JBPRICE_TEMPLATE_DESC"> <option value="default">JBZOO_JBPRICE_TEMPLATE_DEFAULT</option> <option value="only_price">JBZOO_JBPRICE_TEMPLATE_ONLYPRICE</option> <option value="price_desc">JBZOO_JBPRICE_TEMPLATE_PRICEDESC</option> <option value="only_sku">JBZOO_JBPRICE_TEMPLATE_ONLYSKU</option> <option value="only_sale">JBZOO_JBPRICE_TEMPLATE_ONLYSALE</option> <option value="only_new">JBZOO_JBPRICE_TEMPLATE_ONLYNEW</option> <option value="only_hit">JBZOO_JBPRICE_TEMPLATE_ONLYHIT</option> <option value="only_balance">JBZOO_JBPRICE_TEMPLATE_ONLYBALANCE</option> <option value="only_buttons">JBZOO_JBPRICE_TEMPLATE_ONLYBUTTONS</option> </param>
В папке \media\zoo\applications\jbuniversal\elements\jbpriceadvance\tmpl создаем сам файл шаблона tmpl_price_desc.php
<?php /** * JBZoo App is universal Joomla CCK, application for YooTheme Zoo component * * @package jbzoo * @version 2.x Pro * @author JBZoo App http://jbzoo.com * @copyright Copyright (C) JBZoo.com, All rights reserved. * @license http://jbzoo.com/license-pro.php JBZoo Licence * @coder Denis Smetannikov <denis@jbzoo.com> */ // no direct access defined('_JEXEC') or die('Restricted access'); $uniqid = uniqid('jsJBPriceAdvance-'); ?> <span class="jbprice-price"> <?php if ($discount['value'] == 0) : ?> <?php echo $base['total']; ?> <?php endif; ?> <?php if ($discount['value'] > 0) : ?> <table cellpadding="0" cellspacing="0" border="0" class="no-border"> <tr> <td><?php echo JText::_('JBZOO_JBPRICE_PRICE_PRICE'); ?>:</td> <td><span class="jsPrice price discount-more"><?php echo $base['price']; ?></span></td> </tr> <tr> <td><?php echo JText::_('JBZOO_JBPRICE_PRICE_TOTAL'); ?>:</td> <td><span class="jsTotal total discount-more"><?php echo $base['total']; ?></span></td> </tr> <tr> <td><?php echo JText::_('JBZOO_JBPRICE_PRICE_NOT_SAVE'); ?>:</td> <td><span class="jsSave save discount-more"><?php echo $base['save']; ?></span> (<span class="discount">+<?php echo $discount['format']; ?></span>) </td> </tr> </table> <?php endif; ?> <?php if ($discount['value'] < 0) : ?> <table cellpadding="0" cellspacing="0" border="0" class="no-border"> <tr> <td><?php echo JText::_('JBZOO_JBPRICE_PRICE_PRICE'); ?>:</td> <td><span class="jsPrice price discount-less"><?php echo $base['price']; ?></span></td> </tr> <tr> <td><?php echo JText::_('JBZOO_JBPRICE_PRICE_TOTAL'); ?>:</td> <td><span class="jsTotal total discount-less"><?php echo $base['total']; ?></span></td> </tr> <tr> <td><?php echo JText::_('JBZOO_JBPRICE_PRICE_SAVE'); ?>:</td> <td><span class="save discount-less"><span class="jsSave"><?php echo $base['save']; ?></span> (<span class="discount"><?php echo $discount['format']; ?></span>)</span> </td> </tr> </table> <?php endif; ?> </span> <span class="jbprice-description jsDescription"><?php echo $basic['description'];?></span>
В файле \media\zoo\applications\jbuniversal\elements\jbpriceadvance\jbpriceadvance.php
/** * Render for front-end * @param array $params * @return string|void */ public function render($params = array()) { $params = $this->app->data->create($params); $template = $params->get('template', 'default'); if ($template == 'modal') { return $this->_renderTmplModal($params); } elseif ($template == 'default') { return $this->_renderTmplDefault($params); } elseif ($template == 'only_price') { return $this->_renderTmplOnlyPrice($params); } elseif ($template == 'price_desc') { return $this->_renderTmplPriceDesc($params); } elseif ($template == 'only_sku') { return $this->_renderTmplOnlySku($params); } elseif ($template == 'only_balance') { return $this->_renderTmplOnlyBalance($params); } elseif ($template == 'only_sale') { return $this->_renderTmplOnlySale($params); } elseif ($template == 'only_new') { return $this->_renderTmplOnlyNew($params); } elseif ($template == 'only_hit') { return $this->_renderTmplOnlyHit($params); } elseif ($template == 'only_buttons') { return $this->_renderTmplOnlyButtons($params); }
/** * Render "price desc" template * @param $params * @return string */ protected function _renderTmplPriceDesc($params) { $layout = $this->getLayout('tmpl_price_desc.php'); $prices = $this->_getTmplPrices($params); $currencyDefault = $params->get('currency_default', 'EUR'); $mainHash = $this->_getHash(); $prices = array($mainHash => $prices[$mainHash]); $basic = $this->_getBasicData(); return self::renderLayout($layout, array( 'params' => $params, 'basic' => $basic, 'base' => array( 'price' => $prices[$mainHash]['prices'][$currencyDefault]['price'], 'total' => $prices[$mainHash]['prices'][$currencyDefault]['total'], 'save' => $prices[$mainHash]['prices'][$currencyDefault]['save'], ), 'discount' => array( 'value' => (float)$basic['discount'], 'format' => $this->_jbmoney->toFormat($basic['discount'], $basic['discount_currency']), ) )); }
Получаем:
И так... добился чего хотел. И описание цены выводится и весит страница вместо 540 кб 125 кб.... так, что если говорить про оптимизацию, то неплохо... мусор ненужный отбросили...
Спасибо Cheren-dow за напутствия
Вроде ничего не забыл
Сообщение отредактировал Cheren-dow: 10 September 2014 - 08:52
добавил _renderTmplPriceDesc