shopify¹ºÎï³µÒ³ÃæÌí¼Ó¡°¼ÌÐø¹ºÎÁ´½Ó°ì·¨
Ïò¹ºÎï³µÒ³ÃæÌí¼Ó¡°¼ÌÐø¹ºÎÁ´½Ó
±¸×¢
ÈôÊÇÄúʹÓà Shopify µÄÃâ·ÑÄ£°å£¬£¬£¬£¬£¬£¬Äú¿ÉÒÔÁªÏµ Shopify Ö§³ÖÍŶӻñµÃ¹ØÓڴ˽̵̳Ä×ÊÖú¡£¡£¡£¡£¡£¡£´Ë½Ì³ÌÐèÒª 15 ·ÖÖÓµÄÉè¼ÆÊ±¼ä¡£¡£¡£¡£¡£¡£ÈôÒªÏàʶÏêÇ飬£¬£¬£¬£¬£¬Çë²ÎÔÄ Support for themes¡£¡£¡£¡£¡£¡£
±¸×¢
´Ë×Ô½ç˵ÓÃÓÚ¸´¹Å Shopify Ä£°å£¬£¬£¬£¬£¬£¬²»ÊÊÓÃÓÚ¡°Online Store 2.0¡±Ä£°å¡£¡£¡£¡£¡£¡£
ÕÒµ½ÄúµÄÄ£°å¼Ü¹¹°æ±¾
̽Ë÷¡°Online Store 2.0¡±Ä£°å×Ô½ç˵
Äú¿ÉÒÔ½«¼ÌÐø¹ºÎïÁ´½ÓÌí¼Óµ½¹ºÎï³µÒ³Ãæ£¬£¬£¬£¬£¬£¬Ê¹¿Í»§ÔÚ½«²úÆ·Ìí¼Óµ½¹ºÎï³µºó¿ÉÇáËÉ·µ»Øä¯ÀÀ²úÆ·¡£¡£¡£¡£¡£¡£Äú¿ÉÒÔÑ¡ÔñÌí¼ÓÒ»¸öÁ´½Ó£¬£¬£¬£¬£¬£¬ÓÃÓÚ½«¿Í»§¶¨Ïò»ØÄ¿Â¼Ò³Ãæ¡¢ÄúµÄÖ÷Ò³»òËûÃÇ֮ǰÉó²éµÄ×îºóÒ»¸ö²úƷϵÁÐÒ³Ãæ¡£¡£¡£¡£¡£¡£
Ïò¹ºÎï³µÒ³ÃæÌí¼Ó¡°¼ÌÐø¹ºÎÁ´½Ó
ÈôÒªÏòÄúµÄ¹ºÎï³µÒ³ÃæÌí¼Ó¼ÌÐø¹ºÎïÁ´½Ó£¬£¬£¬£¬£¬£¬ÇëÖ´ÐÐÒÔϲÙ×÷£º
PC£º
ÔÚ Shopify ºǫ́ÖУ¬£¬£¬£¬£¬£¬×ªµ½ÔÚÏßÊÐËÁ > Ä£°å¡£¡£¡£¡£¡£¡£
ÕÒµ½Òª±à¼µÄÄ£°å£¬£¬£¬£¬£¬£¬È»ºóµã»÷²Ù×÷ > ±à¼´úÂë¡£¡£¡£¡£¡£¡£
ÔÚ Sections Ŀ¼ÖУ¬£¬£¬£¬£¬£¬µã»÷
cart-template.liquid¡£¡£¡£¡£¡£¡£ÈôÊÇÄúµÄÄ£°åÖÐûÓдËÎļþ£¬£¬£¬£¬£¬£¬Ôòµã»÷ Templates Ŀ¼ÖеÄcart.liquid¡£¡£¡£¡£¡£¡£Í¨¹ýËÑË÷
name="checkout"µÄÎļþÀ´²éÕÒ½áÕ˰´Å¥µÄ´úÂë¡£¡£¡£¡£¡£¡£½áÕ˰´Å¥µÄ´úÂëÐÐÒòÄ£°å¶øÒ죬£¬£¬£¬£¬£¬µ«»áÈçÏÂËùʾ£º
<button type="submit" id="checkout" name="checkout" class="btn"> {{ 'cart.general.checkout' | t }} </button>ÏÂÒ»²½ÊÇÕ³ÌùеĴúÂëÐÐÒÔ½¨Éè¼ÌÐø¹ºÎïÁ´½Ó¡£¡£¡£¡£¡£¡£ÄúÕ³ÌùµÄ´úÂ뽫ȡ¾öÓÚÄúÏ£ÍûÁ´½Óתµ½µÄÒ³Ãæ£º
Æ»¹ûϵͳ£º
ÔÚ Shopify Ó¦ÓÃÖУ¬£¬£¬£¬£¬£¬Çá´¥ÊÐËÁ¡£¡£¡£¡£¡£¡£
ÔÚÏúÊÛÇþµÀ²¿·ÖÖУ¬£¬£¬£¬£¬£¬Çá´¥ÔÚÏßÊÐËÁ¡£¡£¡£¡£¡£¡£
Çá´¥ Manage themes£¨ÖÎÀíÄ£°å£©¡£¡£¡£¡£¡£¡£
ÕÒµ½Òª±à¼µÄÄ£°å£¬£¬£¬£¬£¬£¬È»ºóµã»÷²Ù×÷ > ±à¼´úÂë¡£¡£¡£¡£¡£¡£
ÔÚ Sections Ŀ¼ÖУ¬£¬£¬£¬£¬£¬µã»÷
cart-template.liquid¡£¡£¡£¡£¡£¡£ÈôÊÇÄúµÄÄ£°åÖÐûÓдËÎļþ£¬£¬£¬£¬£¬£¬Ôòµã»÷ Templates Ŀ¼ÖеÄcart.liquid¡£¡£¡£¡£¡£¡£Í¨¹ýËÑË÷
name="checkout"µÄÎļþÀ´²éÕÒ½áÕ˰´Å¥µÄ´úÂë¡£¡£¡£¡£¡£¡£½áÕ˰´Å¥µÄ´úÂëÐÐÒòÄ£°å¶øÒ죬£¬£¬£¬£¬£¬µ«»áÈçÏÂËùʾ£º
<button type="submit" id="checkout" name="checkout" class="btn"> {{ 'cart.general.checkout' | t }} </button>ÏÂÒ»²½ÊÇÕ³ÌùеĴúÂëÐÐÒÔ½¨Éè¼ÌÐø¹ºÎïÁ´½Ó¡£¡£¡£¡£¡£¡£ÄúÕ³ÌùµÄ´úÂ뽫ȡ¾öÓÚÄúÏ£ÍûÁ´½Óתµ½µÄÒ³Ãæ£º
°²×¿ÏµÍ³£º
ÔÚ Shopify Ó¦ÓÃÖУ¬£¬£¬£¬£¬£¬Çá´¥ÊÐËÁ¡£¡£¡£¡£¡£¡£
ÔÚÏúÊÛÇþµÀ²¿·ÖÖУ¬£¬£¬£¬£¬£¬Çá´¥ÔÚÏßÊÐËÁ¡£¡£¡£¡£¡£¡£
Çá´¥ Manage themes£¨ÖÎÀíÄ£°å£©¡£¡£¡£¡£¡£¡£
ÕÒµ½Òª±à¼µÄÄ£°å£¬£¬£¬£¬£¬£¬È»ºóµã»÷²Ù×÷ > ±à¼´úÂë¡£¡£¡£¡£¡£¡£
ÔÚ Sections Ŀ¼ÖУ¬£¬£¬£¬£¬£¬µã»÷
cart-template.liquid¡£¡£¡£¡£¡£¡£ÈôÊÇÄúµÄÄ£°åÖÐûÓдËÎļþ£¬£¬£¬£¬£¬£¬Ôòµã»÷ Templates Ŀ¼ÖеÄcart.liquid¡£¡£¡£¡£¡£¡£Í¨¹ýËÑË÷
name="checkout"µÄÎļþÀ´²éÕÒ½áÕ˰´Å¥µÄ´úÂë¡£¡£¡£¡£¡£¡£½áÕ˰´Å¥µÄ´úÂëÐÐÒòÄ£°å¶øÒ죬£¬£¬£¬£¬£¬µ«»áÈçÏÂËùʾ£º
<button type="submit" id="checkout" name="checkout" class="btn"> {{ 'cart.general.checkout' | t }} </button>ÏÂÒ»²½ÊÇÕ³ÌùеĴúÂëÐÐÒÔ½¨Éè¼ÌÐø¹ºÎïÁ´½Ó¡£¡£¡£¡£¡£¡£ÄúÕ³ÌùµÄ´úÂ뽫ȡ¾öÓÚÄúÏ£ÍûÁ´½Óתµ½µÄÒ³Ãæ£º
¹ØÓÚÖ¸ÏòÄ¿Â¼Ò³ÃæµÄÁ´½Ó
ÈôÒªÌí¼ÓÖ¸ÏòÄ¿Â¼Ò³ÃæµÄÁ´½Ó£¬£¬£¬£¬£¬£¬Ç뽫Ï·½´úÂëÕ³Ìùµ½½áÕ˰´Å¥¶ÔÓ¦´úÂë֮ǰ»òÖ®ºóµÄÐÂÐÐÖУº
<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>
µã»÷ÉúÑÄ¡£¡£¡£¡£¡£¡£ÈôÊÇÄúÌí¼ÓÁËÖ¸ÏòÄ¿Â¼Ò³Ãæ»òÖ÷Ò³µÄÁ´½Ó£¬£¬£¬£¬£¬£¬Ôò²Ù×÷ÒÑÍê³É¡£¡£¡£¡£¡£¡£ÈôÊÇÄúÌí¼ÓÁËÖ¸ÏòÉÏÒ»¸öÉó²éµÄ²úƷϵÁеÄÁ´½Ó£¬£¬£¬£¬£¬£¬ÔòÐèÒªÏòÄúµÄÄ£°å´úÂëÖÐÌí¼ÓһЩ JavaScript¡£¡£¡£¡£¡£¡£È»ºó¼ÌÐøÆ¾Ö¤ºóÐø°ì·¨²Ù×÷¡£¡£¡£¡£¡£¡£
ÔÚ Layout Ŀ¼ÖУ¬£¬£¬£¬£¬£¬µã»÷
theme.liquid¡£¡£¡£¡£¡£¡£ÔÚÎļþµ×²¿ÖÜΧ²éÕÒ¿¢ÊÂ
</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>µã»÷ÉúÑÄ¡£¡£¡£¡£¡£¡£
Ìí¼Ó°´Å¥Ñùʽ£¨¿ÉÑ¡£¡£¡£¡£¡£¡£©
ÈôÊÇÄúʹÓÃÃâ·ÑµÄ 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:
From your Shopify admin, go to Online Store > Themes.
Find the theme you want to edit, and then click Actions > Edit code.
In the Sections directory, click
cart-template.liquid. If your theme doesn't have this file, then clickcart.liquidin the Templates directory.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>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£º
From the Shopify app, tap Store.
In the Sales channels section, tap Online Store.
Tap Manage themes.
Find the theme you want to edit, and then click Actions > Edit code.
In the Sections directory, click
cart-template.liquid. If your theme doesn't have this file, then clickcart.liquidin the Templates directory.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>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£º
From the Shopify app, tap Store.
In the Sales channels section, tap Online Store.
Tap Manage themes.
Find the theme you want to edit, and then click Actions > Edit code.
In the Sections directory, click
cart-template.liquid. If your theme doesn't have this file, then clickcart.liquidin the Templates directory.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>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>
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>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.
In the Layout directory, click
theme.liquid.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>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ÉÌ»§¹Ù·½ÍøÕ¾
- 1³ö¿ÚÉÌÆ·ÉúÒâ̸Åеķ½·¨ºÍÄÚÈÝ
- 2ÉîÈëÏàʶLinkedInȺ×飺ÅþÁ¬ÐÐÒµ´óÅ££¬£¬£¬£¬£¬£¬»ñÈ¡¸É»õ×ÊѶ
- 3Etsy ¿ªµê¹¥ÂÔ
- 4VKontakteÏÈÈÝ
- 5ÑÇÂíÑ·ÔËÓªÐèÒª¹æ±ÜµÄÎå¸ö¿ÓºÍÑÇÂíÑ·Ê®ÏîѡƷ¼¼ÇÉ
- 6ÍâÑó×ÔÁ¦Õ¾ÔõÑùÑ¡ÔñºÏÊʵĵÚÈý·½Ö§¸¶»ú¹¹£¿£¿£¿£¿£¿£¿
- 7ÑÇÂíÑ·Ò»¸ö̸ÂÛ»òÐí¼¸¶à¶©µ¥£¿£¿£¿£¿£¿£¿
- 8ÔõÑùÌáÉýÖ§¸¶ÀÖ³ÉÂÊ£¿£¿£¿£¿£¿£¿
- 9×ÔÁ¦Õ¾´òÔìÀÖ³ÉÓªÏúÕ½ÂÔµÄÒªº¦°ì·¨ÓÐÄÄЩ
- 10Èç×÷ÉõebayÉèÖòúÆ·Öֱ𣿣¿£¿£¿£¿£¿