0

why Magento manages 'Minimum Qty Allowed in Shopping Cart' in a different way for the simple products and the sons of configurable products?

In particular: in the first case, the product page shows the 'Minimum Qty Allowed in Shopping Cart' in the product counter of 'Add to cart' and in the next page, the checkout page. In the second case, the counter of products in the product page shows '1' and if you try to go to Checkout page, an alert message appears and stops the navigation.

Considering that these situations are embedded in the Core (Catalog Inventory), how can I conform the different behaviors?

1

Solved.

Rewriting a core class method.. in particular 'addProduct($productInfo, $requestInfo=null)' function of Mage_Checkout_Model_Cart class.

I've removed this piece of code:

if ($product->getStockItem()) {
    $minimumQty = $product->getStockItem()->getMinSaleQty();
    //If product was not found in cart and there is set minimal qty for it
    if ($minimumQty && $minimumQty > 0 && $request->getQty() < $minimumQty
        && !$this->getQuote()->hasProductId($productId)
    ){
        $request->setQty($minimumQty);
    }
}

that overrides product quantity inserted by the customer into the cart.

Now the configurable and simple product behavior is similar.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.