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

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

shopify¹ºÎï³µÒ³ÃæÌí¼Ó¡°¼ÌÐø¹ºÎÁ´½Ó°ì·¨

shopify¹ºÎï³µ¹ºÎï³µÁ´½Ó
2022/03/07
×Ô½¨Õ¾

Ïò¹ºÎï³µÒ³ÃæÌí¼Ó¡°¼ÌÐø¹ºÎÁ´½Ó


±¸×¢

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

±¸×¢

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

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

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


Äú¿ÉÒÔ½«¼ÌÐø¹ºÎïÁ´½ÓÌí¼Óµ½¹ºÎï³µÒ³Ãæ£¬£¬£¬£¬ £¬ £¬Ê¹¿Í»§ÔÚ½«²úÆ·Ìí¼Óµ½¹ºÎï³µºó¿ÉÇáËÉ·µ»Øä¯ÀÀ²úÆ·¡£¡£¡£¡£¡£ ¡£Äú¿ÉÒÔÑ¡ÔñÌí¼ÓÒ»¸öÁ´½Ó£¬£¬£¬£¬ £¬ £¬ÓÃÓÚ½«¿Í»§¶¨Ïò»ØÄ¿Â¼Ò³Ãæ¡¢ÄúµÄÖ÷Ò³»òËûÃÇ֮ǰÉó²éµÄ×îºóÒ»¸ö²úƷϵÁÐÒ³Ãæ¡£¡£¡£¡£¡£ ¡£

Ïò¹ºÎï³µÒ³ÃæÌí¼Ó¡°¼ÌÐø¹ºÎÁ´½Ó

ÈôÒªÏòÄúµÄ¹ºÎï³µÒ³ÃæÌí¼Ó¼ÌÐø¹ºÎïÁ´½Ó£¬£¬£¬£¬ £¬ £¬ÇëÖ´ÐÐÒÔϲÙ×÷£º

PC£º

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

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

  1. ÔÚ Sections Ä¿Â¼ÖУ¬£¬£¬£¬ £¬ £¬µã»÷ cart-template.liquid¡£¡£¡£¡£¡£ ¡£ÈôÊÇÄúµÄÄ£°åÖÐûÓдËÎļþ£¬£¬£¬£¬ £¬ £¬Ôòµã»÷ Templates Ä¿Â¼ÖеĠcart.liquid¡£¡£¡£¡£¡£ ¡£

  2. ͨ¹ýËÑË÷ name="checkout" µÄÎļþÀ´²éÕÒ½áÕ˰´Å¥µÄ´úÂë¡£¡£¡£¡£¡£ ¡£½áÕ˰´Å¥µÄ´úÂëÐÐÒòÄ£°å¶øÒ죬£¬£¬£¬ £¬ £¬µ«»áÈçÏÂËùʾ£º

<button type="submit" id="checkout" name="checkout" class="btn">   {{ 'cart.general.checkout' | t }} </button>
  1. ÏÂÒ»²½ÊÇÕ³ÌùеĴúÂëÐÐÒÔ½¨Éè¼ÌÐø¹ºÎïÁ´½Ó¡£¡£¡£¡£¡£ ¡£ÄúÕ³ÌùµÄ´úÂ뽫ȡ¾öÓÚÄúÏ£ÍûÁ´½Óתµ½µÄÒ³Ãæ£º

