View Issue Details

IDProjectCategoryView StatusLast Update
0002623OXID eShop (all versions)1.03. Basket, checkout processpublic2012-12-10 13:23
Reporterarvydas_vapsva 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version4.4.7 revision 33396 
Target VersionFixed in Version4.5.6 revision 40808 
Summary0002623: Bug in oxorder->validateStock
Descriptionim 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?

-----
after searching and traying for nearly 2.5 hours and beeing close to loosing my mind i posted to the list. NOW I found the solution: I also overload oxbasketitem. If I register oxbasket AFTER oxbasketitem the error occurs. So simply registering oxbasket in the first line of System -> Modules in the backend solves the whole problem.

As happy as I am now with having a solution for this, I still do not really understand it. Each and every class is testet for having overloads when being instantiated. So why does it make any difference in wich position oxbasket is listed in the modules-section???

-----
I agree, that usage of oxarticles__oxstock value is incorrect, but value returned from 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.
TagsOrder
Theme
BrowserAll
PHP Versionany
Database Versionany

Activities

mindaugas.rimgaila

2011-12-19 16:48

reporter   ~0005515

Set remaining stock value to method oxArticle->checkForStock() return value