Domanda

My goal is to override returned UPS rates in the one page checkout, Magento 1.5.

I viewed the js console to find out what template to modify, I have copied it over into my local theme and am making edits (confirmed I am on the correct file by dumping vars).

The file is: /app/design/frontend/default/mytheme/template/checkout/onepage/shipping_method/available.phtml

I see where the rate is being set with the $_incl var:

<?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>

I need to modify the rate based on some business rules (e.g. If rate is between 0 and 100, add $5. If rate between 101 and 200, add $10, etc etc). -- That's working great and I can confirm the rate is being modified by dumping the new value.

The Problem:

When I submit the form (go to the next step), my modified rate is not being saved and the standard rate is. So I'm missing something crucial (and probably very basic). Can someone point me in the right direction?

edit: I see when I click the "Continue" button (to move away from shipping method step to the payment method step) this is being ran:

I'm guessing the answer is found wherever this template is posting to. Problem is I can't find it.

È stato utile?

Soluzione 2

After looking high and low and modifying nearly every single template I could find, nothing worked.

I ended up going with a plugin called "Handling Fees Matrix" which lets you modify the real time rates. http://wiki.webshopapps.com/extensions/handling-matrix

Altri suggerimenti

You're simply replacing the value returned by the getShippingPrice function. You need to edit this function so that it returns the modified rate instead of adjusting the value of $_incl.

Alternatively, you could adjust the UPS rates module so after it makes the rate request it adds the markups.

Perhaps even easier, this module should do the trick.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top