Æ»¹ûϵͳ£º

  1. ÔÚ Shopify Ó¦ÓÃÖУ¬£¬£¬£¬ £¬ £¬Çá´¥ÊÐËÁ¡£¡£¡£¡£¡£ ¡£

  2. ÔÚÏúÊÛÇþµÀ²¿·ÖÖУ¬£¬£¬£¬ £¬ £¬Çá´¥ÔÚÏßÊÐËÁ¡£¡£¡£¡£¡£ ¡£

  3. Çá´¥ Manage themes£¨ÖÎÀíÄ£°å£©¡£¡£¡£¡£¡£ ¡£

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

  1. ÔÚ Sections Ä¿Â¼ÖУ¬£¬£¬£¬ £¬ £¬µã»÷ cart-template.liquid¡£¡£¡£¡£¡£ ¡£ÈôÊÇÄúµÄÄ£°åÖÐûÓдËÎļþ£¬£¬£¬£¬ £¬ £¬Ôòµã»÷ Templates Ä¿Â¼ÖеĠcart.liquid¡£¡£¡£¡£¡£ ¡£

  2. ͨ¹ýËÑË÷ name="checkout" µÄÎļþÀ´²éÕÒ½áÕ˰´Å¥µÄ´úÂë¡£¡£¡£¡£¡£ ¡£½áÕ˰´Å¥µÄ´úÂëÐÐÒòÄ£°å¶øÒ죬£¬£¬£¬ £¬ £¬µ«»áÈçÏÂËùʾ£º

<button type="submit" id="checkout" name="checkout" class="btn">   {{ 'cart.general.checkout' | t }} </button>
  1. ÏÂÒ»²½ÊÇÕ³ÌùеĴúÂëÐÐÒÔ½¨Éè¼ÌÐø¹ºÎïÁ´½Ó¡£¡£¡£¡£¡£ ¡£ÄúÕ³ÌùµÄ´úÂ뽫ȡ¾öÓÚÄúÏ£ÍûÁ´½Óתµ½µÄÒ³Ãæ£º

°²×¿ÏµÍ³£º

  1. ÔÚ Shopify Ó¦ÓÃÖУ¬£¬£¬£¬ £¬ £¬Çá´¥ÊÐËÁ¡£¡£¡£¡£¡£ ¡£

  2. ÔÚÏúÊÛÇþµÀ²¿·ÖÖУ¬£¬£¬£¬ £¬ £¬Çá´¥ÔÚÏßÊÐËÁ¡£¡£¡£¡£¡£ ¡£

  3. Çá´¥ Manage themes£¨ÖÎÀíÄ£°å£©¡£¡£¡£¡£¡£ ¡£

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

  1. ÔÚ Sections Ä¿Â¼ÖУ¬£¬£¬£¬ £¬ £¬µã»÷ cart-template.liquid¡£¡£¡£¡£¡£ ¡£ÈôÊÇÄúµÄÄ£°åÖÐûÓдËÎļþ£¬£¬£¬£¬ £¬ £¬Ôòµã»÷ Templates Ä¿Â¼ÖеĠcart.liquid¡£¡£¡£¡£¡£ ¡£

  2. ͨ¹ýËÑË÷ name="checkout" µÄÎļþÀ´²éÕÒ½áÕ˰´Å¥µÄ´úÂë¡£¡£¡£¡£¡£ ¡£½áÕ˰´Å¥µÄ´úÂëÐÐÒòÄ£°å¶øÒ죬£¬£¬£¬ £¬ £¬µ«»áÈçÏÂËùʾ£º

<button type="submit" id="checkout" name="checkout" class="btn">   {{ 'cart.general.checkout' | t }} </button>
  1. ÏÂÒ»²½ÊÇÕ³ÌùеĴúÂëÐÐÒÔ½¨Éè¼ÌÐø¹ºÎïÁ´½Ó¡£¡£¡£¡£¡£ ¡£ÄúÕ³ÌùµÄ´úÂ뽫ȡ¾öÓÚÄúÏ£ÍûÁ´½Óתµ½µÄÒ³Ãæ£º

¹ØÓÚÖ¸ÏòÄ¿Â¼Ò³ÃæµÄÁ´½Ó

ÈôÒªÌí¼ÓÖ¸ÏòÄ¿Â¼Ò³ÃæµÄÁ´½Ó£¬£¬£¬£¬ £¬ £¬Ç뽫Ï·½´úÂëÕ³Ìùµ½½áÕ˰´Å¥¶ÔÓ¦´úÂë֮ǰ»òÖ®ºóµÄÐÂÐÐÖУº

<a href=/channel/"/collections/all" title="Continue shopping">Continue shopping</a>

