Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 VP-Cart 8.0 Hint''s and Tips
 Quantity Discounts (Category & Catalog)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jbutt
VP-CART New User

USA
56 Posts

Posted - August 10 2017 :  04:00:35  Show Profile  Reply with Quote
Hi guys,

I ran into a situation where I needed to use a quantity discount for an entire category of products but 1 item needed a different discount pricing. The problem is that in the ''quantitydiscount'' table, if you place the category discount first and then the catalog discount after it would not display the correct discount.

This was being caused by the sql string in the shopfileio.asp file. I added the last line to sort by categoryid. This way, if you did have both, it would list the catalogid first and use it for the calculations.

------------------------------------------------------------------------------------------
lookupsql="* from quantitydiscounts "
lookupsql = lookupsql & " where CatalogId=" & CatalogId
lookupsql = lookupsql & " or categoryid=" & categoryid
if not isnull(quantitygroup) then
''700 - 2010.05.24 - Enhancement: MsSQL with double bytes (utf8) issues
lookupsql = lookupsql & " or groupfordiscount="& sqlserverprefixn &"''" & quantitygroup & "''"
end if
lookupsql = lookupsql & " ORDER BY quantitydiscounts.[categoryid]"
------------------------------------------------------------------------------------------

Hope this helps is someone ever needs to use both.

John

danielrichardson
VP-CART Super User

Australia
276 Posts

Posted - August 10 2017 :  06:37:31  Show Profile  Reply with Quote
hi jbutt, it''s awesome!! I will note. Is it for version 7 or 8?

Go to Top of Page

apswater
VP-CART Super User

444 Posts

Posted - August 11 2017 :  15:11:26  Show Profile  Visit apswater's Homepage  Reply with Quote
Looks good. I imagine you could also add another field in the database to use as a trigger for the item, like "discallowed" and then put an "and isnull(discallowed)" somewhere. I haven''t played with this part yet... Just spit-balling. I have many added fields as triggers so needless to say upgrades are tough for me but i really need the features I add. Thats why I am just now going from 4.5 to 8.


Edited by - apswater on August 11 2017 15:14:30
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00