In the old version 7.0x version, I had several custom imports from vendor data that referenced the ProductVolumeDiscounts collection and objects.
Those are apparently gone in GOLD??? It looks like the ProductVolumeDiscounts has been "replaced" by regular VolumeDiscounts?
If I'm wrong, please correct me.
If I'm right, how would one go about selecting VolumeDiscounts for a specific product?
What happened to ProductVolumeDiscounts?
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: What happened to ProductVolumeDiscounts?
I believe the features are basically the same as they are in AC7, but possibly there has been a change in name. In the ConLib/ProductDiscountsDialog, they are loaded for the product using this method:
IList<VolumeDiscount> availableDiscounts = VolumeDiscountDataSource.GetAvailableDiscounts(_ProductId);
IList<VolumeDiscount> availableDiscounts = VolumeDiscountDataSource.GetAvailableDiscounts(_ProductId);
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: What happened to ProductVolumeDiscounts?
Thanks jmestep, I think that will help in those areas where I needed to get a list of "product volume discounts".
Then it looks like I'll have to make this other change (assuming everything else is setup the same)...
Convert this:
With this:
I haven't tested it yet, but do you see anything wrong with that?
Then it looks like I'll have to make this other change (assuming everything else is setup the same)...
Convert this:
Code: Select all
VolumeDiscount vd = GetVolumeDiscount(_discountAmount, 30);
ProductVolumeDiscount pvd = new ProductVolumeDiscount(p.ProductId, vd.VolumeDiscountId);
pvd.Save();
p.ProductVolumeDiscounts.Add(pvd);
Code: Select all
VolumeDiscount vd = GetVolumeDiscount(_discountAmount, 30);
p.VolumeDiscounts.Add(vd);
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: What happened to ProductVolumeDiscounts?
One thing I notice without testing is that you are not doing a Save() in the second one.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: What happened to ProductVolumeDiscounts?
ProductVolumeDiscount is no longer needed in Gold since Nhibernate can take care of this by itself. This object was used to create a join between a product and discount. This is now being taken care by Nhibernate mappings. This makes code cleaner and meaningful since it abstracts the implementation. Your code will work just liked it worked in past.
Code: Select all
VolumeDiscount vd = GetVolumeDiscount(_discountAmount, 30);
p.VolumeDiscounts.Add(vd);