¹ØÓÚÖ¸ÏòÖ÷Ò³µÄÁ´½Ó

ÈôÒªÌí¼ÓÖ¸ÏòÄúµÄÖ÷Ò³µÄÁ´½Ó£¬£¬£¬£¬ £¬ £¬Ç뽫Ï·½´úÂëÕ³Ìùµ½½áÕ˰´Å¥¶ÔÓ¦´úÂë֮ǰ»òÖ®ºóµÄÐÂÐÐÖУº

<a href="/" title="Continue shopping">Continue shopping</a>

¹ØÓÚÖ¸ÏòÉÏÒ»¸öÉó²éµÄ²úƷϵÁеÄÁ´½Ó

ÈôÒªÌí¼ÓÖ¸ÏòÉÏÒ»¸öÉó²éµÄ²úƷϵÁеÄÁ´½Ó£¬£¬£¬£¬ £¬ £¬Ç뽫Ï·½´úÂëÕ³Ìùµ½½áÕ˰´Å¥¶ÔÓ¦´úÂë֮ǰ»òÖ®ºóµÄÐÂÐÐÖУº

<a   id="continue-shopping"   href=""   title="Continue shopping">   Continue shopping </a>
  1. µã»÷ÉúÑÄ¡£¡£¡£¡£¡£ ¡£ÈôÊÇÄúÌí¼ÓÁËÖ¸ÏòÄ¿Â¼Ò³Ãæ»òÖ÷Ò³µÄÁ´½Ó£¬£¬£¬£¬ £¬ £¬Ôò²Ù×÷ÒÑÍê³É¡£¡£¡£¡£¡£ ¡£ÈôÊÇÄúÌí¼ÓÁËÖ¸ÏòÉÏÒ»¸öÉó²éµÄ²úƷϵÁеÄÁ´½Ó£¬£¬£¬£¬ £¬ £¬ÔòÐèÒªÏòÄúµÄÄ£°å´úÂëÖÐÌí¼ÓһЩ JavaScript¡£¡£¡£¡£¡£ ¡£È»ºó¼ÌÐøÆ¾Ö¤ºóÐø°ì·¨²Ù×÷¡£¡£¡£¡£¡£ ¡£

  2. ÔÚ Layout Ä¿Â¼ÖУ¬£¬£¬£¬ £¬ £¬µã»÷ theme.liquid¡£¡£¡£¡£¡£ ¡£

  3. ÔÚÎļþµ×²¿ÖÜΧ²éÕÒ¿¢Ê </body> ±ê¼Ç¡£¡£¡£¡£¡£ ¡£½«ÒÔÏ´úÂëÕ³Ìùµ½¿¢Ê </body> ±ê¼ÇÉÏ·½£º

<script>   if(Storage !== undefined) {     var defaultLink = "/collections/all";     {% if template contains 'collection' %}       sessionStorage.collection = "{{ collection.url }}";     {% endif %}     {% if template contains 'cart' %}       if( !sessionStorage.collection ) {         sessionStorage.collection = defaultLink;       }       document.getElementById("continue-shopping").href = sessionStorage.collection;     {% endif %}     } </script>
  1. µã»÷ÉúÑÄ¡£¡£¡£¡£¡£ ¡£

Ìí¼Ó°´Å¥Ñùʽ£¨¿ÉÑ¡£¡£¡£¡£¡£ ¡£©

ÈôÊÇÄúʹÓÃÃâ·ÑµÄ Shopify Ä£°å£¬£¬£¬£¬ £¬ £¬Ôò¿ÉÒÔ½«ÑùʽӦÓÃÓÚ¼ÌÐø¹ºÎïÁ´½Ó£¬£¬£¬£¬ £¬ £¬Ê¹Ëü·ºÆð°´Å¥µÄÍâ¹Û¡£¡£¡£¡£¡£ ¡£Í¨¹ýÏò°´Å¥Á´½ÓµÄ´úÂëÖÐÌí¼ÓÀàÊôÐÔ£¬£¬£¬£¬ £¬ £¬Äú¿ÉÒÔʹÄúµÄ°´Å¥ÓëÄ£°åÖÐÆäËû°´Å¥µÄÑùʽƥÅä¡£¡£¡£¡£¡£ ¡£ËùÓÐÃâ·Ñ Shopify Ä£°å¶¼¶ÔÖ÷°´Å¥ÑùʽʹÓÃÏàͬµÄÀàÃû³Æ£¬£¬£¬£¬ £¬ £¬²¢ÇÒ´ó´ó¶¼´ËÀàÄ£°å¶Ô¸¨Öú°´Å¥ÑùʽʹÓÃÏàͬµÄÀàÃû³Æ¡£¡£¡£¡£¡£ ¡£

