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

Customizing automatic shipping method discounts
 
blizzind
Jr. Member
 
Total Posts:  4
Joined:  2013-04-25
 

Hey guys, I’m currently working on trying to set up magento to where I can create automatic shipping discounts for certain shipping methods. FedEx is the only company I ship with, but I have 3 different methods of FedEx. I want to add a discount to 2 of the 3 methods, and display these discounts at the method selection screen automatically at checkout(to make it seem like they are getting a deal with the higher priority shipping I suppose?).  Has anyone ever done this?

I’ve found a few files where I could edit the template file for it, but I think I need to find where the array of 3 methods are produced, and maybe add an if statement to detect which 2 to echo the discount price under? Any help would be awesome, and I’ll definitely write up a tutorial once I figure this out smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
DustinEMiller
Jr. Member
 
Avatar
Total Posts:  23
Joined:  2011-09-14
 

Are you want to apply a percentage discount to the priority quote and then show how much they are saving?

What you probably want to do is look at the model under app->code->Mage->USA->Model->Shipping->Carrier->Fedex and extending the model(s) in your own extension.

 
Magento Community Magento Community
Magento Community
Magento Community
 
blizzind
Jr. Member
 
Total Posts:  4
Joined:  2013-04-25
 

I’m not sure where to even begin with that file to be honest. I tried editing shipping_method.phtml, and bellow this:

<div id="checkout-shipping-method-load">
        
<?php echo $this->getChildHtml('available') . "HIHI"?> 
    
</div>

I tried using an if statement to detect the “2 Day” and “Standard Overnight” text within the div, then insert “Discounted Shipping” bellow the two of them without much success. I would just add discounted shipping to the FEDEX_2_DAY and STANDARD_OVERNIGHT declairation in fedex.php, but then it will be in between the “2 Day” label and the original shipping price.

Image Attachments
problem.png
 
Magento Community Magento Community
Magento Community
Magento Community
 
DustinEMiller
Jr. Member
 
Avatar
Total Posts:  23
Joined:  2011-09-14
 

That line is actually echoing an entire block. You need to look in checkout->onepage->shipping_method->avilable.phmtl and then look for this line

<label for="s_method_<?php echo $_rate->getCode() ?>"><?php echo $this->escapeHtml($_rate->getMethodTitle()) ?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
blizzind
Jr. Member
 
Total Posts:  4
Joined:  2013-04-25
 

Awesome! I ended up getting the discounted price to show up right next to the original one, with the original price crossed out. I guess the only question now is, is the real rate saved in a variable, or is it requested every time its presented? I’m asking this because I can’t have the discounted price presented, but then charge them the regular price once they confirm their order because the original price was put into the database.. I’d rather not have to chase the rate through every file where it is presented, and discount it, but if I have to I will.

 
Magento Community Magento Community
Magento Community
Magento Community
 
blizzind
Jr. Member
 
Total Posts:  4
Joined:  2013-04-25
 

Also, does anyone know what file contains the code for inserting all of the quote information into the database?

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