View Issue Details

IDProjectCategoryView StatusLast Update
0000673OXID eShop (all versions)1.03. Basket, checkout processpublic2012-12-10 13:24
Reporterandreas_ziethen Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionduplicate 
Product Version4.0.1.0 revision 15990 
Summary0000673: wrong amount calculation on basket update
Descriptionthe logic behind amount calculation in basket is wrong:

Do the following: create an article with oxstock = 4. Put this article into your basket in shop with amount = 4. Now try to update the amount to "2". This does not work, you stay with 4 and you are not able to change this amount.

Reason:
wrong logic in function setAmount() in class oxbasketitem line 252:
$iOnStock = $oArticle->checkForStock( $dAmount + $this->_dAmount );

For the example above this gives you:
$iOnStock = $oArticle->checkForStock( 2 + 4);

which obviously is wrong. It should check for "2" not for "6".

Solution:
// checking for stock
        if($blOverride)
            $dSumToCheck = $dAmount;
        else
            $dSumToCheck = $dAmount + $this->_dAmount;
        
        
        $iOnStock = $oArticle->checkForStock( $dSumToCheck );
TagsOrder
Theme
Browser
PHP Version5.2.6
Database Version5.0.33

Relationships

duplicate of 0000604 resolvedvilma_liorensaityte wrong behavior in order step1, when trying to buy more product items than there is available 

Activities

dainius.bigelis

2009-03-09 15:22

reporter   ~0000536

Last edited: 2009-03-09 15:38

I cannot reproduce this case from the GUI: when updating article to "2" in described case - it updates successfuly.
Can be fixed together with fix 0000604.
Please check from the source code side, if the problem may exist and fix if needed.