Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Getting issue in during Add to cart .
sharing my product and product template file too here .
Product Liquid
<section class="single-product pt-100">
<div class="container{% if settings.section_full_width %}-fluid section-padding-1{% endif %}">
<div class="row">
<div class="col-12">
{% section 'product-template' %}
{% section 'single-product-tab' %}
{% section 'related-product' %}
{% section 'custom-collection' %}
{% section 'recent_viewed_product'%}
</div>
{% section 'product-sidebar' %}
</div>
</div>
</section>
And
product-template.liquid
Here is
{%- assign on_sale = false -%}
{%- if product.compare_at_price > product.price -%}
{%- assign on_sale = true -%}
{%- endif -%}
{%- assign sold_out = true -%}
{%- if product.available -%}
{%- assign sold_out = false -%}
{%- endif -%}
{%- assign current_variant = product.selected_or_first_available_variant -%}
<div class="product-details-area pb-95 common_slick_slider">
<div class="row{% if section.settings.content_handle == 'content_in_left' and section.settings.product_style != 'slider' %} flex-row-reverse{% endif %}">
{%- if section.settings.product_style == 'tab_style_1' -%}
{%- include 'tab-style-1' -%}
{%- elsif section.settings.product_style == 'tab_style_2' -%}
{%- include 'tab-style-2' -%}
{%- elsif section.settings.product_style == 'tab_style_3' -%}
{%- include 'tab-style-3' -%}
{%- elsif section.settings.product_style == 'gallery' -%}
{%- include 'gallery-style' -%}
{%- elsif section.settings.product_style == 'sticky' -%}
{%- include 'sticky-style' -%}
{%- elsif section.settings.product_style == 'slider' -%}
{%- include 'slider-style' -%}
{%- endif -%}
</div>
</div>
{%- include 'size-guide-popup' -%}
{%- include 'shipping-policy-popup' -%}
{%- include 'contact-popup' -%}
{%- if section.settings.sticky_product_enable -%}
{% include 'sticky-add-to-cart' with product as product %}
{%- endif -%}
{% style %}
.dynamic_btn {
max-width: 340px;
margin-bottom: 20px;
}
.dynamic_btn button {
padding: 23px 38px;
border-radius: 0;
background-color: {{ section.settings.dynamic_btn_bg }};
font-size: {{ section.settings.dynamic_btn_size }}px;
}
.dynamic_btn button:hover {
background-color: {{ settings.color_primary }} !important;
}
{% if section.settings.show_variant_image %}
.swatch-element.color > label {
height: 30px;
width: 30px;
}
{% endif %}
{% endstyle %}
{% schema %}
{
"name": "Product",
"settings": [
{
"type": "header",
"content": "Product Style"
},
{
"type": "radio",
"id": "content_handle",
"label": "Content Position",
"options": [
{
"label": "Left",
"value": "content_in_left"
},
{
"label": "Right",
"value": "content_in_right"
}
],
"default": "content_in_right"
},
{
"type": "select",
"id": "product_style",
"label": "Product Style",
"options":[
{
"label": "Tab 1",
"value": "tab_style_1"
},
{
"label": "Tab 2",
"value": "tab_style_2"
},
{
"label": "Tab 3",
"value": "tab_style_3"
},
{
"label": "Gallery",
"value": "gallery"
},
{
"label": "Sticky",
"value": "sticky"
},
{
"label": "Slider",
"value": "slider"
}
],
"default": "tab_style_1"
},
{
"type": "header",
"content": "Product Zoom"
},
{
"type": "checkbox",
"id": "product_zoom_enable",
"label": "Product Zoom Enable",
"default": true
},
{
"type": "select",
"id": "zoom_type",
"label": "Zoom Type",
"options":[
{
"label": "Lens",
"value": "lens"
},
{
"label": "Window",
"value": "window"
},
{
"label": "Inner",
"value": "inner"
}
],
"default": "inner"
},
{
"type": "header",
"content": "Video Button"
},
{
"type": "checkbox",
"id": "show_video",
"label": "Enable Video Button",
"default": true
},
{
"type": "checkbox",
"id": "show_video_icon",
"label": "Show Video Icon",
"default": true
},
{
"type": "text",
"id": "video_btn",
"label": "Button Text",
"default": "View Video"
},
{
"type": "paragraph",
"content": "=> Use Shortcode in your product description to show Video tab- [product_video]Video ID[/product_video]"
},
{
"type": "paragraph",
"content": "[How to Get Video ID](https:\/\/image.prntscr.com/image/P7-HVQuzSlyPO2vOpHX5LQ.png)"
},
{
"type": "header",
"content": "Image Popup"
},
{
"type": "checkbox",
"id": "product_popup_enable",
"label": "Product Popup Enable",
"default": true,
"info": "When 'Product Zoom' enabled and product style 'Default' then it applicable"
},
{
"type": "header",
"content": "Product SKU"
},
{
"type": "checkbox",
"id": "product_sku_enable",
"label": "Show Product SKU",
"default": true
},
{
"type": "text",
"id": "product_sku_title",
"label": "SKU Title",
"default": "SKU:"
},
{
"type": "header",
"content": "Product Vendor",
"info": "--------"
},
{
"type": "checkbox",
"id": "product_vendor_enable",
"label": "Show Product Vendor",
"default": true
},
{
"type": "text",
"id": "vendor_title",
"label": "Vendor Title",
"default": "Vendor:"
},
{
"type": "range",
"id": "vendors_list_limit_hanlde",
"min": 1,
"max": 20,
"step": 1,
"label": "Verdor Limit",
"default": 5
},
{
"type": "header",
"content": "Product Type",
"info": "--------"
},
{
"type": "checkbox",
"id": "product_type_enable",
"label": "Show Product Type",
"default": true
},
{
"type": "text",
"id": "type_title",
"label": "Type Title",
"default": "Type:"
},
{
"type": "range",
"id": "types_list_limit_hanlde",
"min": 1,
"max": 20,
"step": 1,
"label": "Type Limit",
"default": 5
},
{
"type": "header",
"content": "Product Inventory"
},
{
"type": "checkbox",
"id": "product_inventory_enable",
"label": "Show Product Inventory",
"default": true
},
{
"type": "text",
"id": "availability_title",
"label": "Inventory Title",
"default": "Availability:"
},
{
"type": "text",
"id": "in_stock_title",
"label": "In Stock Title",
"default": "In stock"
},
{
"type": "text",
"id": "left_in_stock_title",
"label": "Left In Stock Title",
"default": "left in stock"
},
{
"type": "text",
"id": "out_of_stock_title",
"label": "Out of Stock Title",
"default": "Out of stock"
},
{
"type": "header",
"content": "Product Review"
},
{
"type": "paragraph",
"content": "To enable product review, go to 'Theme settings > Product Settings'"
},
{
"type": "header",
"content": "Product Description"
},
{
"type": "radio",
"id": "product_description_handle",
"label": "Description Handle",
"options":[
{
"label": "Full Description",
"value": "full_description"
},
{
"label": "Short Description",
"value": "short_description"
},
{
"label": "Without Description",
"value": "without_description"
}
],
"default": "short_description"
},
{
"type": "number",
"id": "truncatewords_count_handle",
"label": "Description Word Count",
"default": 35,
"info": "If 'Short Description' is selected and the shortcode is not used, then it will be applicable"
},
{
"type": "header",
"content": "Product Variant"
},
{
"type": "radio",
"id": "product_variant_handle",
"label": "Variant Option",
"options":[
{
"label": "Select Option",
"value": "product_variant_select_option"
},
{
"label": "Swatch Option",
"value": "product_variant_swatch_option"
},
{
"label": "Without Variant",
"value": "product_variant_without_option"
}
],
"default": "product_variant_swatch_option"
},
{
"type": "checkbox",
"id": "show_variant_image",
"label": "Variant image enable",
"default": false,
"info": "The variant image will replace in color field if each variant each image selected. It's applicable for 'Swatch Option'"
},
{
"type": "header",
"content": "Notification"
},
{
"type": "checkbox",
"id": "soldout_product_notification_enable",
"label": "Show Notification",
"default": true,
"info": "When the product is out of stock then it will be active."
},
{
"type": "html",
"id": "notification_text",
"label": "Notification Text",
"default": "Click <a id='notify-me' href='#'><strong>here</strong></a> to be notified by email when this product becomes available."
},
{
"type": "text",
"id": "notification_success_message",
"label": "Success Message",
"default": "Thanks! We will notify you when this product becomes available!"
},
{
"type": "text",
"id": "error_text",
"label": "Error Message",
"default": "Please provide a valid email address."
},
{
"type": "text",
"id": "send_button_title",
"label": "Send Button Title",
"default": "Send"
},
{
"type": "header",
"content": "Sticky Add To Cart",
"info": "--------"
},
{
"type": "checkbox",
"id": "sticky_product_enable",
"label": "Sticky Add To Cart Enable",
"default": true
},
{
"type": "header",
"content": "Product Additional Infromation",
"info": "--------"
},
{
"type": "paragraph",
"content": "Size Guide"
},
{
"type": "checkbox",
"id": "size_guide_enable",
"label": "Enable Size Guide",
"default": true
},
{
"type": "text",
"id": "size_guide",
"label": "Size Guide Label",
"default": "Size Guide"
},
{
"type": "page",
"id": "sizeguidhandle",
"label": "Select Page for Size Guide",
"info": "[Create a page](\/admin\/pages\/new)"
},
{
"type": "paragraph",
"content": "Shipping Guide"
},
{
"type": "checkbox",
"id": "shipping_guide_enable",
"label": "Enable Shipping Guide",
"default": true
},
{
"type": "text",
"id": "shipping_guide",
"label": "Shipping Guide Label",
"default": "Shipping"
},
{
"type": "page",
"id": "shipping_page_handle",
"label": "Select Page for Shipping",
"info": "[Create a page](\/admin\/pages\/new)"
},
{
"type": "paragraph",
"content": "Ask About Product"
},
{
"type": "checkbox",
"id": "ask_product_enable",
"label": "Enable Ask About Product",
"default": true
},
{
"type": "text",
"id": "ask_about_product",
"label": "Ask About Product Label",
"default": "Ask About This product "
},
{
"type": "text",
"id": "ask_about_prod_title",
"label": "Ask About Product Popup Title",
"default": "Have a question?"
},
{
"type": "text",
"id": "send_btn_text",
"label": "Popup Send Button",
"default": "Send"
},
{
"type": "paragraph",
"content": "Name Field"
},
{
"type": "text",
"id": "name_placeholder",
"label": "Name Placeholder",
"default": "Name *"
},
{
"type": "paragraph",
"content": "Email Field"
},
{
"type": "text",
"id": "email_placeholder",
"label": "Email Placeholder",
"default": "Email *"
},
{
"type": "paragraph",
"content": "Phone Field"
},
{
"type": "text",
"id": "phone_placeholder",
"label": "Phone Placeholder",
"default": "Phone *"
},
{
"type": "paragraph",
"content": "URL Field"
},
{
"type": "text",
"id": "prod_url_placeholder",
"label": "Product URL Placeholder",
"default": "Reference URL *"
},
{
"type": "paragraph",
"content": "Message Body"
},
{
"type": "text",
"id": "body_placholder",
"label": "Message Body",
"default": "Write Message *"
},
{
"type": "header",
"content": "Dynamic Checkout Buttons"
},
{
"type": "checkbox",
"id": "dynamic_checkout_button_enable",
"label": "Enable Dynamic Checkout Buttons",
"default": true
},
{
"type": "color",
"id": "dynamic_btn_bg",
"label": "Button BG Color",
"default": "#1f2226"
},
{
"type": "range",
"id": "dynamic_btn_size",
"min": 12,
"max": 40,
"step": 1,
"label": "Button Font Size",
"unit": "px",
"default": 16
},
{
"type": "header",
"content": "Social Share Option"
},
{
"type": "checkbox",
"id": "social_share_enable",
"label": "Show Social Share",
"default": true
},
{
"type": "text",
"id": "social_share_title",
"label": "Social Share Title",
"default": "Share:"
},
{
"type": "header",
"content": "Category"
},
{
"type": "checkbox",
"id": "show_cat",
"label": "Show Category",
"default": true
},
{
"type": "text",
"id": "cat_title",
"label": "Category Title",
"default": "Categories: "
},
{
"type": "header",
"content": "Tag"
},
{
"type": "checkbox",
"id": "show_tag",
"label": "Show Tag",
"default": true
},
{
"type": "text",
"id": "tag_title",
"label": "Tag Title",
"default": "Tag: "
},
{
"type": "header",
"content": "Payment Option"
},
{
"type": "checkbox",
"id": "payment_option_enable",
"label": "Show Payment Option",
"default": true
},
{
"type": "text",
"id": "payment_information",
"label": "Information",
"default": "Guaranteed safe checkout"
},
{
"type": "image_picker",
"id": "payment_image",
"label": "Payment Image"
},
{
"type": "radio",
"id": "payment_icon",
"label": "Payment Icon",
"options":[
{
"label": "Automatic",
"value": "automatic"
},
{
"label": "Custom Icon",
"value": "custom_icon"
}
],
"default": "custom_icon"
}
],
"blocks":[
{
"type": "amazon_payments",
"name": "Amazon Payments",
"limit": 1
},
{
"type": "american_express",
"name": "American Express",
"limit": 1
},
{
"type": "apple_pay",
"name": "Apple Pay",
"limit": 1
},
{
"type": "bitcoin",
"name": "Bitcoin",
"limit": 1
},
{
"type": "dankort",
"name": "Dankort",
"limit": 1
},
{
"type": "diners_club",
"name": "Diners Club",
"limit": 1
},
{
"type": "discover",
"name": "Discover",
"limit": 1
},
{
"type": "dogecoin",
"name": "Dogecoin",
"limit": 1
},
{
"type": "dwolla",
"name": "Dwolla",
"limit": 1
},
{
"type": "forbrugsforeningen",
"name": "Forbrugsforeningen",
"limit": 1
},
{
"type": "google_pay",
"name": "Google Pay",
"limit": 1
},
{
"type": "jcb",
"name": "Jcb",
"limit": 1
},
{
"type": "klarna",
"name": "Klarna",
"limit": 1
},
{
"type": "litecoin",
"name": "Litecoin",
"limit": 1
},
{
"type": "maestro",
"name": "Maestro",
"limit": 1
},
{
"type": "master",
"name": "Master",
"limit": 1
},
{
"type": "paypal",
"name": "Paypal",
"limit": 1
},
{
"type": "shopify_pay",
"name": "Shopify Pay",
"limit": 1
},
{
"type": "sofort",
"name": "Sofort",
"limit": 1
},
{
"type": "visa",
"name": "Visa",
"limit": 1
}
]
}
{% endschema %}
{%- if section.settings.product_zoom_enable -%}
<script src="{{ 'jquery.elevateZoom-3.0.8.min.js' | asset_url }}"></script>
{%- endif -%}
{%- if section.settings.product_popup_enable -%}
{{ 'jquery.fancybox.css' | asset_url | stylesheet_tag }}
<script src="{{ 'jquery.fancybox.min.js' | asset_url }}"></script>
<script>
$(document).ready(function() {
$('.fancybox').fancybox();
});
</script>
{%- endif -%}
{%- if section.settings.product_style == 'product_sticky' -%}
<script src="{{ 'ResizeSensor-StickySidebar.js' | asset_url }}"></script>
<script>
var sidebar = new StickySidebar('#product-content', {
containerSelector: '#product-details-with-gallery',
innerWrapperSelector: '.product-content-inner',
topSpacing: 20,
bottomSpacing: 20,
minWidth: 992,
});
</script>
{% endif %}
<script>
var selectCallback = function(variant, selector) {
timber.productPage({
money_format: '{{ shop.money_format }}',
variant: variant,
selector: selector
});
if (variant) {
// Current variant select+
var form = jQuery('#' + selector.domIdPrefix).closest('form');
for (var i=0,length=variant.options.length; i<length; i++) {
var val = variant.options[i].replace(/'/g,"'");
var radioButton = form.find(".swatch[data-option-index='" + i + "'] :radio[value='" + val +"']");
if (radioButton.size()) {
radioButton.get(0).checked = true;
}
}
{%- if section.settings.product_inventory_enable -%}
/* -- code added for Inventory -- */
var selectors = {
variantInventory: '.variant-inventory'
};
var inventory_level = (inv_qty[ variant.id ]);
if (inventory_level == 0){
$(selectors.variantInventory, this.$container).html('{{ section.settings.out_of_stock_title }}').show();
}
else if (inventory_level > 100) {
$(selectors.variantInventory, this.$container).html("{{ section.settings.in_stock_title }}").show();
}
else {
$(selectors.variantInventory, this.$container).html(inventory_level + ' {{ section.settings.left_in_stock_title }}').show();
}
/* - Inventory end - */
{%- endif -%}
// Current sku pass
$('.variant-sku').text(variant.sku);
}else {
$('.variant-sku').empty();
}
{%- if section.settings.product_zoom_enable -%}
// product image zoom with variant
if (variant && variant.featured_image) {
jQuery('#ProductThumbs a[data-image-id="' + variant.featured_image.id + '"]').trigger('click');
}
{%- endif -%}
};
jQuery(function($) {
new Shopify.OptionSelectors('productSelect', {
product: {{ product | json }},
onVariantSelected: selectCallback,
enableHistoryState: true
});
// Add label if only one product option and it isn't 'Title'. Could be 'Size'.
{% if product.options.size == 1 and product.options.first != 'Title' %}
$('.selector-wrapper:eq(0)').prepend('<label for="productSelect-option-0">{{ product.options.first | escape }}</label>');
{% endif %}
// Hide selectors if we only have 1 variant and its title contains 'Default'.
{% if product.variants.size == 1 and product.variants.first.title contains 'Default' %}
$('.selector-wrapper').hide();
{% endif %}
});
{%- if section.settings.product_zoom_enable -%}
function productZoom(){
$(".product-zoom").elevateZoom({
gallery: 'ProductThumbs',
galleryActiveClass: "active",
zoomType: "{{ section.settings.zoom_type }}",
cursor: "crosshair"
});
{%- if section.settings.product_popup_enable -%}
$(".product-zoom").on("click", function(e) {
var ez = $('.product-zoom').data('elevateZoom');
$.fancybox(ez.getGalleryList());
return false;
});
{% endif %}
};
function productZoomDisable(){
if( $(window).width() < 767 ) {
$('.zoomContainer').remove();
$(".product-zoom").removeData('elevateZoom');
$(".product-zoom").removeData('zoomImage');
} else {
productZoom();
}
};
productZoomDisable();
$(window).resize(function() {
productZoomDisable();
});
{%- endif -%}
</script>
URL to check here
https://tableworld.com/products/coffee-table-altera
Screenshot here : https://paste.pics/K4NM1
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025