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

Update cart totals
 
kajal
Member
 
Total Posts:  60
Joined:  2010-06-27
 

Hello Everyone,

This post is for the following perticular case :
- If cart sub total is > 20 and <=29.99 than the cart total should be $10
- If cart sub total is > 30 and <=39.99 than the cart total should be $20
...
- If cart sub total is > 100 than the cart total should be the same as it is.

In such a cases you cant apply the shopping cart price rules as these totals are not qty dependent but the subtotal dependant. I have created a plugin for such cases. Kindly download the same from the attachment.

NOTE:
This module is for developers.
To change the conditions(i.e.  If cart sub total is > 20 and <=29.99 than the cart total should be $10 - totals i mean), you would need to look into the observer.php file from the model folder. (Look for the following line of codes :
if($temp_sub >= 25 && $temp_sub <= 39.99) :
$discountAmount = -(18-$temp_sub);
elseif($temp_sub >= 40 && $temp_sub <= 49.99):
$discountAmount = -(25-$temp_sub);
elseif($temp_sub >= 50 && $temp_sub <= 74.99):
$discountAmount = -(36-$temp_sub);
elseif($temp_sub >= 75 && $temp_sub <= 109.99):
$discountAmount = -(50-$temp_sub);
elseif($temp_sub >= 110 && $temp_sub <= 149.00):
$discountAmount = -(75-$temp_sub);
elseif($temp_sub >= 150 && $temp_sub <= 160.00):
$discountAmount = -(10-$temp_sub);
else :
//echo ‘inelse’;
$discountAmount=0;
endif;
). You would need to update your conditions here

I am planning to make this values to be editable from admin but this would take time.

Do let me know if there is anything I can help with.

Hope this helps someone smile

File Attachments
update-cart.zip  (File Size: 4KB - Downloads: 41)
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top