Displaying Volume Discounts

Terrence Foulk asked on August 26, 2014 22:44

Is there a way I can display volume discounts on my individual product page?

Thanks

Correct Answer

Terrence Foulk answered on July 24, 2015 21:39

Ladislav, thanks for your help, but, currently, I can't make transformations.

Here is how I was able to list the volume discounts.

I added a "Query data source" web part and created the following query

SELECT ##COLUMNS## FROM COM_VolumeDiscount WHERE ##WHERE## ORDER BY ##ORDERBY##

Here are the web part settings:

  • ORDER BY Expression: VolumeDiscountMinCount
  • WHERE condition: VolumeDiscountSKUID = {%NodeSKUID%} AND VolumeDiscountCurrency = {% ECommerceContext.CurrentCurrency.ID |(identity)GlobalAdministrator%}
  • Selected columns: VolumeDiscountMinCount,VolumeDiscountValue

THEN

I added a "Repeater" web part; entered the "Query data source" web part as the "Data source name"; and created a transformation to display VolumeDiscountMinCount and VolumeDiscountValue.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Ladislav Margai answered on September 30, 2014 14:56

Hello Terrence

In your code you can get all volume discounts related to specified product(SKU) by calling this method:

VolumeDiscountInfoProvider.GetVolumeDiscounts(int skuId)

Best regards,

0 votesVote for this answer Mark as a Correct answer

Terrence Foulk answered on October 1, 2014 16:55

Is this for code behind?

I wanted to try displaying the volume discount using a transformation. When I tried your code I got the following error: error CS0103: The name 'VolumeDiscountInfoProvider' does not exist in the current context

0 votesVote for this answer Mark as a Correct answer

Ladislav Margai answered on October 1, 2014 18:13

Hello Terrence,

If you want to use this method in a transformation, you need to create a custom transformation method and call it from there.

https://docs.kentico.com/display/K81/Adding+custom+methods+to+transformations

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.