Witam,
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:
  1. <!-- MODULE Accessories -->
  2. {if isset($accessories) AND $accessories}
  3. <style>
  4. ul#idTab4
  5. {ldelim}
  6. display: none;
  7. {rdelim}
  8. </style>
  9. <script>
  10. $(document).ready(function () {ldelim}
  11. $("#more_info_tabs a").each(function() {ldelim}
  12. if ($(this).attr('href') == "#idTab4")
  13. $(this).css('display','none');
  14. {rdelim});
  15. {rdelim});
  16. </script>
  17. <div style="width:100%;height:15px;"></div>
  18. <div style="border: 1px #d0d3d8 solid;">
  19. <div id="pa_container" class="block_content{if $accessories|@count > 4} scroll-pane{/if}" style="{if $accessories|@count > 4}height:330px;{/if}">
  20. <b style="font-size:14px;margin-left: 5px;">{l s='Dodaj wzór' mod='productaccessories'}</b>
  21. <div style="height:8px;width:100%;clear:both"> </div>
  22. {foreach from=$accessories item=accessory name=accessories_list}
  23. <div class="ajax_block_product pa_block" style="width:50%;float:{if $smarty.foreach.accessories_list.iteration % 2 == 0}left;{else}right;{/if}">
  24. <center>
  25. {assign var='accessoryLink' value=$link->getProductLink($accessory.id_product, $accessory.link_rewrite, $accessory.category)}
  26. <h5 class="align_center"><a href="{$accessoryLink|escape:'htmlall':'UTF-8'}" target="_blank">{$accessory.name|truncate:20:'...'|escape:'htmlall':'UTF-8'}</a></h5>
  27. <p class="product_desc">
  28. <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>
  29. </p>
  30. <p class="product_accessories_price">
  31. <span class="price">{displayWtPrice p=$accessory.price}</span>
  32. <br />
  33. <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>
  34. </p>
  35. </center>
  36. </div>
  37. {if $smarty.foreach.accessories_list.iteration % 2 == 0}
  38. <div style="height:10px;width:100%;clear:both"> </div>
  39. {/if}
  40. {/foreach}
  41. </div>
  42. </div>
  43. {if $accessories|@count > 4}
  44. <script>
  45. $('document').ready( function() {ldelim}
  46. $('#pa_container').jScrollPane({ldelim}showArrows:true{rdelim});
  47. {rdelim});
  48. </script>
  49. {/if}
  50. <div style="height:10px;width:100%;clear:both"> </div>
  51. {/if}
  52. <!-- / MODULE Accessories -->
  53.  


Proszę o wskazówki

Wyglada na to ze problem moze byc w tym pliku:productaccessories.php
  1.  
  2. <?php
  3.  
  4. class ProductAccessories extends Module
  5. {
  6. function __construct()
  7. {
  8. $this->name = 'productaccessories';
  9. $this->tab = floatval(substr(_PS_VERSION_,0,3))<1.4?'Presto-Changeo':'front_office_features';
  10. $this->version = '1.2';
  11. if (floatval(substr(_PS_VERSION_,0,3)) >= 1.4)
  12. $this->author = 'Presto-Changeo';
  13.  
  14. parent::__construct();
  15.  
  16. $this->displayName = $this->l('Product Accessories');
  17. $this->description = $this->l('Display product accessories in a more visible location.');
  18. }
  19.  
  20. function install()
  21. {
  22. if (!parent::install())
  23. return false;
  24. if (!$this->registerHook('extraright') || !$this->registerHook('header'))
  25. return false;
  26. return true;
  27. }
  28.  
  29. /**
  30. * Returns module content
  31. *
  32. * @param array $params Parameters
  33. * @return string Content
  34. */
  35. function hookExtraRight($params)
  36. {
  37. global $smarty, $cookie, $protocol_content, $server_host;
  38.  
  39. $product = new Product(intval($_GET['id_product']), true, intval($cookie->id_lang));
  40. $accessories = $product->getAccessories(intval($cookie->id_lang));
  41. if (sizeof($accessories) < 1)
  42. return;
  43. $images = $product->getImages(intval($cookie->id_lang));
  44. $smarty->assign('pa_is_image', sizeof($images));
  45. $smarty->assign('pa_accessories_dir', $protocol_content.$server_host.__PS_BASE_URI__.'/modules/'.$this->name.'/');
  46. $smarty->assign('accessories', $accessories);
  47. $smarty->assign('pa_old_img', floatval(substr(_PS_VERSION_,0,3)) < 1.2?'1':'');
  48. return $this->display(__FILE__, 'productaccessories.tpl');
  49. }
  50.  
  51. function hookHeader()
  52. {
  53. global $smarty, $page_name;
  54. if ($page_name != 'product')
  55. return;
  56. $ps_version = floatval(substr(_PS_VERSION_,0,3));
  57. if ($ps_version < 1.4)
  58. return $this->display(__FILE__, 'header.tpl');
  59. else
  60. {
  61. Tools::addCSS(($this->_path).'css/pa.css', 'all');
  62. Tools::addCSS(($this->_path).'css/jScrollPane.css', 'all');
  63. Tools::addJS(($this->_path).'js/jquery.mousewheel.js');
  64. Tools::addJS(($this->_path).'js/jScrollPane.js');
  65. }
  66. }
  67.  
  68. function hookProductFooter($params)
  69. {
  70. global $smarty, $cookie, $protocol_content, $server_host;
  71.  
  72. $product = new Product(intval($_GET['id_product']), true, intval($cookie->id_lang));
  73. $accessories = $product->getAccessories(intval($cookie->id_lang));
  74. if (sizeof($accessories) < 1)
  75. return;
  76. $images = $product->getImages(intval($cookie->id_lang));
  77. $smarty->assign('pa_is_image', sizeof($images));
  78. $smarty->assign('pa_accessories_dir', $protocol_content.$server_host.__PS_BASE_URI__.'/modules/'.$this->name.'/');
  79. $smarty->assign('accessories', $accessories);
  80. $smarty->assign('pa_old_img', floatval(substr(_PS_VERSION_,0,3)) < 1.2?'1':'');
  81. return $this->display(__FILE__, 'productaccessoriescenter.tpl');
  82. }
  83. }
  84. ?>


Sprawdzajac zrodlo strony nie odnajduje plikow zalaczonych tutaj:
  1. function hookHeader()
  2. {
  3. global $smarty, $page_name;
  4. if ($page_name != 'product')
  5. return;
  6. $ps_version = floatval(substr(_PS_VERSION_,0,3));
  7. if ($ps_version < 1.4)
  8. return $this->display(__FILE__, 'header.tpl');
  9. else
  10. {
  11. Tools::addCSS(($this->_path).'css/pa.css', 'all');
  12. Tools::addCSS(($this->_path).'css/jScrollPane.css', 'all');
  13. Tools::addJS(($this->_path).'js/jquery.mousewheel.js');
  14. Tools::addJS(($this->_path).'js/jScrollPane.js');
  15. }
  16. }