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

Please help - Quick Order Printer Code Tweak by Emi S.

$
0
0

Hi there,

I am trying to make a polished receipt template through Order Printer that will be sent to customers via a link in their email.

If a customer has paid via credit card, it displays as "shopify_payments". I would like it to display the credit card company and last 4 digits.

So, THIS:
Payment Method: Visa •••• •••• •••• 4242

Instead of: 
Payment Method: shopify_payments
 

Here is the code in question:
<div style="margin: 0 0 0.5em 0">
<br><strong> Payment Method: </strong> {% if gateway %}{{ gateway }}{% else %}{% for tx_gateway in unique_gateways %}{{ tx_gateway }}{% endfor %}{% endif %}<br/>

Thank you in advance!

All the best,
Emi


JQuery Flickity Issue by Matthias

$
0
0

Hi y'all,

I am pretty new to html/css/javascript, but I have been managing to handle css code and everything straight css related works like a charme so far.

My problem is javascript/jquery related code. This is what I have been doing:

1. I uploaded "jquery-3.3.1.min.js" and "flickity.pkgd.min.js" (my code uses flickity, not sure if I added the right .js though) to the asset folder of my theme

2. I added 

{{ 'jquery-3.3.1.min.js' |  asset_url | script_tag }}
{{ 'flickity.pkgd.min.js' |  asset_url | script_tag }}

above the header of the theme.liquid file

3. I added the following code through a Shogun's html editor module (I have been adding all my html/css code with it so far)

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>...</title>
    
   <script>
      var $gallery1 = $('#slider-1 .slides').flickity({
  pageDots: false,
  prevNextButtons: false,
  wrapAround: true,
  draggable: false
});
   
var $gallery2 = $('#slider-2 .slides').flickity({
  pageDots: false,
  prevNextButtons: false,
  initialIndex: 1,
  wrapAround: true,
  draggable: false
});

$('.btn-next').on( 'click', function() {
  $gallery1.flickity('next');
  $gallery2.flickity('next');
});
    </script>
    <style type="text/css">
    
    #container_slider {
  width: 500px;
  height: 500px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
}

#slider-1 {
  width: 400px;
  //height: 400px;
}

#slider-2 {
  position: absolute;
  right: 0;
  top: 50px;
  width: 150px;
  height: 250px;
}

.slides {
  list-style: none;
  margin: 0;
  padding: 0;
  
  img {
    width: 100%;
    height: auto;
    display: block;
  }
}

/*! Flickity v1.0.2
https://flickity.metafizzy.co
---------------------------------------------- */

.flickity-enabled {
  position: relative;
}

.flickity-enabled:focus { outline: none; }

.flickity-viewport {
  overflow: hidden;
  position: relative;
  height: 100%;
}

.flickity-slider {
  position: absolute;
  width: 100%;
  height: 100%;
}

/* draggable */

.flickity-enabled.is-draggable {
  -webkit-tap-highlight-color: transparent;
          tap-highlight-color: transparent;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
}

.flickity-enabled.is-draggable .flickity-viewport {
  cursor: move;
  cursor: -webkit-grab;
  cursor: grab;
}

.flickity-enabled.is-draggable .flickity-viewport.is-pointer-down {
  cursor: -webkit-grabbing;
  cursor: grabbing;
}

.gallery-cell {
  width: 100%;
}

.btn-next {
  background: none;
  border: none;
  position: absolute;
  right: 0;
  bottom: 20px;  
  width: 60px;
  height: 20px;
  padding: 0;
  
  &:focus {
    outline: none;
  }
  
  svg {
    display: block;
    width: 60px;
    height: 20px;
    
    #arrow-line {
        transition: all 0.3s ease-out;
        transform-origin: right bottom;
      }
  }
  
  &:hover {
    svg {
      #arrow-line {
        transform: scaleX(1.5);
      }
    }
  }
}

</style>

  </head>
  <body>
   <div id="container_slider">

  <div id="slider-1">
    <ul class="slides">
      <li class="gallery-cell">
        <img src="https://cdn.shopify.com/s/files/1/2793/0346/files/Webp.net-resizeimage_1.jpg">
      </li>
      <li class="gallery-cell">
        <img src="https://cdn.shopify.com/s/files/1/2793/0346/files/antiguaguatemala-food-smoothie.jpg">
      </li>
      <li class="gallery-cell">
        <img src="https://cdn.shopify.com/s/files/1/2793/0346/files/Webp.net-resizeimage_1.jpg">
      </li>
    </ul>
  </div>

  <div id="slider-2">
    <ul class="slides">
      <li class="gallery-cell">
        <!--<img src="PICTURE LINK" />-->
        <img src="https://cdn.shopify.com/s/files/1/2793/0346/files/antiguaguatemala-food-smoothie.jpg">
      </li>
      <li class="gallery-cell">
        <img src="https://cdn.shopify.com/s/files/1/2793/0346/files/Webp.net-resizeimage_1.jpg">
      </li>
      <li class="gallery-cell">
        <img src="https://cdn.shopify.com/s/files/1/2793/0346/files/antiguaguatemala-food-smoothie.jpg">
      </li>
    </ul>

    <button class="btn-next">
      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29.3 13.4">
        <path id="arrow-line" fill="#231F20" d="M0 5.9h28.7v1H0z"/>
        <path fill="#231F20" d="M24.1 13.4l-.8-.6 4.8-6.4L23.3 0l.8-.6 5.2 7"/>
      </svg>
    </button>

  </div>

