Merge pull request #103 from damonsk/patch4
[*] MO : crossselling - moved javascript include into header hook.
This commit is contained in:
@@ -115,6 +115,7 @@ class CrossSelling extends Module
|
|||||||
public function hookHeader()
|
public function hookHeader()
|
||||||
{
|
{
|
||||||
$this->context->controller->addCSS(($this->_path).'crossselling.css', 'all');
|
$this->context->controller->addCSS(($this->_path).'crossselling.css', 'all');
|
||||||
|
$this->context->controller->addJS(($this->_path).'js/crossselling.js');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -25,8 +25,7 @@
|
|||||||
|
|
||||||
{if isset($orderProducts) && count($orderProducts)}
|
{if isset($orderProducts) && count($orderProducts)}
|
||||||
<div id="crossselling">
|
<div id="crossselling">
|
||||||
<script type="text/javascript">var middle = {$middlePosition_crossselling};</script>
|
<script type="text/javascript">var cs_middle = {$middlePosition_crossselling};</script>
|
||||||
<script type="text/javascript" src="{$content_dir}modules/crossselling/js/crossselling.js"></script>
|
|
||||||
<h2 class="productscategory_h2">{l s='Customers who bought this product also bought:' mod='crossselling'}</h2>
|
<h2 class="productscategory_h2">{l s='Customers who bought this product also bought:' mod='crossselling'}</h2>
|
||||||
<div id="{if count($orderProducts) > 5}crossselling{else}crossselling_noscroll{/if}">
|
<div id="{if count($orderProducts) > 5}crossselling{else}crossselling_noscroll{/if}">
|
||||||
{if count($orderProducts) > 5}<a id="crossselling_scroll_left" title="{l s='Previous' mod='crossselling'}" href="javascript:{ldelim}{rdelim}">{l s='Previous' mod='crossselling'}</a>{/if}
|
{if count($orderProducts) > 5}<a id="crossselling_scroll_left" title="{l s='Previous' mod='crossselling'}" href="javascript:{ldelim}{rdelim}">{l s='Previous' mod='crossselling'}</a>{/if}
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ function cs_serialScrollFixLock(event, targeted, scrolled, items, position)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
if($('#crossselling_list').length > 0)
|
||||||
|
{
|
||||||
//init the serialScroll for thumbs
|
//init the serialScroll for thumbs
|
||||||
cs_serialScrollNbImages = $('#crossselling_list li').length;
|
cs_serialScrollNbImages = $('#crossselling_list li').length;
|
||||||
cs_serialScrollNbImagesDisplayed = 5;
|
cs_serialScrollNbImagesDisplayed = 5;
|
||||||
@@ -60,5 +62,6 @@ $(document).ready(function(){
|
|||||||
force:false,
|
force:false,
|
||||||
cycle:false
|
cycle:false
|
||||||
});
|
});
|
||||||
$('#crossselling_list').trigger( 'goto', [middle-3] );
|
$('#crossselling_list').trigger( 'goto', [cs_middle-3] );
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user