ÈôÒªÏò¡°¼ÌÐø¹ºÎÁ´½ÓÓ¦ÓÃÖ÷Òª°´Å¥Ñùʽ£¬£¬£¬£¬ £¬ £¬ÇëÖ´ÐÐÒÔϲÙ×÷£º

½«ÊôÐÔ class="btn" Ìí¼Óµ½ÄúÒÑÕ³ÌùµÄ´úÂëÐÐÖУ¬£¬£¬£¬ £¬ £¬ÒÔ±ãÌí¼Ó¼ÌÐø¹ºÎïÁ´½Ó¡£¡£¡£¡£¡£ ¡£ÄúµÄ´úÂëÓ¦ÈçÏÂËùʾ£º

<a href="/collections/all" title="Continue shopping" class="btn">   Continue shopping </a>

ÈôÒªÏò¡°¼ÌÐø¹ºÎÁ´½ÓÓ¦Óø¨Öú°´Å¥Ñùʽ£¬£¬£¬£¬ £¬ £¬ÇëÖ´ÐÐÒÔϲÙ×÷£º

±¸×¢£ºÌí¼Ó´ËÀà¶Ô Boundless ûÓÐÓ°Ïì¡£¡£¡£¡£¡£ ¡£

ÈôÊÇÄúʹÓõÄÊÇ Supply ÒÔÍâµÄÃâ·ÑÄ£°å£¬£¬£¬£¬ £¬ £¬Ç뽫ÊôÐÔ class="btn--secondary" Ìí¼Óµ½ÄúÒÑÕ³ÌùµÄ´úÂëÐÐÖУ¬£¬£¬£¬ £¬ £¬ÒÔ±ãÌí¼Ó¼ÌÐø¹ºÎïÁ´½Ó¡£¡£¡£¡£¡£ ¡£ÄúµÄ´úÂëÓ¦ÈçÏÂËùʾ£º

<a href=/channel/"/collections/all" title="Continue shopping" class="btn--secondary">   Continue shopping </a>

ÈôÊÇÄúʹÓà Supply£¬£¬£¬£¬ £¬ £¬Ç뽫ÊôÐÔ class="btn-secondary" Ìí¼Óµ½ÄúÒÑÕ³ÌùµÄ´úÂëÐУ¬£¬£¬£¬ £¬ £¬ÒÔ±ãÌí¼Ó¼ÌÐø¹ºÎïÁ´½Ó¡£¡£¡£¡£¡£ ¡£ÄúµÄ´úÂëÓ¦ÈçÏÂËùʾ£º

<a href="/collections/all" title="Continue shopping" class="btn-secondary">   Continue shopping </a>

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

Add a continue shopping link to 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 add a Continue shopping link to your cart page that allows customers to easily return to browsing products after adding something to the cart. You can choose to add a link that will take customers back to your catalog page, back to your home page, or back to the last collection page that they were looking at.

Add a Continue shopping link to your cart page