</div>
 
  </body>
</html>

 

 

 

The html/css part seem so work proper, the mistake seems to be the flickity/jquery part. 

I would be super grateful for any hint.

 

Thanks!!

Kathleen commented on Black divider line - Brooklyn (Product pages)

$
0
0

Can't find anything similar to that in my product template.

Vikas suyal commented on Price not changing with selected variant!!

$
0
0

Hi folks, My product variant prices are not changing , but in cart its getting correct price, Please help me to fix this...

 

*product.liquid* file

--------------------------------------------------------

<div id="col-main" class="product-page {% if settings.product_layout == 'left' or product.handle == "product-with-left-slidebar" or settings.product_layout == 'right' or product.handle == "product-with-right-slidebar" %}col-xs-24 col-sm-18 no_full_width{% else %}col-xs-24 col-sm-24{% endif %} {% if settings.product_layout == 'left' or product.handle == "product-with-left-slidebar"%}have-left-slidebar{% endif %}">
  <div itemscope itemtype="http://schema.org/Product">
    <meta itemprop="url" content="{{ product.url }}" />

    <div id="product" class="content clearfix">
      <div class="row pro-slider">
           <div class="col-lg-12">
      {% unless settings.product_layout == 'left' or product.handle == "product-with-left-slidebar" or settings.product_layout == 'right' or product.handle == "product-with-right-slidebar" %}

      {% endunless %}
            {% comment %}
      <div id="product-image" class="product-image row {% if settings.product_layout == 'left' or product.handle == "product-with-left-slidebar" or settings.product_layout == 'right' or product.handle == "product-with-right-slidebar" %}no_full_width col-sm-12{% endif %}">
      {% unless settings.product_layout == 'left' or product.handle == "product-with-left-slidebar" or settings.product_layout == 'right' or product.handle == "product-with-right-slidebar" %}
        <div id="detail-left-column" class="hidden-xs left-coloum col-sm-6 col-sm-6 not-animated" data-animate="fadeInRight">
          <div id="gallery_main" class="product-image-thumb thumbs full_width {% if product.images.size < 4 %}fix-width{% endif %}">
            <ul class="slide-product-image">
              {% for image in product.images %}
              <li class="image">
                <a href="{{ image | product_img_url: '1024x1024' }}" class="cloud-zoom-gallery{% if forloop.index == 1 %} active{% endif %}">
                  <img src="{{ image | product_img_url: 'compact' }}" alt="{{ image.alt | escape }}" />
                </a>
              </li>
              {% endfor %}
            </ul>
          </div>
        </div>
      {% endunless %}
        <div class="image featured {% unless settings.product_layout == 'left' or product.handle == "product-with-left-slidebar" or settings.product_layout == 'right' or product.handle == "product-with-right-slidebar" %}col-smd-12 col-sm-12{% endunless %} not-animated" data-animate="fadeInUp">
          {% if product.images.size > 0 %}       
          {% assign featured_image = product.selected_or_first_available_variant.featured_image | default: product.featured_image %} 
          <img src="{{ featured_image | img_url: '1024x1024' }}" alt="{{ featured_image.alt | escape }}" />
          {% endif %}
        </div>
      {% if settings.product_layout == 'left' or product.handle == "product-with-left-slidebar" or settings.product_layout == 'right' or product.handle == "product-with-right-slidebar" %}
        <div id="gallery_main" class="product-image-thumb thumbs no_full_width {% if product.images.size < 4 %}fix-width{% endif %}">
          <ul class="slide-product-image">
            {% for image in product.images %}
            <li class="image">
              <a href="{{ image | product_img_url: '1024x1024' }}" class="cloud-zoom-gallery{% if forloop.index == 1 %} active{% endif %}">
                <img src="{{ image | product_img_url: 'compact' }}" alt="{{ image.alt | escape }}" />
              </a>
            </li>
            {% endfor %}
          </ul>
        </div>
      {% endif %}
      {% if settings.product_layout == 'full' %}
        <div id="gallery_main" class="visible-xs product-image-thumb thumbs mobile_full_width {% if product.images.size < 4 %}fix-width{% endif %}">
          <ul class="slide-product-image">
            {% for image in product.images %}
            <li class="image">
              <a href="{{ image | product_img_url: '1024x1024' }}" class="cloud-zoom-gallery{% if forloop.index == 1 %} active{% endif %}">
                <img src="{{ image | product_img_url: 'compact' }}" alt="{{ image.alt | escape }}" />
              </a>
            </li>
            {% endfor %}
          </ul>
        </div>
      {% endif %}

        {% if settings.share_button %}
        <div id="detail-right-column" class="right-coloum {% unless settings.product_layout == 'left' or product.handle == "product-with-left-slidebar" or settings.product_layout == 'right' or product.handle == "product-with-right-slidebar" %}col-sm-6{% endunless %} not-animated" data-animate="fadeInLeft">
          {{ settings.add_code_share }}
        </div>
        {% endif %}

      </div>
{% endcomment %}
      <div id="stx-gallery">
          {% for image in product.images %}
            <div class="storex-gallery" data-storex-image-id={{image.id}} data-storex-image-path={{image.src | img_url: 'icon'}}>
                <a href="{{ image | product_img_url: 'master' }}" title="{{ product.metafields.global.title_tag | escape }}">
                  <img  src="{{ image | product_img_url: '1024x1024' }}"
                        alt="{{ product.metafields.global.title_tag | escape }}"
                         />
                </a>
            </div>
          {% endfor %}
      </div>

      <div id="stx-carousel">
          {% for image in product.images %}
            <div class="storex-carousel" data-storex-image-id={{image.id}} data-storex-image-path={{image.src | img_url: 'icon'}}>
                <img src="{{ image | product_img_url: '1024x1024' }}" alt="{{ product.metafields.global.title_tag | escape }}" />
            </div>
          {% endfor %}
      </div>
      
      <script>
        document.addEventListener("DOMContentLoaded", function () {
          
          document.stxGalleryData = {
            gallery : {
              slidesToShow: 1,
              slidesToScroll: 1,
              arrows: false,
              fade: true,
              autoplay: false,
              autoplaySpeed: 3000,
              asNavFor: '#stx-carousel'
              },
            carousel : {
              slidesToShow: 6,
              slidesToScroll: 1,
              asNavFor: '#stx-gallery',
              dots: false,
              centerMode: true,
              focusOnSelect: true
            }
          };

          window.jQueryStx('#stx-gallery').slick(document.stxGalleryData.gallery);
          window.jQueryStx('#stx-carousel').slick(document.stxGalleryData.carousel);
                    
          /*http://www.jacklmoore.com/zoom/*/
          var zoomElements = document.querySelectorAll('.storex-gallery');
          for (var i = 0; i < zoomElements.length; i++) {
            window.jQueryStx(zoomElements[i]).zoom({url: zoomElements[i].dataset.storexZoomUrl});
          }
          
        });
      </script>
      </div>
      <div id="product-information" class="col-lg-12 product-information text-center {% if settings.product_layout == 'left' or product.handle == "product-with-left-slidebar" or settings.product_layout == 'right' or product.handle == "product-with-right-slidebar" %}no_full_width col-sm-12{% endif %}">
        {% if settings.product_layout == 'left' or product.handle == "product-with-left-slidebar" or settings.product_layout == 'right' or product.handle == "product-with-right-slidebar" %}
        <h1 id="page-title" class="text-center">
          <span itemprop="name">{{ product.title }}</span>
        </h1>
        {% endif %}
        <div id="product-header" class="clearfix">
          
          <div id="product-info-right">     
            <div itemprop="offers" itemscope itemtype="http://schema.org/Offer" class="group-variants">
              <h6>Buying Option</h6>
              <meta itemprop="priceCurrency" content="{{ shop.currency }}" />

              {% if product.available %}
              <link itemprop="availability" href="http://schema.org/InStock" />

              {% assign hide_default_title = false %}
              {% if product.variants.size == 1 and product.variants.first.title contains 'Default' %}
              {% assign hide_default_title = true %}
              {% endif %} 

              <form action="/cart/add" method="post" class="variants" id="product-actions">
                <div id="product-actions-{{ product.id }}" class="options clearfix">

                  {% if settings.color_swatch %}
                  {% if product.available %}
                  {% for option in product.options %}
                  {% include 'swatch' with option %}
                  {% endfor %}
                  {% endif %}
                  {% endif %}

                  <div class="variants-wrapper clearfix{% if hide_default_title %} hide{% endif %}"> 
                    <select id="product-select-{{ product.id }}" name="id" style="display: none;">
                      {% for variant in product.variants %}
                      <option {% if variant == product.selected_or_first_available_variant %} selected="selected" {% endif %} value="{{ variant.id }}">{{ variant.title }}</option>
                      {% endfor %}
                    </select>
                  </div>         
                  <div class="quantity-wrapper clearfix">
                    <label class="wrapper-title">Qty</label>
                      <!---<input id="quantity" type="text" name="quantity" value="1" maxlength="5" size="5" class="item-quantity" />-->
                     {% assign numbers = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15" | split: ','%}
                      <select id="quantity" name="quantity" class="item-quantity col-lg-24">
                       {% for number in numbers %}
                       <option>{{number}}</option>
                        {% endfor %}
                      </select>
                  </div>
                    <div class="product-price" id="purchase" >
                        <div id="price" class="detail-price" itemprop="price">
                      {{ product.price | money }}
                    </div>
                  </div>

                  <div class="others-bottom clearfix">
                    <button id="add-to-cart" class="btn btn-1 add-to-cart" data-parent=".product-information" type="submit" name="add">Add to Cart</button>
                  </div>

                </div>
              </form>

              {% if settings.show_wish_list or settings.prduct_detail_email %}
              <div class="wls">

                {% if settings.show_wish_list %}
                {% if customer %}
                {% include 'wish-list' %}
                {% else %}
                <a class="wish-list" href="/account/login"><i class="fa fa-heart"></i> WISHLIST</a>
                {% endif %}
                {% endif %}

                {% if settings.show_wish_list and settings.prduct_detail_email %}
                <span>|</span>
                {% endif %}

                {% if settings.prduct_detail_email %}
                <a href="mailto:{{ settings.prduct_detail_email_address }}"><i class="fa fa-envelope"></i> {{ settings.prduct_detail_email_title }}</a>
                {% endif %}

              </div>
              {% endif %}

              {% else %}
              <link itemprop="availability" href="http://schema.org/OutOfStock" />
              <meta itemprop="price" content="{{ product.price | money }}" />

              <div id="product-actions" class="sold-out">
                <div id="purchase">
                  <p class="price">Sold out.</p>      
                </div>
              </div>      
              {% endif %}
            </div>
            <script type="text/javascript">

              // initialize multi selector for product
              $(window).load(function() {

                /* selectCallback */
                var selectOptionsCallback = function(variant, selector) {

                  if (variant) {
                    var form = jQuery('#' + selector.domIdPrefix).closest('form');
                    for (var i=0,length=variant.options.length; i<length; i++) {
                      var radioButton = form.find('.swatch[data-option-index="' + i + '"] :radio[value="' + variant.options[i] +'"]');
                      if (radioButton.size()) {
                        radioButton.get(0).checked = true;
                      }
                    }
                  }

                  if (variant && variant.featured_image) {
                      var newImage = variant.featured_image; // New image object.
                      var mainImageDomEl = jQuery('.featured img')[0]; // DOM element of main image we need to swap.
                      Shopify.Image.switchImage(newImage, mainImageDomEl, switchImage); // Define switchImage (the callback) in your theme's JavaScript file.
                    }

                  var add_to_cart = '#add-to-cart';
                  var $price = '#purchase-' + selector.product.id.toString() + ' .detail-price';
                  if (variant && variant.available) {
                    // selected a valid variant
                    $(add_to_cart).removeClass('disabled').removeAttr('disabled'); // remove unavailable class from add-to-cart button, and re-enable button

                    if(variant.compare_at_price == null){
                      $($price).html('<span class="price">'+Shopify.formatMoney(variant.price, "{{shop.money_format}}")+'</span>');

                      {% if settings.show_multiple_currencies %}
                      /* Update currency */
                      currenciesCallbackSpecial('#product-information span.money');
                       {% endif %}
                       } else {
                         $($price).html('<del class="price_compare">' + Shopify.formatMoney(variant.compare_at_price, "{{shop.money_format}}") + '</del>' + '<span class="price_sale">'+Shopify.formatMoney(variant.price, "{{shop.money_format}}") + '</span>');

                         {% if settings.show_multiple_currencies %}
                         /* Update currency */
                         currenciesCallbackSpecial('#product-information span.money');
                          {% endif %}
                          }
                         } else {
                           $(add_to_cart).addClass('disabled').attr('disabled', 'disabled'); // set add-to-cart button to unavailable class and disable button
                           var message = variant ? "Sold Out" : "Unavailable";
                           $($price).html('<span class="unavailable">' + message + '</span>');
                         }
                       };

                       new Shopify.OptionSelectors("product-select-{{ product.id }}", { product: {{ product | json }}, onVariantSelected: selectOptionsCallback, enableHistoryState: true });

                       $('.single-option-selector').customStyle();

                       // Add label if only one product option and it isn't 'Title'.
                       {% if product.options.size == 1 and product.options.first != 'Title' %}
                       $('#product-actions-{{ product.id }} .selector-wrapper:eq(0)').prepend('<label>{{ product.options.first }}</label>');
                        {% endif %}

                        // Auto-select first available variant on page load.
                        {% assign found_one_in_stock = false %}
                        {% for variant in product.variants %}
                        {% if variant.available and found_one_in_stock == false %}
                        {% assign found_one_in_stock = true %}
                        {% for option in product.options %}
                        $('.single-option-selector:eq({{ forloop.index0 }})').val({{ variant.options[forloop.index0] | json }}).trigger('change');
                         {% endfor %}
                         {% endif %}
                         {% endfor %}
                         });
            </script>
              {% comment %} Tabs Panel{% endcomment %}
                {% if settings.enable_tabpanel %}

                <ul id="tabs_detail" class="tabs-panel-detail hidden-xs hidden-sm">
                  {% if settings.display_mspecs %}
                  <li class="first"><h6><a href="#pop-one" class="fancybox"><i class="fa fa-angle-right"></i> {{ settings.mspecs_title }}</a></h6></li>
                  {% endif %}
                  {% if settings.display_custom_tab %}
                  <li><h6><a href="#pop-two" class="fancybox"><i class="fa fa-angle-right"></i> {{ settings.custom_tab_title }}</a></h6></li>
                  {% endif %}
                  {% if settings.display_size_chart %}
                  <li><h6><a href="#pop-three" class="fancybox"><i class="fa fa-angle-right"></i> {{ settings.size_chart_title }}</a></h6></li>
                  {% endif %}
                  <li><h6><a href="#pop-four" class="fancybox"><i class="fa fa-angle-right"></i> Ingredients</a></h6></li>
                </ul>
                
                <div id="pop-one" style="display: none;">
                  <img src={{"mspecs_image.jpg" | asset_url }} alt="" />
                </div>
                <div id="pop-two" style="display: none;">
                  {{ settings.custom_tab_content }}
                </div>
                <div id="pop-three" style="display: none;">
                  <img src={{"size_chart_image.jpg" | asset_url }} alt="" />
                </div>
            {% assign instructions = product.metafields.instructions %}
            {% assign key = 'Dry' %}
             <div id="pop-four" style="display: none;">
                  <h5>Ingredients:</h5>
                  {{ instructions.Dry }}
                </div>
              {% endif %}
          </div>  
        </div>
      </div>  
      </div>
      <!----------------------------------------Slider end here---------------------->
      
      <div class="row"><div id="product-info-left" class="col-sm-24">
            <div class="description">
              <h3 class="general-title text-center"><span class="small-head">Product Descriptions</span></h3>
              {{ product.description }}
            </div>
            <div class="relative">
              <ul class="list-unstyled">
                {% if product.tags.size > 0 %}
                {% if collection == null or collection.handle == 'frontpage' or collection.handle == 'all' %}
                {% assign found_a_collection = false %}
                {% for c in product.collections %}
                {% if found_a_collection == false and c.handle != 'frontpage' and c.handle != 'all' and c.all_products_count > 1 %}
                {% assign found_a_collection = true %}
                {% assign collection = c %}
                {% endif %}
                {% endfor %}
                {% endif %}
                <li class="tags">
                  <h6>TAGS :</h6>
                  {% for tag in product.tags %}
                  <a href="/collections/{{ collection.handle }}/{{ tag | handle }}">
                    {% if forloop.index < product.tags.size %}
                    {{ tag | handle }}<span>,</span>
                    {% else %}
                    {{ tag | handle }}
                    {% endif %}
                  </a>
                  {% endfor %}
                </li>
                {% endif %}
              </ul>
            </div>
          </div></div>
      {% if settings.enable_rating_product %} <div id="shopify-product-reviews" data-id="{{product.id}}">{{ product.metafields.spr.reviews }}</div>{% endif %}
    </div>
     
  </div>
 
  
  {% include 'related-products' %}
  
</div>

{% if settings.product_layout == 'left' or product.handle == "product-with-left-slidebar" %}
  <div class="left-slidebar col-xs-24 col-sm-6">
    {% include 'sidebar-prodcoll' %}
  </div>
{% endif %}

{% if settings.product_layout == 'right' or product.handle == "product-with-right-slidebar" %}
  <div class="right-slidebar col-xs-24 col-sm-6">
    {% include 'sidebar-prodcoll' %}
  </div>
{% endif %}

{% unless settings.product_layout == 'left' or product.handle == "product-with-left-slidebar" or settings.product_layout == 'right' or product.handle == "product-with-right-slidebar" %}
<script>
  $(window).scroll(function() {
    if($(window).innerWidth() >= 768 ){
    var scrollbar = jQuery('#detail-left-column');
    var scrolltop = jQuery(window).scrollTop();
    
    if(scrolltop > jQuery(scrollbar).parent().offset().top){
      if((scrolltop + jQuery(scrollbar).height()) <= (jQuery(scrollbar).parent().offset().top + jQuery(scrollbar).parent().height())){
        jQuery(scrollbar).animate({ top: (jQuery(window).scrollTop() - jQuery(scrollbar).parent().offset().top) + "px" }, { queue: false, easing: 'swing', duration: 700 });
      }
      else{
        var i = (jQuery(scrollbar).parent().height() - jQuery(scrollbar).height())+7+"px";
        jQuery(scrollbar).animate({ top: i }, { queue: false, easing: 'swing', duration: 1000 });
      }
    }
    else if(scrolltop < (jQuery(scrollbar).parent().offset().top)){
      jQuery(scrollbar).animate({ top: "0px" }, { queue: false, easing: 'swing', duration: 1000 });
    }
    var scrollbar2 = jQuery('#detail-right-column');
    if(scrolltop > jQuery(scrollbar2).parent().offset().top){
      if((scrolltop + jQuery(scrollbar2).height() -7) <= (jQuery(scrollbar2).parent().offset().top + jQuery(scrollbar2).parent().height())){
        jQuery(scrollbar2).animate({ top: (jQuery(window).scrollTop() - jQuery(scrollbar2).parent().offset().top) + "px" }, { queue: false, easing: 'swing', duration: 700 });
      }
      else{
        var i = (jQuery(scrollbar2).parent().height() - jQuery(scrollbar2).height())+"px";
        jQuery(scrollbar2).animate({ top: i }, { queue: false, easing: 'swing', duration: 1000 });
      }
    }
    else if(scrolltop < (jQuery(scrollbar2).parent().offset().top)){
      jQuery(scrollbar2).animate({ top: "0px" }, { queue: false, easing: 'swing', duration: 1000 });
    }
    }
  });
</script>
{% endunless %}

 

MattGems commented on Narrative - Sub Categories / Navigation

$
0
0

What about making a new page with collections on Narrative?

Price doesn't change when a different priced variant is selected. by Aaron H

$
0
0

As the title states, on my site when I select a different variant of a product that has a different price the price does not change, still displaying the cheapest price. The correct price does show up when added to cart but I need the price to be updated on the product page. I'm using debut theme and I've looked through other posts with the same issues but I can't find what to change in my product.liquid. 

Here is my product.liquid as it stands. Thanks!

<div class="product-template__container page-width" itemscope itemtype="http://schema.org/Product" id="ProductSection-{{ section.id }}" data-section-id="{{ section.id }}" data-section-type="product" data-enable-history-state="true">
  <meta itemprop="name" content="{{ product.title }}">
  <meta itemprop="url" content="{{ shop.url }}{{ product.url }}">
  <meta itemprop="image" content="{{ product.featured_image.src | img_url: '800x' }}">

  {% comment %}
    Get first variant, or deep linked one
  {% endcomment %}
  {%- assign current_variant = product.selected_or_first_available_variant -%}
  {%- assign product_image_zoom_size = '1024x1024' -%}
  {%- assign product_image_scale = '2' -%}
  {%- assign enable_zoom = section.settings.enable_zoom -%}

  {% case section.settings.image_size %}
    {% when 'small' %}
      {%- assign product_image_width = 'medium-up--one-third' -%}
      {%- assign product_description_width = 'medium-up--two-thirds' -%}
      {%- assign product_thumbnail_width = 'medium-up--one-third' -%}
      {%- assign height = 345 -%}
    {% when 'medium' %}
      {%- assign product_image_width = 'medium-up--one-half' -%}
      {%- assign product_description_width = 'medium-up--one-half' -%}
      {%- assign product_thumbnail_width = 'medium-up--one-quarter' -%}
      {%- assign height = 530 -%}
    {% when 'large' %}
      {%- assign product_image_width = 'medium-up--two-thirds' -%}
      {%- assign product_description_width = 'medium-up--one-third' -%}
      {%- assign product_thumbnail_width = 'medium-up--one-fifth' -%}
      {%- assign height = 720 -%}
    {% when 'full' %}
      {%- assign product_image_width = '' -%}
      {%- assign product_description_width = '' -%}
      {%- assign product_thumbnail_width = 'medium-up--one-eighth' -%}
      {%- assign height = 1090 -%}
      {%- assign enable_zoom = false -%}
  {% endcase %}

  <div class="grid product-single">
    <div class="grid__item product-single__photos {{ product_image_width }}{% if section.settings.image_size == 'full' %} product-single__photos--full{% endif %}">
      {%- assign featured_image = product.selected_or_first_available_variant.featured_image | default: product.featured_image -%}
      {% for image in product.images %}
        {% capture img_id %}FeaturedImage-{{ section.id }}-{{ image.id }}{% endcapture %}
        {% capture img_class %}product-featured-img{% endcapture %}
        {% capture zoom_img_id %}FeaturedImageZoom-{{ section.id }}-{{ image.id }}{% endcapture %}
        {% capture img_wrapper_id %}{{ zoom_img_id }}-wrapper{% endcapture %}
        {%- assign img_url = image | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}

        {% include 'image-style' with small_style: true, width: height, height: height, wrapper_id: img_wrapper_id, img_id: img_id %}

        <div id="{{ img_wrapper_id }}" class="product-single__photo-wrapper js">
          <div id="{{ zoom_img_id }}" style="padding-top:{{ 1 | divided_by: image.aspect_ratio | times: 100}}%;" class="product-single__photo{% if enable_zoom %} js-zoom-enabled{% endif %}{% if product.images.size > 1 %} product-single__photo--has-thumbnails{% endif %}{% unless featured_image == image %} hide{% endunless %}" data-image-id="{{ image.id }}"{% if enable_zoom %} data-zoom="{{ image | img_url: product_image_zoom_size, scale: product_image_scale }}"{% endif %}>
            <img id="{{ img_id }}"
                 class="feature-row__image {{ img_class }} lazyload{% unless featured_image == image %} lazypreload{% endunless %}"
                 src="{{ image | img_url: '300x300' }}"
                 data-src="{{ img_url }}"
                 data-widths="[180, 360, 540, 720, 900, 1080, 1296, 1512, 1728, 2048]"
                 data-aspectratio="{{ image.aspect_ratio }}"
                 data-sizes="auto"
                 alt="{{ image.alt | escape }}">
          </div>
        </div>
      {% endfor %}

      <noscript>
        {% capture product_image_size %}{{ height }}x{% endcapture %}
        <img src="{{ featured_image | img_url: product_image_size, scale: product_image_scale }}" alt="{{ featured_image.alt }}" id="FeaturedImage-{{ section.id }}" class="product-featured-img" style="max-width: {{ height }}px;">
      </noscript>

      {% if product.images.size > 1 %}
        {% if product.images.size > 3 %}
          {%- assign enable_thumbnail_slides = true -%}
        {% endif %}

        <div class="thumbnails-wrapper{% if enable_thumbnail_slides == true %} thumbnails-slider--active{% endif %}">
          {% if enable_thumbnail_slides == true %}
            <button type="button" class="btn btn--link medium-up--hide thumbnails-slider__btn thumbnails-slider__prev thumbnails-slider__prev--{{ section.id }}">
              {% include 'icon-chevron-left' %}
              <span class="icon__fallback-text">{{ 'sections.slideshow.previous_slide' | t }}</span>
            </button>
          {% endif %}
          <ul class="grid grid--uniform product-single__thumbnails product-single__thumbnails-{{ section.id }}">
            {% for image in product.images %}
              <li class="grid__item {{ product_thumbnail_width }} product-single__thumbnails-item js">
                <a href="{{ image.src | img_url: product_image_zoom_size, scale: product_image_scale }}"
                   class="text-link product-single__thumbnail product-single__thumbnail--{{ section.id }}"
                   data-thumbnail-id="{{ image.id }}"
                   {% if enable_zoom %}data-zoom="{{ image.src | img_url: product_image_zoom_size, scale: product_image_scale }}"{% endif %}>
                     <img class="product-single__thumbnail-image" src="{{ image.src | img_url: '110x110', scale: 2 }}" alt="{{ image.alt | escape }}">
                </a>
              </li>
            {% endfor %}
          </ul>
          {% if enable_thumbnail_slides == true %}
            <button type="button" class="btn btn--link medium-up--hide thumbnails-slider__btn thumbnails-slider__next thumbnails-slider__next--{{ section.id }}">
              {% include 'icon-chevron-right' %}
              <span class="icon__fallback-text">{{ 'sections.slideshow.next_slide' | t }}</span>
            </button>
          {% endif %}
        </div>
      {% endif %}
    </div>

    <div class="grid__item {{ product_description_width }}">
      <div class="product-single__meta">

        <h1 itemprop="name" class="product-single__title">{{ product.title }}</h1>

        {% if section.settings.show_vendor %}
          <p itemprop="brand" class="product-single__vendor">{{ product.vendor }}</p>
        {% endif %}

        <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
          <meta itemprop="priceCurrency" content="{{ shop.currency }}">

          <link itemprop="availability" href="http://schema.org/{% if product.available %}InStock{% else %}OutOfStock{% endif %}">

          <p class="product-single__price product-single__price-{{ section.id }}{% unless current_variant.available %} product-price--sold-out{% endunless %}">
            {% if current_variant.compare_at_price > current_variant.price %}
                <span class="visually-hidden">{{ 'products.product.regular_price' | t }}</span>
                <s id="ComparePrice-{{ section.id }}">{{ current_variant.compare_at_price | money }}</s>
                <span class="product-price__price product-price__price-{{ section.id }} product-price__sale product-price__sale--single">
                  <span id="ProductPrice-{{ section.id }}"
                    itemprop="price" content="{{ current_variant.price | divided_by: 100.00 }}">
                    {{ current_variant.price | money }}
                  </span>
                  <span class="product-price__sale-label product-price__sale-label-{{ section.id }}">{{ 'products.product.on_sale' | t }}</span>
                </span>
            {% else %}
              <span class="visually-hidden">{{ 'products.product.regular_price' | t }}</span>
              <s id="ComparePrice-{{ section.id }}" class="hide">{{ current_variant.compare_at_price | money }}</s>
              <span class="product-price__price product-price__price-{{ section.id }}">
                <span id="ProductPrice-{{ section.id }}"
                  itemprop="price" content="{{ current_variant.price | divided_by: 100.00 }}">
                  {{ current_variant.price | money }}
                </span>
                <span class="product-price__sale-label product-price__sale-label-{{ section.id }} hide">{{ 'products.product.on_sale' | t }}</span>
              </span>
            {% endif %}
          </p>

          <form action="/cart/add" method="post" enctype="multipart/form-data" class="product-form product-form-{{ section.id }}{% unless section.settings.show_variant_labels %} product-form--hide-variant-labels{% endunless %}" data-section="{{ section.id }}">
            {% unless product.options.size == 1 and product.variants[0].title == 'Default Title' %}
              {% for option in product.options_with_values %}
                <div class="selector-wrapper js product-form__item">
                  <label {% if option.name == 'default' %}class="label--hidden" {% endif %}for="SingleOptionSelector-{{ forloop.index0 }}">
                    {{ option.name }}
                  </label>
                  <select class="single-option-selector single-option-selector-{{ section.id }} product-form__input" id="SingleOptionSelector-{{ forloop.index0 }}" data-index="option{{ forloop.index }}">
                    {% for value in option.values %}
                      <option value="{{ value | escape }}"{% if option.selected_value == value %} selected="selected"{% endif %}>{{ value }}</option>
                    {% endfor %}
                  </select>
                </div>
              {% endfor %}
            {% endunless %}

            <select name="id" id="ProductSelect-{{ section.id }}" data-section="{{ section.id }}" class="product-form__variants no-js">
              {% for variant in product.variants %}
                {% if variant.available %}
                  <option {% if variant == product.selected_or_first_available_variant %} selected="selected" {% endif %} value="{{ variant.id }}">
                    {{ variant.title }}
                  </option>
                {% else %}
                  <option disabled="disabled">{{ variant.title }} - {{ 'products.product.sold_out' | t }}</option>
                {% endif %}
              {% endfor %}
            </select>

            {% if section.settings.show_quantity_selector %}
              <div class="product-form__item product-form__item--quantity">
                <label for="Quantity">{{ 'products.product.quantity' | t }}</label>
                <input type="number" id="Quantity" name="quantity" value="1" min="1" class="product-form__input" pattern="[0-9]*">
              </div>
            {% endif %}

            <div class="product-form__item product-form__item--submit">
              <button type="submit" name="add" id="AddToCart-{{ section.id }}" {% unless current_variant.available %}disabled="disabled"{% endunless %} class="btn product-form__cart-submit{% if product.options.size == 1 and product.variants[0].title == 'Default Title' %} product-form__cart-submit--small{% endif %}">
                <span id="AddToCartText-{{ section.id }}">
                  {% unless current_variant.available %}
                    {{ 'products.product.sold_out' | t }}
                  {% else %}
                    {{ 'products.product.add_to_cart' | t }}
                  {% endunless %}
                </span>
              </button>
            </div>
          </form>

        </div>

        <div class="product-single__description rte" itemprop="description">
          {{ product.description }}
        </div>

        {% if section.settings.show_share_buttons %}
          {% include 'social-sharing', share_title: product.title, share_permalink: product.url, share_image: product %}
        {% endif %}
      </div>
    </div>
  </div>
</div>

{% if collection %}
  <div class="text-center return-link-wrapper">
    <a href="{{ collection.url }}" class="btn btn--secondary btn--has-icon-before return-link">
      {% include 'icon-arrow-left' %}
      {{ 'products.product.back_to_collection' | t: title: collection.title }}
    </a>
  </div>
{% endif %}

{% unless product == empty %}
  <script type="application/json" id="ProductJson-{{ section.id }}">
    {{ product | json }}
  </script>
{% endunless %}

{% schema %}
  {
    "name": "Product pages",
    "settings": [
      {
        "type": "select",
        "id": "image_size",
        "label": "Image size",
        "options": [
          {
            "value": "small",
            "label": "Small"
          },
          {
            "value": "medium",
            "label": "Medium"
          },
          {
            "value": "large",
            "label": "Large"
          },
          {
            "value": "full",
            "label": "Full-width"
          }
        ],
        "default": "medium"
      },
      {
        "type": "checkbox",
        "id": "show_quantity_selector",
        "label": "Show quantity selector",
        "default": false
      },
      {
        "type": "checkbox",
        "id": "show_variant_labels",
        "label": "Show variant labels",
        "default": true
      },
      {
        "type": "checkbox",
        "id": "show_vendor",
        "label": "Show vendor",
        "default": false
      },
      {
        "type": "checkbox",
        "id": "enable_zoom",
        "label": "Enable image zoom",
        "default": true
      },
      {
        "type": "checkbox",
        "id": "show_share_buttons",
        "label": "Show social sharing buttons",
        "default": true
      }
    ]
  }
{% endschema %}

Karen commented on Display Quantities Available

$
0
0

thx for the reply, have replied to your email

Elise Campbell commented on How to make tables have a white/clear background?

$
0
0

Just tried this and it worked - thanks so much!

 


Space after BLOG TITLE way too big. Brooklyn theme by Kathleen

$
0
0

I think this pic explains it all. 

Anyone know how to close up the gap between the blog headline and the beginning of the copy?

how to disable captcha for customer form? by Yichao Tian

$
0
0

I am testing my website's newsletter sign up form. Sometimes when users hit "sign up" button they will be lead to a captcha page where the need to click the checkbox to continue. The form is using liquid's "customer" form, so I think this captcha procedure is part of shopify's setting, how do I disable it?

Darleen Witmer commented on Customer Account Activation

$
0
0

HI 

I did try this app but it will not submit, just spins.

Good idea that would be nice if built out a bit more.

Darleen

Leon commented on how to disable captcha for customer form?

$
0
0

Hello, Yichao. 

Leon here from Shopify Support. 

Whenever a customer account creation attempt is made more than once in a 24 hour period from a single IP address, a page with a captcha is loaded to help protect your customer list from being inundated with spam customer account creation. During normal website operation, most of your customers won't encounter this page unless they've made an error signing up, or try to add a large volume of accounts. For this reason, I'm afraid this isn't a feature that you can turn off on your storefront. 

More info about using customer accounts for your store, including how to import a large number of customer accounts from existing lists is can be found here

Please let me know if you have further questions. 

Best Wishes, 

Leon 

ShopifyDAA commented on Debut theme - Changing Background image and FEATURED COLLECTION font.

Matthias commented on JQuery Flickity Issue

Supply Theme - changing slideshow speed by Michael Todd

$
0
0

Ive had no luck in changing the speed. im sure im in the right spot in slideshow.liquid and editing this command...

{
            "value": "5000",
            "label": "5 seconds"
          },
          {
            "value": "7000",
            "label": "7 seconds"
          },
          {
            "value": "10000",
            "label": "10 seconds"
          },
          {
            "value": "15000",
            "label": "15 seconds"

 

 

Ive changed the spedds but nothign has happened and still 5 seconds.

 

What should be done for the speed to actually work for me?

 

Thanks


Michael Todd commented on Supply Theme - Cleaning Up Those Home Page Margin Gaps

$
0
0

way easier way and using only one section...

 

.header-logo {
  margin: $gutter auto;

  @include at-query ($min, $large) {
    margin: -50px 0;
  }

Just change the margin value in the "@include at-query ($min, $large) section right under the .header- logo in Assets, scss...

 

I tried everytyhing you originally said... didnt work for supply theme but tried this and it works wonders and evenly spaces everythign in the header.

Hide featured images in blog list? by Liz

$
0
0

Hi, 

I'm using Editions theme. I only want my featured blog images to show up on my home page, not on my blog list or in the articles. I've already figured out how to hide them in articles. But I can't figure out how to hide them from the blog list, without also making them disappear from the home page. Any ideas? 

Thanks

HELP: Table on the top of product description. by Jun

change height and width of search bar - supply theme by Michael Todd

Jason commented on JQuery Flickity Issue

$
0
0

Are you sure that you need to add in another version of jQuery to the theme? A lot of themes will already be including it so adding another can create all sorts of conflicts if not done correctly (not to mention the added bandwidth load for the customer).

What errors are you seeing in the browser debug console? That might give you some clues as to what's happening as well.

Viewing all 57838 articles
Browse latest View live


Latest Images

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