shopify²úÆ·ÏÔʾ SKU ±àºÅºÍÌí¼ÓSKU±àºÅ°ì·¨
ÔÚ²úÆ·Ò³ÃæÉÏÏÔʾ SKU ±àºÅ
±¸×¢
ÈôÊÇÄúʹÓà Shopify µÄÃâ·ÑÄ£°å£¬£¬£¬£¬£¬£¬£¬£¬Äú¿ÉÒÔÁªÏµ Shopify Ö§³ÖÍŶӻñµÃ¹ØÓڴ˽̵̳Ä×ÊÖú¡£¡£¡£¡£¡£´Ë½Ì³ÌÐèÒª 15 ·ÖÖÓµÄÉè¼ÆÊ±¼ä¡£¡£¡£¡£¡£ÈôÒªÏàʶÏêÇ飬£¬£¬£¬£¬£¬£¬£¬Çë²ÎÔÄ Support for themes¡£¡£¡£¡£¡£
±¸×¢
´Ë×Ô½ç˵ÓÃÓÚ¸´¹Å Shopify Ä£°å£¬£¬£¬£¬£¬£¬£¬£¬²»ÊÊÓÃÓÚ¡°Online Store 2.0¡±Ä£°å¡£¡£¡£¡£¡£
ÕÒµ½ÄúµÄÄ£°å¼Ü¹¹°æ±¾
̽Ë÷¡°Online Store 2.0¡±Ä£°å×Ô½ç˵
SKU£¨»õºÅ£©ÓÉÊý×Ö£¨Í¨³£ÊÇ×ÖĸÊý×Ö£©×é³É£¬£¬£¬£¬£¬£¬£¬£¬ÓÃÓÚ×ÊÖúʶ±ð²úÆ·ºÍ¸ú×Ù¿â´æ¡£¡£¡£¡£¡£ÈôÊÇÊÐËÁʹÓà SKU£¬£¬£¬£¬£¬£¬£¬£¬Ôòÿ¸öµ¥¶ÀµÄ²úÆ·¶àÊôÐÔ¶¼»á·ÖÅɵ½Î¨Ò»µÄ±àºÅ¡£¡£¡£¡£¡£Äú¿ÉÒÔͨ¹ý±à¼Ä£°å´úÂëÀ´ÔÚ²úÆ·Ò³ÃæÉÏÏÔʾ¶àÊôÐ﵀ SKU ±àºÅ£º
·ÖÇøÄ£°åºÍδ·ÖÇøÄ£°å
±¸×¢£º±¾½Ì³ÌµÄ°ì·¨½«Æ¾Ö¤ÄúʹÓõÄÊÇ·ÖÇøÄ£°åÕÕ¾Éδ·ÖÇøÄ£°å¶øÓÐËù²î±ð¡£¡£¡£¡£¡£·ÖÇøÄ£°åÖ§³Öͨ¹ýÍÏ·ÅÀ´°²ÅÅÖ÷Ò³µÄ½á¹¹£¬£¬£¬£¬£¬£¬£¬£¬Î´·ÖÇøÄ£°åÔò²»Ö§³Ö¡£¡£¡£¡£¡£
ÈôÊÇÏëÏàʶÄúµÄÄ£°åÊÇ·ñÖ§³Ö·ÖÇø£¬£¬£¬£¬£¬£¬£¬£¬Çëתµ½Ä£°åµÄ±à¼´úÂëÒ³Ãæ¡£¡£¡£¡£¡£ÈôÊÇ Sections Ŀ¼ÖÐÓÐÎļþ£¬£¬£¬£¬£¬£¬£¬£¬ÄúÔòÕýÔÚʹÓÃÒÑ·ÖÇøÄ£°å¡£¡£¡£¡£¡£Î´·ÖÇøÄ£°åÊÇÔÚ 2016 Äê 10 ÔÂ֮ǰÐû²¼µÄ£¬£¬£¬£¬£¬£¬£¬£¬²¢ÇÒ Sections Ŀ¼ÖÐûÓÐÎļþ¡£¡£¡£¡£¡£
ÈôÊÇÄúʹÓÃÒÑ·ÖÇøÄ£°å£¬£¬£¬£¬£¬£¬£¬£¬Çëµã»÷ Sectioned themes£¨ÒÑ·ÖÇøÄ£°å£©°´Å¥²¢Æ¾Ìý˵Ã÷¾ÙÐвÙ×÷¡£¡£¡£¡£¡£ÈôÊÇÄúʹÓýϾɵÄδ·ÖÇøÄ£°å£¬£¬£¬£¬£¬£¬£¬£¬Çëµã»÷ Non-sectioned themes£¨Î´·ÖÇøÄ£°å£©°´Å¥²¢Æ¾Ìý˵Ã÷¾ÙÐвÙ×÷¡£¡£¡£¡£¡£
Sectioned themes
Non-sectioned themes
±¾Ò³Ïà¹ØÖ÷Ìâ
ÔÚ²úÆ·Ò³ÃæÉÏÏÔʾ SKU ±àºÅ
´Óºǫ́Ïò²úÆ·¶àÊôÐÔÌí¼Ó SKU ±àºÅ
ÔÚ²úÆ·Ò³ÃæÉÏÏÔʾ SKU ±àºÅ
ÈôÒª±à¼ÄúµÄÄ£°åÒÔÔÚ²úÆ·Ò³ÃæÉÏÏÔʾ SKU ±àºÅ£¬£¬£¬£¬£¬£¬£¬£¬ÇëÖ´ÐÐÒÔϲÙ×÷£º
PC£º
ÔÚ Shopify ºǫ́ÖУ¬£¬£¬£¬£¬£¬£¬£¬×ªµ½ÔÚÏßÊÐËÁ > Ä£°å¡£¡£¡£¡£¡£
ÕÒµ½Òª±à¼µÄÄ£°å£¬£¬£¬£¬£¬£¬£¬£¬È»ºóµã»÷²Ù×÷ > ±à¼´úÂë¡£¡£¡£¡£¡£
ÔÚ Sections Ŀ¼ÖУ¬£¬£¬£¬£¬£¬£¬£¬µã»÷
product.liquid»òproduct-template.liquid¡£¡£¡£¡£¡£²éÕÒÒÔÏ Liquid ±ê¼Ç£º
{{ product.title }}ÕâÊÇÔÚ²úÆ·Ò³ÃæÉÏ·ºÆð²úÆ·ÎÊÌâµÄ´úÂë¡£¡£¡£¡£¡£
ÔÚ°üÀ¨
{{ product.title }}µÄ´úÂëÐÐÏ·½µÄÐÂÐÐÖУ¬£¬£¬£¬£¬£¬£¬£¬Õ³ÌùÒÔÏ´úÂ룺
{% assign current_variant = product.selected_or_first_available_variant %} <span>{{ current_variant.sku }}</span>µã»÷ÉúÑÄ¡£¡£¡£¡£¡£
Æ»¹ûϵͳ£º
ÔÚ Shopify Ó¦ÓÃÖУ¬£¬£¬£¬£¬£¬£¬£¬Çá´¥ÊÐËÁ¡£¡£¡£¡£¡£
ÔÚÏúÊÛÇþµÀ²¿·ÖÖУ¬£¬£¬£¬£¬£¬£¬£¬Çá´¥ÔÚÏßÊÐËÁ¡£¡£¡£¡£¡£
Çá´¥ Manage themes£¨ÖÎÀíÄ£°å£©¡£¡£¡£¡£¡£
ÕÒµ½Òª±à¼µÄÄ£°å£¬£¬£¬£¬£¬£¬£¬£¬È»ºóµã»÷²Ù×÷ > ±à¼´úÂë¡£¡£¡£¡£¡£
ÔÚ Sections Ŀ¼ÖУ¬£¬£¬£¬£¬£¬£¬£¬µã»÷
product.liquid»òproduct-template.liquid¡£¡£¡£¡£¡£²éÕÒÒÔÏ Liquid ±ê¼Ç£º
{{ product.title }}ÕâÊÇÔÚ²úÆ·Ò³ÃæÉÏ·ºÆð²úÆ·ÎÊÌâµÄ´úÂë¡£¡£¡£¡£¡£
ÔÚ°üÀ¨
{{ product.title }}µÄ´úÂëÐÐÏ·½µÄÐÂÐÐÖУ¬£¬£¬£¬£¬£¬£¬£¬Õ³ÌùÒÔÏ´úÂ룺
{% assign current_variant = product.selected_or_first_available_variant %} <span>{{ current_variant.sku }}</span>µã»÷ÉúÑÄ¡£¡£¡£¡£¡£
°²×¿ÏµÍ³£º
ÔÚ Shopify Ó¦ÓÃÖУ¬£¬£¬£¬£¬£¬£¬£¬Çá´¥ÊÐËÁ¡£¡£¡£¡£¡£
ÔÚÏúÊÛÇþµÀ²¿·ÖÖУ¬£¬£¬£¬£¬£¬£¬£¬Çá´¥ÔÚÏßÊÐËÁ¡£¡£¡£¡£¡£
Çá´¥ Manage themes£¨ÖÎÀíÄ£°å£©¡£¡£¡£¡£¡£
ÕÒµ½Òª±à¼µÄÄ£°å£¬£¬£¬£¬£¬£¬£¬£¬È»ºóµã»÷²Ù×÷ > ±à¼´úÂë¡£¡£¡£¡£¡£
ÔÚ Sections Ŀ¼ÖУ¬£¬£¬£¬£¬£¬£¬£¬µã»÷
product.liquid»òproduct-template.liquid¡£¡£¡£¡£¡£²éÕÒÒÔÏ Liquid ±ê¼Ç£º
{{ product.title }}ÕâÊÇÔÚ²úÆ·Ò³ÃæÉÏ·ºÆð²úÆ·ÎÊÌâµÄ´úÂë¡£¡£¡£¡£¡£
ÔÚ°üÀ¨
{{ product.title }}µÄ´úÂëÐÐÏ·½µÄÐÂÐÐÖУ¬£¬£¬£¬£¬£¬£¬£¬Õ³ÌùÒÔÏ´úÂ룺
{% assign current_variant = product.selected_or_first_available_variant %} <span>{{ current_variant.sku }}</span>µã»÷ÉúÑÄ¡£¡£¡£¡£¡£
Ñ¡ÔñÄúµÄÄ£°å
´Ë×Ô½ç˵ÉèÖõĺóÐø°ì·¨ÒòÄúµÄÄ£°å¶øÒì¡£¡£¡£¡£¡£µã»÷Ä£°åµÄ°´Å¥£¬£¬£¬£¬£¬£¬£¬£¬È»ºóƾÌý˵Ã÷²Ù×÷¡£¡£¡£¡£¡£
Boundless °ì·¨
ÔÚ Assets Ŀ¼ÖУ¬£¬£¬£¬£¬£¬£¬£¬µã»÷
theme.js.liquid¡£¡£¡£¡£¡£²éÕÒ
variant.sku¡£¡£¡£¡£¡£ÈôÊÇÄúÄܹ»ÕÒµ½
variant.sku£¬£¬£¬£¬£¬£¬£¬£¬ÔòÌåÏÖÄúÒÑÍê³É×Ô½ç˵ÉèÖᣡ£¡£¡£¡£ÈôÊÇÄúÕÒ²»µ½
variant.sku£¬£¬£¬£¬£¬£¬£¬£¬Çë¼ÌÐø¾ÙÐÐÏÂÒ»²½¡£¡£¡£¡£¡£ÔÚÎļþµ×²¿£¬£¬£¬£¬£¬£¬£¬£¬Õ³ÌùÒÔÏ´úÂ룺
document.addEventListener('DOMContentLoaded', () => { setTimeout(function() { const productJson = [...document.querySelectorAll('[id^=ProductJson-')]; if (productJson.length > 0) { productJson.forEach((product) => { const sectionId = product.id.replace("ProductJson-", "shopify-section-"); const variantSKU = document.querySelector('#' + sectionId + ' .variant-sku'); const inputSelects = [...document.querySelectorAll('#' + sectionId + ' .single-option-selector')]; const productInfo = JSON.parse(product.innerHTML); const inputValues = []; const optionValues = []; let count = 0; inputSelects.forEach((input) => { inputValues.push(input.value); optionValues.push(count); input.addEventListener('change', (evt) => { const currentValue = evt.currentTarget.value.toString(); const changedIndex = inputSelects.indexOf(evt.target); inputValues[changedIndex] = currentValue; variantSKU.innerText = ' '; productInfo.variants.forEach((variant) => { if (JSON.stringify(variant.options) == JSON.stringify(inputValues)) { variantSKU.innerText = variant.sku; } }); }); count += 1; }); }); } }, 100); });µã»÷ÉúÑÄ¡£¡£¡£¡£¡£
´Óºǫ́Ïò²úÆ·¶àÊôÐÔÌí¼Ó SKU ±àºÅ
ÈôÒªÔÚ²úÆ·Ò³ÃæÉÏÏÔʾ SKU£¬£¬£¬£¬£¬£¬£¬£¬Äú±ØÐè´Ó Shopify ºǫ́Ïò²úÆ·¶àÊôÐÔÌí¼Ó SKU ±àºÅ¡£¡£¡£¡£¡£
ÔÚ Shopify ºǫ́ÖУ¬£¬£¬£¬£¬£¬£¬£¬×ªµ½²úÆ·¡£¡£¡£¡£¡£
µã»÷ÄúÒª±à¼µÄ²úÆ·¡£¡£¡£¡£¡£
¹ØÓÚ¾ßÓжà¸ö¶àÊôÐԵIJúÆ·£¬£¬£¬£¬£¬£¬£¬£¬ÇëÔÚ¶àÊôÐÔ·ÖÇøÖÐÌí¼Ó SKU ±àºÅ£º
¹ØÓÚûÓжàÊôÐԵIJúÆ·£¬£¬£¬£¬£¬£¬£¬£¬ÇëÔÚ¿â´æ·ÖÇøÖÐÌí¼Ó SKU ±àºÅ£º
µã»÷ÉúÑÄ¡£¡£¡£¡£¡£
ShopifyÉÌ»§¹ÙÍøÔÎÄÏêÇ飺
Show SKU numbers on product pages
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
SKUs (stock keeping units) are numbers, typically alphanumeric, that are used to help identify products and track inventory. If a store uses SKUs, then a unique number is assigned to each individual product variant. You can show SKU numbers for variants on your product pages by editing your theme code:
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.
Sectioned themes
Non-sectioned themes
On this page
Show SKU numbers on product pages
Add SKU numbers to your product variants from the admin
Show SKU numbers on product pages
To edit your theme to show SKU numbers on product pages:
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
product.liquidorproduct-template.liquid.Find the following Liquid tag:
{{ product.title }}This is the code that renders your product titles on the product page.
On a new line below the line of code that includes
{{ product.title }}, paste the following code:{% assign current_variant = product.selected_or_first_available_variant %} <span>{{ current_variant.sku }}</span>Click Save.
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
product.liquidorproduct-template.liquid.Find the following Liquid tag:
{{ product.title }}This is the code that renders your product titles on the product page.
On a new line below the line of code that includes
{{ product.title }}, paste the following code:{% assign current_variant = product.selected_or_first_available_variant %} <span>{{ current_variant.sku }}</span>Click Save.
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
product.liquidorproduct-template.liquid.Find the following Liquid tag:
{{ product.title }}This is the code that renders your product titles on the product page.
On a new line below the line of code that includes
{{ product.title }}, paste the following code:{% assign current_variant = product.selected_or_first_available_variant %} <span>{{ current_variant.sku }}</span>Click Save.
Select your theme
The next steps for this customization vary depending on your theme. Click the button for your theme and follow the instructions.
Steps for Boundless
In the Assets directory, click
theme.js.liquid.Look for
variant.sku.If you're able to find
variant.sku, then you have completed the customization.If you're unable to find
variant.sku, then continue to the next step.At the bottom of the file, paste the following code:
document.addEventListener('DOMContentLoaded', () => { setTimeout(function() { const productJson = [...document.querySelectorAll('[id^=ProductJson-')]; if (productJson.length > 0) { productJson.forEach((product) => { const sectionId = product.id.replace("ProductJson-", "shopify-section-"); const variantSKU = document.querySelector('#' + sectionId + ' .variant-sku'); const inputSelects = [...document.querySelectorAll('#' + sectionId + ' .single-option-selector')]; const productInfo = JSON.parse(product.innerHTML); const inputValues = []; const optionValues = []; let count = 0; inputSelects.forEach((input) => { inputValues.push(input.value); optionValues.push(count); input.addEventListener('change', (evt) => { const currentValue = evt.currentTarget.value.toString(); const changedIndex = inputSelects.indexOf(evt.target); inputValues[changedIndex] = currentValue; variantSKU.innerText = ' '; productInfo.variants.forEach((variant) => { if (JSON.stringify(variant.options) == JSON.stringify(inputValues)) { variantSKU.innerText = variant.sku; } }); }); count += 1; }); }); } }, 100); });Click Save.
Add SKU numbers to your product variants from the admin
To have SKUs appear on your product pages, you must add SKU numbers to your product variants from in Shopify admin.
From your Shopify admin, go to Products.
Click on the product that you would like to edit.
For products with multiple variants, in the Variants section, add your SKU numbers:
For products without variants, in the Inventory section, add your SKU number:
Click Save.
ÎÄÕÂÄÚÈÝȪԴ£ºShopifyÉÌ»§¹Ù·½ÍøÕ¾
- 1ËÙÂôͨÂô¼Ò±ØÖªµÄÓÅÑ¡²Ö
- 2ËÙÂôͨ·¢»õ±ØÐèÌù±êÇ©Â𣿣¿£¿£¿£¿£¿£¿·¢»õ±êÇ©ÓÐÄÄЩҪÇ󣿣¿£¿£¿£¿£¿£¿
- 3ÑÇÂíÑ·FBAÔõÑù¿ªÆô
- 4ÆóÒµºÏ¹æ³öº£µÄ37ºÅÎĹҺŵĽ¹µãÒªµã
- 5Lazada¿ªµêÁ÷³ÌÓÐÄÄЩ
- 6ShopeeÔõÑùÒýÁì¶«ÄÏÑǵçÉÌÔöÌí?
- 7ÔõôÕÒÒ»¸öºÃµÄÅ·´ú£¿£¿£¿£¿£¿£¿£¿
- 8ShopifyµêËÁ·¢»õ·½·¨ÆÊÎö
- 9¿ç¾³µçÉ̵ÄÈÈÏúÆ·Àࣺ´Ó´ò°çЬñµ½Îå½ð¹¤¾ß
- 10ÑÇÂíÑ·Æ·ÅÆÆì½¢µêÈëפÌõ¼þ¼°°ì·¨