To add a Continue shopping link to your cart page:

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 cart-template.liquid. If your theme doesn't have this file, then click cart.liquid in the Templates directory.

  2. Find the code for the Checkout button by searching the file for name="checkout". The line of code for the checkout button varies theme to theme, but will look something like this:

    <button type="submit" id="checkout" name="checkout" class="btn">   {{ 'cart.general.checkout' | t }} </button>
  3. The next step is to paste a new line of code to create a Continue shopping link. The code that you paste will depend on which page you would like the link to go to:

    For a link that goes to your catalog page

    To add a link that goes to your catalog page, paste the following code on a new line either before or after the code for the Checkout button:

    <a href=/channel/"/collections/all" title="Continue shopping">Continue shopping</a>

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 cart-template.liquid. If your theme doesn't have this file, then click cart.liquid in the Templates directory.

  2. Find the code for the Checkout button by searching the file for name="checkout". The line of code for the checkout button varies theme to theme, but will look something like this:

    <button type="submit" id="checkout" name="checkout" class="btn">   {{ 'cart.general.checkout' | t }} </button>
  3. The next step is to paste a new line of code to create a Continue shopping link. The code that you paste will depend on which page you would like the link to go to:

    For a link that goes to your catalog page

    To add a link that goes to your catalog page, paste the following code on a new line either before or after the code for the Checkout button:

    <a href=/channel/"/collections/all" title="Continue shopping">Continue shopping</a>

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 cart-template.liquid. If your theme doesn't have this file, then click cart.liquid in the Templates directory.

  2. Find the code for the Checkout button by searching the file for name="checkout". The line of code for the checkout button varies theme to theme, but will look something like this:

    <button type="submit" id="checkout" name="checkout" class="btn">   {{ 'cart.general.checkout' | t }} </button>
  3. The next step is to paste a new line of code to create a Continue shopping link. The code that you paste will depend on which page you would like the link to go to:

    For a link that goes to your catalog page

    To add a link that goes to your catalog page, paste the following code on a new line either before or after the code for the Checkout button:

    <a href=/channel/"/collections/all" title="Continue shopping">Continue shopping</a>
  1. For a link that goes to your home page

    To add a link that goes to your home page, paste the following code on a new line either before or after the code for the Checkout button:

    <a href="/" title="Continue shopping">Continue shopping</a>

    For a link that goes to the last collection viewed

    To add a link that goes to the last collection viewed, paste the following code on a new line either before or after the code for the Checkout button:

    <a   id="continue-shopping"   href=""   title="Continue shopping">   Continue shopping </a>
  2. Click Save. If you added a link that goes to either your catalog page or your home page, then you are done. If you added a link that goes to the last collection viewed, then you will need to add some JavaScript to your theme code. Continue to follow the next steps.

  3. In the Layout directory, click theme.liquid.

  4. Find the closing </body> tag, near the bottom of the file. Paste the following code above the closing </body> tag:

    <script>   if(Storage !== undefined) {     var defaultLink = "/collections/all";     {% if template contains 'collection' %}       sessionStorage.collection = "{{ collection.url }}";     {% endif %}     {% if template contains 'cart' %}       if( !sessionStorage.collection ) {         sessionStorage.collection = defaultLink;       }       document.getElementById("continue-shopping").href = sessionStorage.collection;     {% endif %}     } </script>
  5. Click Save.

Add button styling (optional)

If you use a free Shopify theme, then you can apply styling to your Continue shopping link to make it look like a button. By adding a class attribute to the code for your button link, you can make your button match the style of the other buttons in your theme. All free Shopify themes use the same class name for primary button styles, and most use the same class name for secondary button styles.

To apply primary button styling to your Continue shopping link:

Add the attribute class="btn" to the line of code that you pasted to add a Continue shopping link. Your code should look like this:

<a href="/collections/all" title="Continue shopping" class="btn">   Continue shopping </a>

To apply secondary button styling to your Continue shopping link:


Note

Adding this class will not have an effect on Boundless.


If you use a free theme that is not Supply, then add the attribute class="btn--secondary" to the line of code that you pasted to add a Continue shopping link. Your code should look like this:

<a href=/channel/"/collections/all" title="Continue shopping" class="btn--secondary">   Continue shopping </a>

If you use Supply, then add the attribute class="btn-secondary" to the line of code that you pasted to add a Continue shopping link. Your code should look like this:

<a href="/collections/all" title="Continue shopping" class="btn-secondary">   Continue shopping </a>

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


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