tealuo, i have find a temporary solution for this works
Here step on details:
1.copy app>code>core>Mage>CatalogInventory>Model>Observer.php
to app>code>local>Mage>CatalogInventory>Model>Observer.php
And goto function checkQuoteItemQty() add below
$county=null;
$country=$quoteItem->getQuote()->getShippingAddress()->getData('country_id');
after
if (!$quoteItem || !$quoteItem->getProductId() || !$quoteItem->getQuote()
|| $quoteItem->getQuote()->getIsSuperMode()) {
return $this;
}
Then in this function change
$result = $stockItem->checkQuoteItemQty($rowQty, $qtyForCheck, $qty);
to
$result = $stockItem->checkQuoteItemQty($rowQty, $qtyForCheck, $qty,$country);
And
from
$result = $stockItem->checkQuoteItemQty($optionQty, $qtyForCheck, $optionValue);
to
$result = $stockItem->checkQuoteItemQty($optionQty, $qtyForCheck, $optionValue,$country);
- copy app>code>core>Mage>CatalogInventory>Model>Stock>Item.php
to app>code>local>Mage>CatalogInventory>Model>Stock>Item.php
edit checkQuoteItemQty
function:
edit below code
if ($this->getMaxSaleQty() && $qty > $this->getMaxSaleQty()) {
$result->setHasError(true)
->setMessage(
Mage::helper('cataloginventory')->__('The maximum quantity allowed for purchase is %s. %s', $this->getMaxSaleQty() * 1,$county_id)
)
->setErrorCode('qty_max')
->setQuoteMessage(Mage::helper('cataloginventory')->__('Some of the products cannot be ordered in requested quantity.'))
->setQuoteMessageIndex('qty');
return $result;
}
To:
if(!is_null($county_id) && $county_id=='IN'){
if ($this->getMaxSaleQty() && $qty > 2) {
$result->setHasError(true)
->setMessage(
Mage::helper('cataloginventory')->__('The maximum quantity allowed for purchase is %s. %s', $this->getMaxSaleQty() * 1,$county_id)
)
->setErrorCode('qty_max')
->setQuoteMessage(Mage::helper('cataloginventory')->__('Some of the products cannot be ordered in requested quantity.'))
->setQuoteMessageIndex('qty');
return $result;
}
}
else{
if ($this->getMaxSaleQty() && $qty > $this->getMaxSaleQty()) {
$result->setHasError(true)
->setMessage(
Mage::helper('cataloginventory')->__('The maximum quantity allowed for purchase is %s. %s', $this->getMaxSaleQty() * 1,$county_id)
)
->setErrorCode('qty_max')
->setQuoteMessage(Mage::helper('cataloginventory')->__('Some of the products cannot be ordered in requested quantity.'))
->setQuoteMessageIndex('qty');
return $result;
}
}
See code
if(!is_null($county_id) && $county_id=='IN'){
means IN=India country code of India,Just change country IN to FR France country code
And see condition if ($this->getMaxSaleQty() && $qty > 2) change 2 to 60
And According to your reference
Magento: limit product max quantity to 1 per order. quantity 2 = 2 orders
make Maximum Allow Qty in Shopping cart to 120
Importnote: this->getProductId() is given product id.