[ic] Price breaks by weight
frank at goldissue.com
Tue Jan 9 23:26:10 EST 2007
Kevin Walsh wrote:
>Josh Lavin <josh at myprivacy.ca> wrote:
>>I've got an interesting price break routine to solve. My client wants
>>to have price breaks by weight, but with a mix-and-match across all
>>the items in a prod_group.
>>E.g.: buy 5 lbs = 5% off of each item, buy 10 lbs = 10% off of each item
>>I'm at a loss on how to do this with CommonAdjust.
>>What I really need is the quantity pricing to work the same way, but
>>with weight instead. Of course, we then would have to enter the same
>>break for each item, so if there was a simpler method, it'd be nice.
>I'd define a UserTag which would calculate the price break applicable
>to each item, while taking product groups into consideration. The
>UserTag would be called as a CommonAdjust atom, of course.
>Thought of the day: Hmmmmm... errrr... oh... ah ha!
I had to offer discounts by weight for the first time one month ago. As
was the case also for software downloads, it was hard to find a working
model anywhere, a little hard to understand the documentation, and
usually what I end up doing is seaching on google, and then I find some
code written by Mike Heins which works immediately. :)
Well I think in this case I just had to experiement a bit, and I can't
say I have mastered it as I have been too busy. In any case if I want to
get discounts working with quantity pricing it would require more effort
on my part (I tried to get discounts and sale price working universally
throughout all my sites from the beginning - but it breaks when I use
quantity pricing, so I sacrificed sale price which we never use, and had
to modify a few pages accordingly).
So even though I may not understand your question exactly, it appears
that you are looking for what I have done, so I shall simply post all
So this lady in New Guinea wanted a discount on flax seeds. I offered
her a discount for purchasing 10 kg or more, with additional savings
over 20 kg. This was done by quantity, as the unit purchase was 1kg.
(yea we use mksa units downunder thank God)
This is the item:
Now I had trouble working out what I had done, but I have spent a half
hour checking what appears to make it work (just for you big Josh). I
found that this entry in etc/after.cfg is required, although it appears
neither at the beginning nor at the end of the various profiles I see:
Profile melrose <<EOR
CommonAdjust => <<EOF,
NonTaxableField => 'nontaxable',
The melrose (brand name) doesn't appear to equate to anything else I see
anywhere so I'm guessing it could be called anything. I think that I
have just found the final component, and that is this line in pricing.txt:
658 general 3.50 3.50 3.00 2.85 2.80
As mentioned earlier I had to modify the code on the flypage, cart,
checkout, recept.html and receipt. From memory all I did was removed
(disable sale_price) as it produced inconsistent results. It is quite
likely that this could be fixed if required.
Feel free to contact me for specific questions,
More information about the interchange-users