Hi Linas

Thank you for your ideas.
In the mean time I found a solution which works for me.

I overrode oxBasket._calcItemsPrice() in which I call the parent method but 
added a foreach which loops all basket items and checks for the discount codes.
With them I build a simple array tree in which I accumulate the amount of each 
article which has the same discount code.

At the end I call the already overridden oxArticle. _getAmountPrice($Amount) 
with the  accumulated amount for each article which gives me back the price 
from the ERP of our customer minus discount.

If there is someone interested in more details please write me directly.

Sunny Greetz from Basel
Marc

ORCA Services AG
Herrenmattstrasse 26
CH-4132 Muttenz
Office Basel: Aeschengraben 10, CH-4051 Basel

[email protected]<mailto:[email protected]>
T. +41 61 205 80 80
T. +41 61 205 80 73 (direkt)
F. +41 61 205 80 81

www.orca.ch<http://www.orca.ch>, 
www.orca-services.ch<http://www.orca-services.ch>

"We convert your visitors into customers."
________________________________
Von: [email protected] 
[mailto:[email protected]] Im Auftrag von Linas Kukulskis
Gesendet: Donnerstag, 28. Juli 2011 15:25
An: [email protected]
Betreff: Re: [oxid-dev-general] Applying Assorted discount

Hi,

What's you need it's to look at these class in core dir: oxBasket, oxDiscount, 
oxDiscountList.
Analize these classes looking at methods like: getDiscount(), 
getArticleDiscounts() and etc.
Maybe you find that it's already done what you need, if not you will override 
some method or will write new ones.
Also you can find some answers in public source code documentation: 
http://docu.oxid-esales.com/CE/sourcecodedocumentation/


Linas Kukulskis
Developer

[email protected]<mailto:[email protected]>
Phone +370 37 333053
Fax +370 37 333054
www.oxid-esales.com<http://www.oxid-esales.com/?campaign=emailsignatur/lt/oxid-esales-com>


OXID eSales AG
Bertoldstraße 48, 79098 Freiburg, Germany

Lithuanian Division
K. Petrausko g. 26-316, Kaunas LT-44158, Lithuania


Sales tax identification number: DE 231 450 866
Board of directors authorized to represent the company:
Roland Fesenmayr (chairman), Eric Jankowfsky, Andrea Seeger
Chairman of the supervisory board: Harald Fuchs
Head office Freiburg: Bertoldstraße 48, 79098 Freiburg, Germany
Court of registration: Amtsgericht Freiburg i. Br., HRB 701648, Office 
reference number: 06/447/41949

[http://www.oxid-esales.com/signatur/oxid-eshop-4-signatur.jpg]<http://www.oxid-esales.com/en/products/professional-edition?campaign=emailsignatur/lt/oxid-eshop-4>
The next Generation of Premium 
eCommerce<http://www.oxid-esales.com/en/products/professional-edition?campaign=emailsignatur/lt/oxid-eshop-4>

[http://www.oxid-esales.com/signatur/oxid-eshop-community-edition-signatur.jpg]<http://www.oxid-esales.com/en/products/community-edition?campaign=emailsignatur/lt/oxid-eshop-ce>
Latest version OXID eShop 4 as open 
source<http://www.oxid-esales.com/en/products/community-edition?campaign=emailsignatur/lt/oxid-eshop-ce>

________________________________
From: [email protected] 
[[email protected]] on behalf of development 
[[email protected]]
Sent: Thursday, July 21, 2011 7:54 PM
To: [email protected]
Subject: [oxid-dev-general] Applying Assorted discount
Hey guys

I'm currently thinking about how to implement an "assorted discount" 
(Assortiert-Rabatt) how our customer calls it.

The idea behind is that their customers get a discount if they buy a certain 
amount of items throughout several products of the same group (grouped by a 
special code).
It's not much more than graduated prices (Staffelpreise).
So if a customer buys 5 different products which 3 of them have the same 
assorted discount code their amount should be accumulated and the resulting 
price should be applied to all products.

I've already added the special code field to oxarticle which get's filled 
properly by the ERP interface.

But what I'm currently looking for is which class and what method(s) to 
overload to get the best result (not recalculating too much but having always 
the right result).

Many thanks
Marc

ORCA Services AG
Herrenmattstrasse 26
CH-4132 Muttenz
Office Basel: Aeschengraben 10, CH-4051 Basel

[email protected]<mailto:[email protected]>
T. +41 61 205 80 80
T. +41 61 205 80 73 (direkt)
F. +41 61 205 80 81

www.orca.ch<http://www.orca.ch>, 
www.orca-services.ch<http://www.orca-services.ch>

"We convert your visitors into customers."

_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general

Reply via email to