mam problem z dodatkiem do Prestashop 1.4 Product Accessories.
Po dodaniu więcej niż 4 akcesorii do produktu prawdopodobnie powinno uaktywnić się przewijanie stron. Niestety nie działa i kolejne akcesoria umieszczane są pod spodem.
Oto kod:
<!-- MODULE Accessories --> <style> ul#idTab4 {ldelim} display: none; {rdelim} </style> <script> $(document).ready(function () {ldelim} if ($(this).attr('href') == "#idTab4") $(this).css('display','none'); {rdelim}); {rdelim}); </script> <div style="width:100%;height:15px;"></div> <div style="border: 1px #d0d3d8 solid;"> <div id="pa_container" class="block_content{if $accessories|@count > 4} scroll-pane{/if}" style="{if $accessories|@count > 4}height:330px;{/if}"> <b style="font-size:14px;margin-left: 5px;">{l s='Dodaj wzór' mod='productaccessories'}</b> <div style="height:8px;width:100%;clear:both"> </div> {foreach from=$accessories item=accessory name=accessories_list} <div class="ajax_block_product pa_block" style="width:50%;float:{if $smarty.foreach.accessories_list.iteration % 2 == 0}left;{else}right;{/if}"> <center> {assign var='accessoryLink' value=$link->getProductLink($accessory.id_product, $accessory.link_rewrite, $accessory.category)} <h5 class="align_center"><a href="{$accessoryLink|escape:'htmlall':'UTF-8'}" target="_blank">{$accessory.name|truncate:20:'...'|escape:'htmlall':'UTF-8'}</a></h5> <p class="product_desc"> <a href="{$accessoryLink|escape:'htmlall':'UTF-8'}" target="_blank" title="{$accessory.legend|escape:'htmlall':'UTF-8'}" class="product_image"><img src="{if $pa_old_img}{$img_prod_dir}{$accessory.id_image}-medium.jpg{else}{$link->getImageLink($accessory.link_rewrite, $accessory.id_image, 'medium')}{/if}" alt="{$accessory.legend|escape:'htmlall':'UTF-8'}" /></a> </p> <p class="product_accessories_price"> <span class="price">{displayWtPrice p=$accessory.price}</span> <br /> <a class="button_small exclusive_small ajax_add_to_cart_button" style="margin-top:3px" href="{$base_dir}cart.php?qty=1&id_product={$accessory.id_product|intval}&token={$static_token}&add" rel="ajax_id_product_{$accessory.id_product|intval}" title="{l s='Add to cart' mod='productaccessories'}">{l s='Add' mod='productaccessories'}</a> </p> </center> </div> {if $smarty.foreach.accessories_list.iteration % 2 == 0} <div style="height:10px;width:100%;clear:both"> </div> {/if} {/foreach} </div> </div> <script> $('document').ready( function() {ldelim} $('#pa_container').jScrollPane({ldelim}showArrows:true{rdelim}); {rdelim}); </script> {/if} <div style="height:10px;width:100%;clear:both"> </div> {/if} <!-- / MODULE Accessories -->
Proszę o wskazówki
Wyglada na to ze problem moze byc w tym pliku:productaccessories.php
<?php class ProductAccessories extends Module { function __construct() { $this->name = 'productaccessories'; $this->version = '1.2'; $this->author = 'Presto-Changeo'; parent::__construct(); $this->displayName = $this->l('Product Accessories'); $this->description = $this->l('Display product accessories in a more visible location.'); } function install() { if (!parent::install()) return false; if (!$this->registerHook('extraright') || !$this->registerHook('header')) return false; return true; } /** * Returns module content * * @param array $params Parameters * @return string Content */ function hookExtraRight($params) { return; $smarty->assign('pa_accessories_dir', $protocol_content.$server_host.__PS_BASE_URI__.'/modules/'.$this->name.'/'); $smarty->assign('accessories', $accessories); return $this->display(__FILE__, 'productaccessories.tpl'); } function hookHeader() { if ($page_name != 'product') return; if ($ps_version < 1.4) return $this->display(__FILE__, 'header.tpl'); else { Tools::addCSS(($this->_path).'css/pa.css', 'all'); Tools::addCSS(($this->_path).'css/jScrollPane.css', 'all'); Tools::addJS(($this->_path).'js/jquery.mousewheel.js'); Tools::addJS(($this->_path).'js/jScrollPane.js'); } } function hookProductFooter($params) { return; $smarty->assign('pa_accessories_dir', $protocol_content.$server_host.__PS_BASE_URI__.'/modules/'.$this->name.'/'); $smarty->assign('accessories', $accessories); return $this->display(__FILE__, 'productaccessoriescenter.tpl'); } } ?>
Sprawdzajac zrodlo strony nie odnajduje plikow zalaczonych tutaj:
function hookHeader() { if ($page_name != 'product') return; if ($ps_version < 1.4) return $this->display(__FILE__, 'header.tpl'); else { Tools::addCSS(($this->_path).'css/pa.css', 'all'); Tools::addCSS(($this->_path).'css/jScrollPane.css', 'all'); Tools::addJS(($this->_path).'js/jquery.mousewheel.js'); Tools::addJS(($this->_path).'js/jScrollPane.js'); } }