Render Product Attributes using liquid in Collection
hi there
ok have small products list rendering in bc e-cmmerce site ok using collection
{module_data resource="{{resource}}" skip="{{skip}}" limit="{{limit}}" where="\{'catalogs.catalogueid':'{{globals.get.catalogueid}}'\}" order="weight" collection="products" version="v3" fields="id,siteid,name,roleid,weight,productcode,unittype,smallimage,largeimage,descripti on,inventorycontrol,canpreorder,minunits,maxunits,instock,onorder,reorder,reordernotified, variablepercycle,groupingid,groupingdefault,electronicproduct,displayfilename,size,downloa dlimitcount,downloadlimitip,productweight,productvolume,productheight,productdepth,supplie rentityid,suppliercommission,isgiftvoucher,poplets,attributes,custom1,custom2,custom3,cust om4,releasedate,expirydate,createdate,lastupdatedate,capturedetails,isonsale,hideifnostock ,enabledropshipping,excludefromsearch,enabled,deleted,title,reindex,hasattributes,cycletyp ecount,hasvariations,slug,metaproductdescription,canonicalurl,absolutecanonicalurl" template="/layouts/onlineshop/small_product.tpl"}
and works fine in seperate .tpl file:
{% product in this.items -%} {% endfor %}
however want render product attributes small product layout in form can cannot seem working. can working in large product layout (using code below) bot small layout
{module_product catalogid="{{catalogid}}" productid="{{id}}" render="collection" skip="0" limit="1" collection="product" template=""} {% if this.name contains 'other print' -%} {% item in product.attributes %} {% item2 in item[1] %} {% if item2.name != '1' -%} {{item2.price}} {% else -%} {% endif -%} {% endfor %} {% endfor %} {% else -%} {% item in product.attributes %} {% item2 in item[1] %} {% if item2.name == '1' -%} {{item2.price}} {% else -%} {% endif -%} {% endfor %} {% endfor %} {% endif -%}
anybody got idea how can render product attributes in small product layouts? apologies not programmer , liquid coding basic hoping getting attributes might not difficult.
many thanks
malcolm
may ask why using module_data in product layout outputs product information?
just place:
<script>console.log({{this|json}});</script>
in small product layout , view console.
More discussions in eCommerce
adobe
Comments
Post a Comment