Developer forum
E-mail notifications
Show produtcs with discount
Would it be possible in DW Ecom to get a list of all products that has a discount attatched to it?
I was thinking, to avoid going through all products, that you could e.g. list the products within the "Discounts". But is this possible? Or would I have to create something that goes through all products and then sorts out which ones that has a discount attatched to it?
I'd like to hear if you have any suggestions on how to solve this the best way possible.
Thanks in advance.
/Jannik
Replies
You could use the tag Ecom:Product.HaveDiscount to to only show the products that have a discount.
See: http://templates.dynamicweb.dk/eCommerce/Dynamicweb-eCommerce-template-tags/Product-Catalog/Product-detail/EcomProduct.HaveDiscount.aspx
I guess you would need to implement a custom filter - you can do that with a NotificationSubscriber (ProductList.BeforeSort) or maybe use some of the new features like search filter or related products.
/Morten
Hi guys,
Sorry for unbury this topic but from 2011 to 2014 there is any improved way to do this?
Best regards,
António ramos
bump
bump
This depends much on the kinds of discounts you're using. What kinds of discounts are you using?
Discounts can depend on many things, e.g. if a user is logged in or not and the current time, and therefore Dynamicweb does not provide a list of products with discounts out of the box. But if you discounts are simple (for some vague meaning of "simple") you should be able to build a list of products with discounts by querying the database in the right way.
If you don't have too many products (for some vague meaning of "too many") you can iterate over all the products and find the ones with a discount.
Best regards,
Mikkel
Hi Mikkel,
Thank you for your answer and yes, this kind of discounts are "simple". I will querying the database then with Razor.
Best Regards,
António Ramos
You must be logged in to post in the forum