[TYPO3-commerce] fix discount amount per user - not discount-groups

Franz Koch typo.removeformessage at fx-graefix.de
Fri Aug 24 17:12:03 CEST 2007


Hi list,

I'm setting up a shop for a customer, that will be updated daily from a 
csv-export of my customers management software - so I have to stick to 
the possibilities of my customers software and the data it provides.
So far no problem - but the software of my customer doesn't fit in a 
regular discount handling. The software doesn't allow discount groups, 
but allows a general discount for a user to any discountable article. So 
I have about 12 or 15 different discounts (till now), that can apply to 
any price (even scaled prices). Mapping the different discounts 
dynamically to user_groups is almost impossible, because every price 
would have to be created 12 or 15 times and even more often if the 
article has scaled prices enabled. That would be insane.

So I have to calculate the discounts in a different way. I have to set a 
flag for each article/product, if it is allowed for discounts. If so, I 
have to recalculate the prices depending on the discount the customer has.

I found out, that there are some nice hooks I can use to alter the 
display of the prices in the article display and hopefully also in the 
basket. I'll have to do some revers-lookups to get the flag - but it 
might work.

Is there anything I have to be aware of, when I alter the price inside 
the class 'tx_commerce_article_price' with the hooks 'postpricenet' and 
'postpricegross'? Maybe some dependencies I haven't seen so far, 
something in the checkout-process, the backend-modules or the 
invoice-generation?

Thanks.

--
Kind regards,
Franz Koch


More information about the TYPO3-project-commerce mailing list