Developer forum

Forum » Templates » Show produtcs with discount

Show produtcs with discount


Reply
Hi,

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

 
Reply
Hi

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
 
Reply
Kristians solution would work, but you would need a list with all products and the product catalog display is limited to 100 products per page. So if you have more than 100 products in your shop, you need another solution.

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
 
António Ramos
Reply

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

 
António Ramos
Reply

bump

 
António Ramos
Reply

bump

 
Mikkel Ricky
Reply
This post has been marked as an answer

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

Votes for this answer: 1
 
António Ramos
Reply

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