Hi,

I agree, that usage of oxarticles__oxstock value is incorrect, but value 
returned from oxArticle::checkForStock() is also not a good way to solve the 
problem, as it can be true/false/integer. We will think about more general 
solution for this problem. I’ve added but entry for that 
https://bugs.oxid-esales.com/view.php?id=2623

Thank you for report!

Arvydas Vapsva

From: Kai Gazmaga 
Sent: Wednesday, March 16, 2011 10:54 AM
To: [email protected] 
Subject: [oxid-dev-general] Bug in oxorder->validateStock

Hello,

im writing a module currently and  found a flaw in oxorder->validateStock. When 
it comes to unsufficient stock in the last orderstep an exception is generated. 
After checking stock by 
    $iOnStock = $oProd->checkForStock( $oContent->getAmount(), $dArtStockAmount 
);
in line 1110 
    $oEx->setRemainingAmount( $oProd->oxarticles__oxstock->value ); 
does not use the return-value of checkForStock ($iOnStock).  So it is not 
possible to pass through a value generated in checkForStock, wich I have to do 
in my special case. I now have to overload oxorder and copy the whole function 
only for fixing this.

I do not see any reason, why using the oxarticle-value from the object instead 
of the calculated value of the function, or do I miss something here?

Regards, Kai VektorDesign - Online-Shops und Programmierung 
      Kai Gazmaga 
      Neue Strasse 83 
      89 073 Ulm  Tel.: +49 731 - 3781953 
      Fax: +49 731 - 3781952 
     Mail: [email protected] 
      Web: www.vektordesign.de  





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

Reply via email to