User Id:
Password:
Forgot User ID or Password?
     
 
Facebook Twitter Linked In Stumble Upon Digg In
Articles
Database(11)
Desktop Development(3)
Development Lifecycle(2)
Dot Net Nuke(1)
Enterprise Systems(1)
Frameworks & Libraries(0)
General Programming(25)
General Reading(6)
Graphics / Design(10)
Languages(2)
Mentor Resources(0)
Mobile Development(3)
Multimedia(0)
Research Papers(1)
Social Media(1)
Software Engineering(3)
Third Party Products(0)
Web Development(11)
Add a Article
 
Articles

Magento - Enable Free Shipping Promotion Code

The shipping is calculated in the following code (Table Rate method), as every shipping method has its own model:

app/code/core/Mage/Shipping/Model/Carrier/Tablerate.php 

Go to the collectRates method:

if (!empty($rate) && $rate['price'] >= 0) { 
$method = Mage::getModel('shipping/rate_result_method'); 
 
$method->setCarrier('tablerate'); 
$method->setCarrierTitle($this->getConfigData('title')); 
 
$method->setMethod('bestway'); 
$method->setMethodTitle($this->getConfigData('name')); 
 
$shippingPrice = $this->getFinalPriceWithHandlingFee($rate['price']); 
 
$method->setPrice($shippingPrice); 
$method->setCost($rate['cost']); 
 
$result->append($method); 
} 

And change it to:

if (!empty($rate) && $rate['price'] >= 0) { 
$method = Mage::getModel('shipping/rate_result_method'); 
 
$method->setCarrier('tablerate'); 
$method->setCarrierTitle($this->getConfigData('title')); 
 
$method->setMethod('bestway'); 
 
// If the free shipping promo condition is met 
if($request->getFreeShipping() === true) { 
$shippingPrice = '0.00'; // we set the shipping price to zero 
// then we change the method title to indicate shipping is free 
$method->setMethodTitle(Mage::helper('shipping')->__('Free Shipping')); 
} else { // else we continue as normal 
$shippingPrice = $this->getFinalPriceWithHandlingFee($rate['price']); 
$method->setMethodTitle($this->getConfigData('name')); 
} 
 
$method->setPrice($shippingPrice); 
$method->setCost($rate['cost']); 
 
$result->append($method); 
} 

Create promotion code and select “For shipment with matching items” in action area, please see below image for more detail

Average: 5.0000, Total Ratings: 1

 



FAQ Messages  newPost a Message 
There is no message currently

 
Last Updated May 26, 2019 | Advertise | Privacy Policy
Copyright © QAU Programmers, 1999-2019 All Rights Reserved. Terms of Use