Note that there are some explanatory texts on larger screens.

plurals
  1. POMagento 1.7 apply jcarousel on upsell products
    primarykey
    data
    text
    <p>I'm trying to apply jcarousel on the upsell products. I can't find a good tutorial on how to for Magento 1.7. </p> <p>I changed the upsell.phtml as follow:</p> <pre><code>&lt;?php if(count($this-&gt;getItemCollection()-&gt;getItems())): ?&gt; &lt;div class="box-collateral box-up-sell"&gt; &lt;p&gt;&lt;?php echo $this-&gt;__('Anderen bekeken ook:') ?&gt;&lt;/p&gt; &lt;div id="wrap"&gt; &lt;?php $this-&gt;setColumnCount(5); //uncomment this line if you want to have another number of columns. also can be changed in layout// ?&gt; &lt;?php $this-&gt;resetItemsIterator() ?&gt; &lt;?php for($_i=0;$_i&lt;$this-&gt;getRowCount();$_i++): ?&gt; &lt;ul id="mycarousel" class="jcarousel-skin-tango" style="overflow:hidden;position:relative"&gt; &lt;?php for($_j=0;$_j&lt;$this-&gt;getColumnCount();$_j++): ?&gt; &lt;?php if($_link=$this-&gt;getIterableItem()): ?&gt; &lt;li&gt; &lt;a href="&lt;?php echo $_link-&gt;getProductUrl() ?&gt;" title="&lt;?php echo $this- &gt;htmlEscape($_link-&gt;getName()) ?&gt;" class="product-image"&gt;&lt;img src="&lt;?php echo $this-&gt;helper('catalog/image')-&gt;init($_link, 'small_image')-&gt;resize(140) ?&gt;" width="140" height="140" alt="&lt;?php echo $this-&gt;htmlEscape($_link-&gt;getName()) ?&gt;" /&gt;&lt;/a&gt; &lt;?php echo $this-&gt;getPriceHtml($_link, true, '-upsell') ?&gt; &lt;/li&gt; &lt;?php else: ?&gt; &lt;li class="empty"&gt;&amp;nbsp;&lt;/li&gt; &lt;?php endif; ?&gt; &lt;?php endfor; ?&gt; &lt;/ul&gt; &lt;script type="text/javascript"&gt; function mycarousel_initCallback(carousel) { // Disable autoscrolling if the user clicks the prev or next button. carousel.buttonNext.bind('click', function() { carousel.startAuto(0); }); carousel.buttonPrev.bind('click', function() { carousel.startAuto(0); }); // Pause autoscrolling if the user moves with the cursor over the clip. carousel.clip.hover(function() { carousel.stopAuto(); }, function() { carousel.startAuto(); }); }; jQuery(document).ready(function() { jQuery('#mycarousel').jcarousel({ auto: 2, wrap: 'last', initCallback: mycarousel_initCallback }); }); function itemLoadCallbackFunction(carousel, state) { for (var i = carousel.first; i &lt;= carousel.last; i++) { // Check if the item already exists if (!carousel.has(i)) { // Add the item carousel.add(i, "I'm item #" + i); } } }; &lt;/script&gt; &lt;?php endfor; ?&gt; &lt;/div&gt; &lt;!--&lt;script type="text/javascript"&gt;decorateTable('upsell-product-table')&lt;/script&gt;--&gt; &lt;/div&gt; &lt;?php endif ?&gt; </code></pre> <p>I also added the jquery.jcarousel.mini.js and the query-1.9.0.min.js to load via the page.xml. </p> <p>Right now I get a vertical list containing al items. I want to have a horizontal list with 5 visible items scrolling automatically. Via link:</p> <p><a href="http://www.dotato.nl/olympus-stylus-750-7-1mp-digital-camera.html" rel="nofollow">http://www.dotato.nl/olympus-stylus-750-7-1mp-digital-camera.html</a></p> <p>Many thanks in advance for any help!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload