ÈËÉú¾ÍÊDz©¡¤(Öйú)×ðÁúAGÆì½¢Ìü

ÈËÉú¾ÍÊDz©¡¤(Öйú)×ðÁúAGÆì½¢Ìü(LianLian Global)¹ÙÍøÊ×Ò³

shopifyÌí¼Óµ½¹ºÎï³µ°´Å¥Òþ²ØºÍÏÔʾ°ì·¨

2022/03/08
×Ô½¨Õ¾

½ûÓùºÎï³µ


±¸×¢

ÈôÊÇÄúʹÓàShopify µÄÃâ·ÑÄ£°å£¬£¬£¬£¬£¬£¬Äú¿ÉÒÔÁªÏµ Shopify Ö§³ÖÍŶӻñµÃ¹ØÓڴ˽̵̳Ä×ÊÖú¡£ ¡£¡£ ¡£¡£¡£´Ë½Ì³ÌÐèÒª 15 ·ÖÖÓµÄÉè¼ÆÊ±¼ä¡£ ¡£¡£ ¡£¡£¡£ÈôÒªÏàʶÏêÇ飬£¬£¬£¬£¬£¬Çë²ÎÔÄ Support for themes¡£ ¡£¡£ ¡£¡£¡£

±¸×¢

´Ë×Ô½ç˵ÓÃÓÚ¸´¹Å Shopify Ä£°å£¬£¬£¬£¬£¬£¬²»ÊÊÓÃÓÚ¡°Online Store 2.0¡±Ä£°å¡£ ¡£¡£ ¡£¡£¡£

  • ÕÒµ½ÄúµÄÄ£°å¼Ü¹¹°æ±¾

  • ̽Ë÷¡°Online Store 2.0¡±Ä£°å×Ô½ç˵


Äú¿ÉÒÔÔÚµêÃæÖÐÒþ²ØÌí¼Óµ½¹ºÎï³µ°´Å¥£¬£¬£¬£¬£¬£¬²¢ÔÚδÀ´ÔÙ´ÎÏÔʾÕâЩ°´Å¥¡£ ¡£¡£ ¡£¡£¡£

±¸×¢£º´Ë×Ô½ç˵ÉèÖÃÓ붯̬½áÕ˰´Å¥²»¼æÈÝ¡£ ¡£¡£ ¡£¡£¡£ÈôÊÇÄúµÄÄ£°åÖ§³Ö¶¯Ì¬½áÕË£¬£¬£¬£¬£¬£¬ÇëÆ¾Ö¤ÔÚ²úÆ·Ò³ÃæÉÏÒþ²Ø¶¯Ì¬½áÕ˰´Å¥µÄ°ì·¨À´×èÖ¹ÏÔʾ°´Å¥¡£ ¡£¡£ ¡£¡£¡£

·ÖÇøÄ£°åºÍδ·ÖÇøÄ£°å

±¸×¢£º±¾½Ì³ÌµÄ°ì·¨½«Æ¾Ö¤ÄúʹÓõÄÊÇ·ÖÇøÄ£°åÕÕ¾Éδ·ÖÇøÄ£°å¶øÓÐËù²î±ð¡£ ¡£¡£ ¡£¡£¡£·ÖÇøÄ£°åÖ§³Öͨ¹ýÍÏ·ÅÀ´°²ÅÅÖ÷Ò³µÄ½á¹¹£¬£¬£¬£¬£¬£¬Î´·ÖÇøÄ£°åÔò²»Ö§³Ö¡£ ¡£¡£ ¡£¡£¡£

ÈôÊÇÏëÏàʶÄúµÄÄ£°åÊÇ·ñÖ§³Ö·ÖÇø£¬£¬£¬£¬£¬£¬Çëתµ½Ä£°åµÄ±à¼­´úÂëÒ³Ãæ¡£ ¡£¡£ ¡£¡£¡£ÈôÊÇ Sections Ä¿Â¼ÖÐÓÐÎļþ£¬£¬£¬£¬£¬£¬ÄúÔòÕýÔÚʹÓÃÒÑ·ÖÇøÄ£°å¡£ ¡£¡£ ¡£¡£¡£Î´·ÖÇøÄ£°åÊÇÔÚ 2016 Äê 10 ÔÂ֮ǰÐû²¼µÄ£¬£¬£¬£¬£¬£¬²¢ÇÒ Sections Ä¿Â¼ÖÐûÓÐÎļþ¡£ ¡£¡£ ¡£¡£¡£

ÈôÊÇÄúʹÓÃÒÑ·ÖÇøÄ£°å£¬£¬£¬£¬£¬£¬Çëµã»÷ Sectioned themes£¨ÒÑ·ÖÇøÄ£°å£©°´Å¥²¢Æ¾Ìý˵Ã÷¾ÙÐвÙ×÷¡£ ¡£¡£ ¡£¡£¡£ÈôÊÇÄúʹÓýϾɵÄδ·ÖÇøÄ£°å£¬£¬£¬£¬£¬£¬Çëµã»÷ Non-sectioned themes£¨Î´·ÖÇøÄ£°å£©°´Å¥²¢Æ¾Ìý˵Ã÷¾ÙÐвÙ×÷¡£ ¡£¡£ ¡£¡£¡£

PC:

  1. ÔÚ Shopify ºǫ́ÖУ¬£¬£¬£¬£¬£¬×ªµ½ÔÚÏßÊÐËÁ > Ä£°å¡£ ¡£¡£ ¡£¡£¡£

  2. ÕÒµ½Òª±à¼­µÄÄ£°å£¬£¬£¬£¬£¬£¬È»ºóµã»÷²Ù×÷ > ±à¼­´úÂë¡£ ¡£¡£ ¡£¡£¡£

  1. ÔÚ Sections Ä¿Â¼ÖУ¬£¬£¬£¬£¬£¬µã»÷·­¿ª product-template.liquid Îļþ¡£ ¡£¡£ ¡£¡£¡£²éÕÒÌí¼Óµ½¹ºÎï³µ°´Å¥¶ÔÓ¦µÄ HTML ´úÂë¡£ ¡£¡£ ¡£¡£¡£Äú¿ÉÒÔÊ×ÏÈËÑË÷ cart Ò»´Ê¡£ ¡£¡£ ¡£¡£¡£

¡°Ìí¼Óµ½¹ºÎï³µ¡±°´Å¥µÄ´úÂëÒòÄ£°å¶øÒì¡£ ¡£¡£ ¡£¡£¡£Çë²éÕÒ°üÀ¨ Add to cart¡¢AddToCart »ò add-to-cart µÈÀàËÆÎı¾µÄ <input> »ò <button> ±ê¼Ç¡£ ¡£¡£ ¡£¡£¡£

Æ»¹ûϵͳ£º

  1. ÔÚ Shopify ºǫ́ÖУ¬£¬£¬£¬£¬£¬×ªµ½ÔÚÏßÊÐËÁ > Ä£°å¡£ ¡£¡£ ¡£¡£¡£

  2. ÕÒµ½Òª±à¼­µÄÄ£°å£¬£¬£¬£¬£¬£¬È»ºóµã»÷²Ù×÷ > ±à¼­´úÂë¡£ ¡£¡£ ¡£¡£¡£

  1. ÔÚ Sections Ä¿Â¼ÖУ¬£¬£¬£¬£¬£¬µã»÷·­¿ª product-template.liquid Îļþ¡£ ¡£¡£ ¡£¡£¡£²éÕÒÌí¼Óµ½¹ºÎï³µ°´Å¥¶ÔÓ¦µÄ HTML ´úÂë¡£ ¡£¡£ ¡£¡£¡£Äú¿ÉÒÔÊ×ÏÈËÑË÷ cart Ò»´Ê¡£ ¡£¡£ ¡£¡£¡£

¡°Ìí¼Óµ½¹ºÎï³µ¡±°´Å¥µÄ´úÂëÒòÄ£°å¶øÒì¡£ ¡£¡£ ¡£¡£¡£Çë²éÕÒ°üÀ¨ Add to cart¡¢AddToCart »ò add-to-cart µÈÀàËÆÎı¾µÄ <input> »ò <button> ±ê¼Ç¡£ ¡£¡£ ¡£¡£¡£

°²×¿ÏµÍ³£º

  1. ÔÚ Shopify ºǫ́ÖУ¬£¬£¬£¬£¬£¬×ªµ½ÔÚÏßÊÐËÁ > Ä£°å¡£ ¡£¡£ ¡£¡£¡£

  2. ÕÒµ½Òª±à¼­µÄÄ£°å£¬£¬£¬£¬£¬£¬È»ºóµã»÷²Ù×÷ > ±à¼­´úÂë¡£ ¡£¡£ ¡£¡£¡£

  1. ÔÚ Sections Ä¿Â¼ÖУ¬£¬£¬£¬£¬£¬µã»÷·­¿ª product-template.liquid Îļþ¡£ ¡£¡£ ¡£¡£¡£²éÕÒÌí¼Óµ½¹ºÎï³µ°´Å¥¶ÔÓ¦µÄ HTML ´úÂë¡£ ¡£¡£ ¡£¡£¡£Äú¿ÉÒÔÊ×ÏÈËÑË÷ cart Ò»´Ê¡£ ¡£¡£ ¡£¡£¡£

¡°Ìí¼Óµ½¹ºÎï³µ¡±°´Å¥µÄ´úÂëÒòÄ£°å¶øÒì¡£ ¡£¡£ ¡£¡£¡£Çë²éÕÒ°üÀ¨ Add to cart¡¢AddToCart »ò add-to-cart µÈÀàËÆÎı¾µÄ <input> »ò <button> ±ê¼Ç¡£ ¡£¡£ ¡£¡£¡£

ÔÚ Debut Ä£°åÖУ¬£¬£¬£¬£¬£¬¡°Ìí¼Óµ½¹ºÎï³µ¡±°´Å¥µÄ´úÂëÈçÏÂËùʾ£º

<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>
  1. ÕÒµ½´úÂëºó£¬£¬£¬£¬£¬£¬½«Ëü·ÅÈë Liquid {% comment %} ºÍ {% endcomment %} ±ê¼ÇÖ®¼ä¡£ ¡£¡£ ¡£¡£¡£Õ⽫»á×èÖ¹¸Ã´úÂëÔÚÄúµÄÊÐËÁÖÐÏÔʾ£¬£¬£¬£¬£¬£¬µ«ÈôÊÇÄúÏëÉÔºó¸ü¸ÄÄúµÄÐÂÄ£°å£¬£¬£¬£¬£¬£¬Äú¿ÉÒÔÇáËɽ«Æä»Ö¸´¡£ ¡£¡£ ¡£¡£¡£

Using the example above, the new code would look like this: ``` liquid {% comment %} <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> {% endcomment %}


×¢ÖØ

Make sure that you don't comment out the <form> tags for your product page. Your comment tags should not surround any <form> or </form> tags, otherwise customers could experience errors when viewing your product page. ```



  1. µã»÷ÉúÑÄÒÔÈ·Èϸü¸Ä¡£ ¡£¡£ ¡£¡£¡£

µ±Äú×¼±¸ºÃÔÙ´ÎÏÔʾÌí¼Óµ½¹ºÎï³µ°´Å¥Ê±£¬£¬£¬£¬£¬£¬Çë·µ»Øµ½±à¼­ HTML/CSS Ò³ÃæÉϵĠproduct-template.liquid Îļþ£¬£¬£¬£¬£¬£¬É¾³ý {% comment %} ºÍ {% endcomment %} ±ê¼Ç£¬£¬£¬£¬£¬£¬È»ºóµã»÷ÉúÑÄ¡£ ¡£¡£ ¡£¡£¡£

ShopifyÉÌ»§¹ÙÍøÔ­ÎÄÏêÇ飺

Disable your cart

Note

If you use a free theme from Shopify, then you might be able to contact Shopify Support for help with this tutorial. It requires 15 minutes of design time. To learn more, refer to Support for themes.

Note

This customization is for vintage Shopify themes, and doesn't apply to Online Store 2.0 themes.

  • Find out your theme's architecture version

  • Explore Online Store 2.0 theme customizations

You can hide your Add to cart buttons on your storefront and reveal them again in the future.

Note

This customization isn't compatible with dynamic checkout buttons. If your theme supports dynamic checkout, then prevent the buttons from showing by following the steps to hide dynamic checkout buttons on product pages.

Sectioned and non-sectioned themes

Note

The steps for this tutorial differ depending on whether you are using a sectioned or a non-sectioned theme. A sectioned theme lets you drag and drop to arrange the layout of your home page, and a non-sectioned theme doesn't.

To figure out whether your theme supports sections, go to the theme's Edit code page. If there are files in the Sections directory, you are using a sectioned theme. Non-sectioned themes were released before October 2016, and do not have files in the Sections directory.

If you are using a sectioned theme, click the Sectioned themes button and follow the instructions. If you are using an older, non-sectioned theme, click the Non-sectioned themes button and follow the instructions.


PC£º

  1. From your Shopify admin, go to Online Store > Themes.

  2. Find the theme you want to edit, and then click Actions > Edit code.

  1. In the Sections directory, click to open your product-template.liquid file. Find the HTML code for the Add to cart button. You can search for the word cart as a start.

The code for the add to cart button varies theme to theme. Look for an <input> or <button> tag with text like Add to cartAddToCart, or add-to-cart.

iPhone£º

  1. From the Shopify app, tap Store.

  2. In the Sales channels section, tap Online Store.

  3. Tap Manage themes.

  4. Find the theme you want to edit, and then click Actions > Edit code.

  1. In the Sections directory, click to open your product-template.liquid file. Find the HTML code for the Add to cart button. You can search for the word cart as a start.

The code for the add to cart button varies theme to theme. Look for an <input> or <button> tag with text like Add to cartAddToCart, or add-to-cart.

Android£º

  1. From the Shopify app, tap Store.

  2. In the Sales channels section, tap Online Store.

  3. Tap Manage themes.

  4. Find the theme you want to edit, and then click Actions > Edit code.

  1. In the Sections directory, click to open your product-template.liquid file. Find the HTML code for the Add to cart button. You can search for the word cart as a start.

The code for the add to cart button varies theme to theme. Look for an <input> or <button> tag with text like Add to cartAddToCart, or add-to-cart.

In the Debut theme, the add to cart button code looks like this:

   <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>
  1. When you find the code, wrap it in Liquid {% comment %} and {% endcomment %} tags. This will stop the code from being shown on your store, but will let you easily put it back if you want to change your new template later.

    Using the example above, the new code would look like this:

    {% comment %} <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> {% endcomment %}

    Caution

    Make sure that you don't comment out the <form> tags for your product page. Your comment tags should not surround any <form> or </form> tags, otherwise customers could experience errors when viewing your product page.

  1. Click Save to confirm your changes.

When you are ready to show your Add to cart buttons again, go back to your product-template.liquid file on the Edit HTML/CSS page, remove the {% comment %} and {% endcomment %} tags, and click Save.

ÎÄÕÂÄÚÈÝȪԴ£ºShopifyÉÌ»§¹Ù·½ÍøÕ¾


¸ü¶à
¡¾ÍøÕ¾µØÍ¼¡¿¡¾sitemap¡¿