Hi everyone,
I am trying to make a pricing-methode work, picture this:
- I have one product called "kalf"
- I have 3 prices for that product based on the qty:
> 1 kilo meat for: $9.95
> (when you buy more than) 5 kilo meat for: $7,50 (a kilo)
> (when you buy more than) 10 kilo meat for: $5,00 (a kilo)
- [ qty ]
- I'v also made 3 atributes (atribute name "price per"):
> "1 Kilo"
> "5 kilo"
> "10 kilo"
What I want is when a customer enters the qty, the price wil be calculated as above (without the customer selecting an atribute) , but I just can't find out how to to do that exactly. I've searched the forums etc. and I came up with the folliwing:
By using the Custom Price Calculation based on the atributes (the 3 prices)
It would look something like this (i am new to php, so i am trying)
if($item->qty > 0) {
$item->price = [sell_price] == ??[price_per] [1kilo]??;
}
if($item->qty > 5) {
$item->price = [sell_price] == ??[price_per] [5kilo]??;
}
if($item->qty > 10) {
$item->price = [sell_price] == ??[price_per] [10kilo]??;
}
By doing it like this my client doesn't need to change the code but simply edit the atibutes settings per product.
Oh.. I also used the token module, but I don't have any experience with it.
If someone could help me out litle...
Pieter




Joined: 03/20/2008