Developer forum

Forum » Ecommerce - Standard features » How to make index query to only fetch products with a discount

How to make index query to only fetch products with a discount

Kim Søjborg Pedersen
Reply

Hi,

How can I do that?

Or even better how to make index query to only fetch products with a specific sales discount.. Like "black friday" or "januar sale" and use that to link to your special offer/discount

Regards
Kim


Replies

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Kim,

 

Take a look here https://doc.dynamicweb.com/forum/development/development/filter-by-discount

 

It needs to be developed, since it's not provided out of the box. It may become very complex and difficult.

 

Hope it helps,

Nuno Aguiar

 
Kim Søjborg Pedersen
Reply

Hi Nuno

Thanks for the link.

I can see its impossible to make all the discounts, but I think DW should make the "product discount" as a standard generated field on the index, its should be simple as it sits directly on the product and/or group. Think I will make a feature request on that :)

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Kim,

 

It's not that simple either because you need to consider the conditions. For example, you might have a discount that is only applied to that particular customer and it's even "simple" to determine if a product belongs to a group that is assigned to a discount, but then there are other things the platform needs to consider the cart context:

  • number quantitties of the same or different products
  • order total number
  • customer number on the order
  • user group or user id on the order
  • voucher code (or custom field)
  • ...

 

This means that a product MAY have a discount when added to the cart. Does not tell you for certain that it does. You are probably better off always building that logic yourself and telling the customer the limitations OR creating a checkbox on the product to be flagged (manually, through integration or other logic) if the product has a discount (without the context of an order).

 

Unless DW re-thinks discounts and how they are applied (or you see things differently that allows them to do so), it's probably not going to be implemented :(

 

Hope this makes sense.

 

Best Regards,

Nuno Aguiar

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

Maybe DW should include only Product Discounts that are not conditioned by order amount or quantities.

This way things like "Clearance" or "January discount" will be included.

I agree that sometimes it might be good to mark products that are part of a specific discount campaign but it might be very difficult.

The only thing I can think of is a checkbox on the discount. Something like "Display on product detail".

Adrian

 

You must be logged in to post in the forum