Quantcast
Channel: Opinion: Shopify Community - Shopify Design
Viewing all articles
Browse latest Browse all 57838

Jack Guo commented on Multiple currency problem

$
0
0

Hi Caroline, 

Below is the code for related products. It's been a while so I am sure where I got them from.

Cheers

{% assign image_size = 'compact' %}
{% assign heading = 'You might also like' %}
 
{% if product.tags.size > 0 %}
 <br>
<h3>{{ heading }}</h3>
<ul class="related-products"></ul>
 
<style type="text/css">
.related-products { list-style-type:none; border: solid 1px #ccc; 
 }
{% case image_size %}
{% when 'small' %}
.related-products * { font-size:15px; text-align:center; padding:0 }
.related-products h4  { border:none; margin:10px 0 0 0; line-height:1.3 }
.related-products div.image { height:100px }
.related-products li { float:left; width:120px; height:170px;margin-bottom:20px;  margin-left:20px; margin-right:20px }
{% when 'compact' %}
.related-products * { font-size:15px; text-align:center; padding:0 }
.related-products h4  { border:none; margin:5px 0 0 0; line-height:1.5 }
.related-products div.image { height:160px }
.related-products li { float:left; width:180px; height:270px;margin-bottom:20px; margin-left:20px; margin-right:25px }
{% when 'medium' %}
.related-products * { font-size:15px; text-align:center; padding:0 }
.related-products h4  { border:none; margin:10px 0 0 0; line-height:1.8 }
.related-products div.image { height:240px }
.related-products li { float:left; width:260px; height:310px; margin-bottom:20px; margin-left:20px;margin-right:25px }
{% endcase %}
.related-products { overflow:hidden }
.related-products span.money { font-size:1em }
.related-products li:last-child { margin-right:0 }
</style>
 
<script>
  !window.jQuery && document.write('<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"><\/script>';)
  

</script>
{{ 'api.jquery.js' | shopify_asset_url | script_tag }}
 
<script type="text/javascript" charset="utf-8">
//<![CDATA[
  // window.setInterval(function show_price() {
  //window.setTimeout(function() {
    var recommendations = [];
    {% for tag in product.tags %}
    recommendations.push('{{ tag | handle }}');
    {% endfor %}
    if (recommendations.length) {
      var list = jQuery('ul.related-products');
      for (var i=0; i<recommendations.length; i++) {
        jQuery.getJSON(recommendations[i] + '.js', function(product) {
          list.append('<li><div class="image"><a href="' + product.url +'"><img src="' + product.images[0].replace(/(\.jpg|\.png|\.jpeg|\.gif)/, '_{{ image_size }}$1') + '" /></a></div><h4><a href="' + product.url + '">' + product.title + '</a></h4><h3 style="color:red"><span class="money"> ' + Shopify.formatMoney(product.price, "{{ shop.money_format }}") + '</span></h3><br/></li>');
        });
      }
    }
     //}, 3000);
//]]>
</script>
 
{% endif %}


Viewing all articles
Browse latest Browse all 57838

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>