变更产品系列网页面上表明的产品数量
2022-05-27 16:49:05
变更产品系列网页页面上表明的产品数量
备注名称
假如您应用Shopify的完全免费模板,您可以联络Shopify适用精英团队得到有关此实例教程的协助。此实例教程必须15分鐘的制定时长。若要掌握详细信息,客户程序Supportforthemes。
备注名称
此自定用以复古时尚Shopify模板,不适感用以“OnlineStore2.0”模板。
寻找您的模板构架版本号
探寻“OnlineStore2.0”模板自定
根据变更模板编辑软件中的模板设定或编写您的模板代码,您可以变更产品系列网页页面上表明的产品数量。您可以按需显示一切总数的商品,只需不超过Shopify每张50个商品的限定就可以。
查验您的模板设定
在变更模板代码以前,转到模板编辑软件。
在网页顶端的下拉列表或在手机上的模板菜单栏中,挑选产品系列网页页面。
点击产品系列页面或产品系列。
假如您的模板具备可改产品系列网页页面上表明的产品数量的设定,请调节该设定以符合您的要求。
点击储存。
假如您的模板中并没有用以变更每张表明的产品数量的设定,或是存有该类设定但针对您要实行的变更过度局限性,请根据下列流程编写您的模板代码。
更新collection-template.liquid文档
PC:
在Shopify后台管理中,转到在线商店模板。
寻找要编写的模板,随后点击实际操作编写代码。
在Sections文件目录中,点击collection-template.liquid
。
在代码编辑软件中,搜索下列代码:
{%paginatecollection.productsby9%}
ios系统:
在Shopify运用中,轻触店铺。
在营销渠道一部分中,轻触在线商店。
轻触Managethemes(管理方法模板)。
寻找要编写的模板,随后点击实际操作编写代码。
在Sections文件目录中,点击collection-template.liquid
。
在代码编辑软件中,搜索下列代码:
{%paginatecollection.productsby9%}
安卓手机系统:
在Shopify运用中,轻触店铺。
在营销渠道一部分中,轻触在线商店。
轻触Managethemes(管理方法模板)。
寻找要编写的模板,随后点击实际操作编写代码。
在Sections文件目录中,点击collection-template.liquid
。
在代码编辑软件中,搜索下列代码:
{%paginatecollection.productsby9%}
在上面的例子中,每张的默认设置商品数是9。此总数因模板而异。您必须将此总数更改成您想在产品系列网页页面上表明的产品数量。可应用您所需的一切总数,不超过50就可以。
一些模板应用limit
自变量而不是数据来明确每张表明的产品数量。假如您的模板应用limit
自变量,代码将如下所示所显示:
{%paginatecollection.productsbylimit%}
假如您的模板应用limit
自变量,您将要将limit
更换为数据。跟上面一样,这也是将展示在每一个产品系列网页页面上的产品数量,而且该总数不能超过50。小心,将limit自变量更换为数据后,您将没法在模板编辑软件的分页查询设定中变更产品系列网页页面。大家我们建议您不必从模板编辑软件中编写您的模板代码,除非是您没法归档每张需要的产品数量。
点击储存。
更新collection.liquid文档
PC:
在Shopify后台管理中,转到在线商店模板。
寻找要编写的模板,随后点击实际操作编写代码。
在Templates文件目录中,点击collection.liquid
。
在代码编辑软件中,搜索下列代码:
{%paginatecollection.productsby9%}
ios系统:
在Shopify运用中,轻触店铺。
在营销渠道一部分中,轻触在线商店。
轻触Managethemes(管理方法模板)。
寻找要编写的模板,随后点击实际操作编写代码。
在Templates文件目录中,点击collection.liquid
。
在代码编辑软件中,搜索下列代码:
{%paginatecollection.productsby9%}
安卓手机系统:
在Shopify运用中,轻触店铺。
在营销渠道一部分中,轻触在线商店。
轻触Managethemes(管理方法模板)。
寻找要编写的模板,随后点击实际操作编写代码。
在Templates文件目录中,点击collection.liquid
。
在代码编辑软件中,搜索下列代码:
{%paginatecollection.productsby9%}
在上面的例子中,每张的默认设置商品数是9。此总数因模板而异。您必须将此总数更改成您想在产品系列网页页面上表明的产品数量。可应用您所需的一切总数,不超过50就可以。
一些模板应用limit
自变量而不是数据来明确每张表明的产品数量。假如您的模板应用limit
自变量,代码将如下所示所显示:
{%paginatecollection.productsbylimit%}
假如您的模板应用limit
自变量,您将要将limit
更换为数据。跟上面一样,这也是将展示在每一个产品系列网页页面上的产品数量,而且该总数不能超过50。小心,将limit自变量更换为数据后,您将没法在模板编辑软件的分页查询设定中变更产品系列网页页面。大家我们建议您不必从模板编辑软件中编写您的模板代码,除非是您没法归档每张需要的产品数量。
点击储存。
Shopify商家官方网站全文详细信息:
Changethenumberofproductsshownoncollectionpages
Note
IfyouuseafreethemefromShopify,thenyoumightbeabletocontactShopifySupportforhelpwiththistutorial.Itrequires15minutesofdesigntime.Tolearnmore,refertoSupportforthemes.
Note
ThiscustomizationisforvintageShopifythemes,anddoesntapplytoOnlineStore2.0themes.
Findoutyourthemesarchitectureversion
ExploreOnlineStore2.0themecustomizations
Youcanchangethenumberofproductsthatareshownonyourcollectionpages,eitherbymakingchangestoyourthemesettingsinthethemeeditor,orbyeditingyourthemescode.Youcanshowanynumberofproductsyoulike,aslongasyoudontexceedShopifyslimitof50productsperpage.
Checkyourthemesettings
Beforemakingchangestoyourthemecode,gotothethemeeditor.
Fromthedrop-downmenuatthetopofthepage,orfromtheTemplatesmenuonmobile,selectCollectionpages.
ClickCollectionpagesorCollection.
Ifyourthemehassettingsavailabletochangethenumberofproductsthatdisplayoncollectionpages,thenadjustthesettingstofityourneeds.
ClickSave.
Ifyourthemedoesnthavesettingstochangethenumberofproductsthatdisplayperpage,orifthesettingsexistbutaretoolimitedforthechangesthatyouwanttomake,thenfollowthenextstepstoedityourthemescode.
Updatethecollection-template.liquidfile
PC:
FromyourShopifyadmin,gotoOnlineStoreThemes.
Findthethemeyouwanttoedit,andthenclickActionsEditcode.
IntheSectionsdirectory,click
collection-template.liquid
.Inthecodeeditor,findthefollowingcode:
{%paginatecollection.productsby9%}
iPhone:
FromtheShopifyapp,tapStore.
IntheSaleschannelssection,tapOnlineStore.
TapManagethemes.
Findthethemeyouwanttoedit,andthenclickActionsEditcode.
IntheSectionsdirectory,click
collection-template.liquid
.Inthecodeeditor,findthefollowingcode:
{%paginatecollection.productsby9%}
Android:
FromtheShopifyapp,tapStore.
IntheSaleschannelssection,tapOnlineStore.
TapManagethemes.
Findthethemeyouwanttoedit,andthenclickActionsEditcode.
IntheSectionsdirectory,click
collection-template.liquid
.Inthecodeeditor,findthefollowingcode:
{%paginatecollection.productsby9%}
Intheaboveexample,thedefaultnumberofproductsperpageis9.Thisnumbervariesthemetotheme.Youwillneedtochangethisnumbertothenumberofproductsthatyoudliketoshowonyourcollectionpages.Useanynumberyoulike,aslongasitisnotmorethan50.
Somethemesuseavariablecalled
limit
insteadofanumbertodeterminehowmanyproductswillbeshownperpage.Ifyourthemeusesalimit
variable,thecodewilllooklikethis:{%paginatecollection.productsbylimit%}
Ifyourthemeusesa
limit
variable,youwillneedtoreplacelimit
withanumber.Asabove,thisisthenumberofproductsthatwillshowoneachcollectionpage,andthenumbermustnotbemorethan50.Notethatreplacingthelimitvariablewithanumberwillremovetheabilitytomakechangestothecollectionpagespaginationsettingsinthethemeeditor.Werecommendthatyounotedityourthemecodeunlessyouareunabletoachievethedesirednumberofproductsperpageinthethemeeditor.ClickSave.
Updatethecollection.liquidfile
PC:
FromyourShopifyadmin,gotoOnlineStoreThemes.
Findthethemeyouwanttoedit,andthenclickActionsEditcode.
IntheTemplatesdirectory,click
collection.liquid
.Inthecodeeditor,findthefollowingcode:
{%paginatecollection.productsby9%}
iPhone:
FromtheShopifyapp,tapStore.
IntheSaleschannelssection,tapOnlineStore.
TapManagethemes.
Findthethemeyouwanttoedit,andthenclickActionsEditcode.
IntheTemplatesdirectory,click
collection.liquid
.Inthecodeeditor,findthefollowingcode:
{%paginatecollection.productsby9%}
Android:
FromtheShopifyapp,tapStore.
IntheSaleschannelssection,tapOnlineStore.
TapManagethemes.
Findthethemeyouwanttoedit,andthenclickActionsEditcode.
IntheTemplatesdirectory,click
collection.liquid
.Inthecodeeditor,findthefollowingcode:
{%paginatecollection.productsby9%}
Intheaboveexample,thedefaultnumberofproductsperpageis9.Thisnumbervariesthemetotheme.Youwillneedtochangethisnumbertothenumberofproductsthatyoudliketoshowonyourcollectionpages.Useanynumberyoulike,aslongasitisnotmorethan50.
Somethemesuseavariablecalled
limit
insteadofanumbertodeterminehowmanyproductswillbeshownperpage.Ifyourthemeusesalimit
variable,thecodewilllooklikethis:{%paginatecollection.productsbylimit%}
Ifyourthemeusesa
limit
variable,youwillneedtoreplacelimit
withanumber.Asabove,thisisthenumberofproductsthatwillshowoneachcollectionpage,andthenumbermustnotbemorethan50.Notethatreplacingthelimitvariablewithanumberwillremovetheabilitytomakechangestothecollectionpagespaginationsettingsfromthethemeeditor.Werecommendthatyounotedityourthemecodeunlessyouareunabletoachievethedesirednumberofproductsperpagefromthethemeeditor.ClickSave.
文章内容由来:Shopify商户官方网站
部分文章来源于网络,如有侵权,请联系 caihong@youzan.com 删除。