i've been developing website company g7g20.com , interested in creating popular articles or top 10 articles panel , wondering if there way of accessing analytics display this?
we have latest , related , want mix bit. thoughts welcome.
the following code give products sold more 5 units during last 100 days.
{% assign date = globals.site.datenow | date_add: -100, "day" -%} {module_data resource="products" version="v3" fields="id" limit="100" where="\{'orders.units':\{'$gt':'5'\},'orders.createdate':\{'$gt':'{{date}}'\}\}" collection="units"} <pre>{{units|json}}</pre>
you can use product ids , render products
{% item in units.items -%} {module_data resource="catalogproducts" version="v3" limit="1" fields="productid,catalogueid" where="\{'product.id':'{{item.id}}'\}" order="catalogueid" collection="products"} {% item in products.items -%} {% assign catid = {{item.catalogueid}} -%} {% assign proid = {{item.productid}} -%} {module_product,{{catid}},{{proid}}} {% endfor -%} {% endfor -%}
Comments
Post a Comment