Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Tire price applicable to cart total and quantity
 
M H Rasel
Jr. Member
 
Total Posts:  10
Joined:  2011-01-28
 

Dear All,
My client want the shop works in such a way that the whole seller will get the tire price (special price) only when they have total 15 product (the sum of the quantity of the all product on the cart) OR the total value of the cart (without tax) is greater than 700.

I failed to solve this requirement with the help of any built in feature of magento 1.4. I have tried that with product tire price, promotion->cart price rules and promotion->shopping cart price rules. But I didn’t find any luck. Finally I have modify the app/code/core/Mage/Catalog/Modal/Product/Type/Price.php
I modify the function _applyTierPrice()

Here is the modified function:

protected function _applyTierPrice($product$qty$finalPrice)
    
{
        
if (is_null($qty)) {
            
return $finalPrice;
        
}

        
/**
        * Modify to maintain the special dealer price 
        * 
        * Modified by M H Rasel
        */
        
$quote Mage::getSingleton('checkout/cart');
        
        
$total 0;
        
$item_count 0;

        foreach (
$quote->getQuote()->getAllItems() as $item
        
{
            $_product 
$item->getProduct() ;
            
$total += (double)$_product->getData('price')* $item->getQty();
            
$item_count +=$item->getQty();
        
}
        $total 
+= (double)$finalPrice*(double)$qty;
        
$item_count +=(double)$qty;
        
        if(
$item_count>15 || $total>700)
            
$tierPrice  $product->getTierPrice($qty);
        else
            
$tierPrice  $finalPrice;
        
/**
        * Modify end    
        */
        
if (is_numeric($tierPrice)) {
            $finalPrice 
min($finalPrice$tierPrice);
        
}
        
return $finalPrice;
    
}

I want your comments about this work. I am a novice of magneto and this is my first shop prepare with Magento. So if this will make any problem then it will be a great help if you let me know about this.

 
Magento Community Magento Community
Magento Community
Magento Community
 
tzyganu
Mentor
 
Avatar
Total Posts:  2205
Joined:  2009-11-18
Bucharest, Romania
 

Did you try to use shopping cart price rules?
I think you can create a rule that looks something like this:

If ANY of these conditions are TRUE :
* Total Items Quantity equals or greater than 15
* Subtotal equals or greater than 700

If the conditions are met you can give a discount to the customer.
It’s safer this way.

 
Magento Community Magento Community
Magento Community
Magento Community
 
M H Rasel
Jr. Member
 
Total Posts:  10
Joined:  2011-01-28
 

Yap I tried. But this option allow me to put a discount on some percentage. But in my case each product have some different price (tire price) but that tire price is applicable based on the shopping total. On the other hand normal tire product can be applied based on individual product order quantity. For example item A have price $250 for all user. but for whole seller the price is $155.5. and for item B, all user price is $75 and whole seller price is $32.7. But the whole seller price is applicable only when he order either total $700 (with any combination of item A or item B) or total order quantity is greater then 15 (again any combination or item A and item B).

Is there really any way to implement this without any coding on class file?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top