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

Ingo Schmitt mailinglisten at i-schmitt.de
Fri Aug 24 18:48:50 CEST 2007


Hi Franz,

> 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?

In all projects, I was working with similar issues, those to hooks have 
done everything what I wanted to archive for the frontend. But you also 
should have a look in the basic_basket_class and pi2 when adding such an 
article into the basket. Pi2 and the basket checks if the given price 
uid is valid and changes to a valid prive uid, if it's wrong. It always 
adds the item with the normal priceUID the article has, so a change in 
tx_commerce_article price will not work here. You'll also have to use 
the hook:
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/pi2/class.tx_commerce_pi2.php']['postartAddUid']

If you dop have implemented your solution, it would be great if you 
could post here, if those hooks where sufficient for you.

Regards

Ingo
> 
> Thanks.
> 
> -- 
> Kind regards,
> Franz Koch


Mit freundlichen Gruessen
-- 
Ingo Schmitt                        mailto:is at marketing-factory.de
Marketing Factory Consulting GmbH   http://typo3.marketing-factory.de/
Content Management mit Typo3: Beratung - Schulung - Realisierung


More information about the TYPO3-project-commerce mailing list