Hi Daniel Thanks for pointing that out. I think this method is not the last one we/OXID could optimize. A few weeks ago I was implementing a price discovery function which gets the price directly from the ERP and was looking for the best place to insert my code. I noticed that methods like assignPrices and others get called quite a bit and wondered if it is really needed so often. I haven't had the chance to investigate so this is only an assumption.
Greetigns from Basel Marc ORCA Services AG Herrenmattstrasse 26 CH-4132 Muttenz Office Basel: Aeschengraben 10, CH-4051 Basel [email protected] T. +41 61 205 80 80 T. +41 61 205 80 73 (direkt) F. +41 61 205 80 81 www.orca.ch, www.orca-services.ch "We convert your visitors into customers." -----Ursprüngliche Nachricht----- Von: [email protected] [mailto:[email protected]] Im Auftrag von Daniel Schlichtholz Gesendet: Dienstag, 27. September 2011 18:07 An: [email protected] Betreff: [oxid-dev-general] Performance patch for oxarticles Hi list, version 4.5.2 CE, file: core/oxarticles.php method _assignPrices, line 3785ff ----------------------- // compute price $dPrice = $this->getPrice()->getBruttoPrice(); $oCur = $myConfig->getActShopCurrencyObject(); //price per unit handling if ((double) $this->oxarticles__oxunitquantity->value && $this->oxarticles__oxunitname->value) { $this->_fPricePerUnit = oxLang::getInstance()->formatCurrency($dPrice / (double) $this->oxarticles__oxunitquantity->value, $oCur); } ---------------------- In most cases $dPrice and $oCur is calculated but not used. We can save that time. Change to: ---------------------- //price per unit handling if ((double) $this->oxarticles__oxunitquantity->value && $this->oxarticles__oxunitname->value) { // compute price $dPrice = $this->getPrice()->getBruttoPrice(); $oCur = $myConfig->getActShopCurrencyObject(); $this->_fPricePerUnit = oxLang::getInstance()->formatCurrency($dPrice / (double) $this->oxarticles__oxunitquantity->value, $oCur); } ---------------------- Best regards, -- Daniel Schlichtholz Mayflower GmbH Pleichertorstraße 2 Tel.: +49 931 359 65 1125 D-97070 Würzburg Fax : +49 931 359 65 28 [email protected] http://www.mayflower.de Mayflower GmbH, Standort Würzburg Firmensitz: Mannhardtstrasse 6, 80538 München Registergericht: Amtsgericht München, HRB 142039 Geschäftsführer: Gregor Streng, Björn Schotte, Albrecht Günther, Johann-Peter Hartmann _______________________________________________ dev-general mailing list [email protected] http://dir.gmane.org/gmane.comp.php.oxid.general _______________________________________________ dev-general mailing list [email protected] http://dir.gmane.org/gmane.comp.php.oxid.general
