There is the same bug on Magento 1.6. This fix is working and I hope to work on Magento 1.7 too.
Open app/code/core/Mage/SalesRule/Model/Validator.php
and add below this:
protected $_baseRoundingDeltas = array();
this code:
protected $_address = null;
also in protected function _getAddress
below this:
if ($item instanceof Mage_Sales_Model_Quote_Address_Item) {
$address = $item->getAddress();
add this:
} elseif ($this->_address) {
$address = $this->_address;
and finally in public function reset
above this:
return $this;
add this:
$this->_address = $address;
In this case you need to rewrite the above specified class using your module. You can use this module. I love to call this module as Rkt_CustomerSPTemplateModifier
File : app\etc\modules\Rkt_CustomerSPTemplateModifier.xml
<config>
<modules>
<Rkt_CustomerSPTemplateModifier>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Customer />
</depends>
</Rkt_CustomerSPTemplateModifier>
</modules>
</config>
This file tells to magento that, I am going to include a module Rkt_CustomerSPTemplateModifier
in local code pool and it depends on Mage_Customer
mdoule.
File: app\code\local\Rkt/CustomerSPTemplateModifier/etc/config.xml
<config>
<modules>
<Rkt_CustomerSPTemplateModifier>
<version>1.0.0</version>
</Rkt_CustomerSPTemplateModifier>
</modules>
<global>
<models>
<customer>
<rewrite>
<customer>Rkt_CustomerSPTemplateModifier_Model_Customer</customer>
</rewrite>
</customer>
</models>
</global>
</config>
This configuration tells to magento that, it should use the custom class Rkt_CustomerSPTemplateModifier_Model_Customer
whenever it requires to use Mage_Customer_Model_Customer
.
Now we need to define our custom model class Rkt_CustomerSPTemplateModifier_Model_Customer
. For this.
File : app\code\local\Rkt/CustomerSPTemplateModifier/Model/Customer.php
<?php
/**
* Rewriting core class `Mage_Customer_Model_Customer`
*
* The methods which are defined inside this class will be used prior to those methods which are
* defined inside the class `Mage_Customer_Model_Customer`.
*
*/
class Rkt_CustomerSPTemplateModifier_Model_Customer extends Mage_Customer_Model_Customer
{
/**
* Send email with reset password confirmation link
*
* @return Mage_Customer_Model_Customer
*/
public function sendPasswordResetConfirmationEmail()
{
$storeId = $this->getStoreId();
if (!$storeId) {
$storeId = $this->_getWebsiteStoreId();
}
$customVar = $this->getCustomvar();
$customCollection= Mage::getModel('namespace_extension/customcollection')->load(5);
$this->_sendEmailTemplate(
self::XML_PATH_FORGOT_EMAIL_TEMPLATE, self::XML_PATH_FORGOT_EMAIL_IDENTITY,
array(
'customer' => $this,
'customvar' => $customVar,
'customcollection' => $customCollection
),
$storeId
);
return $this;
}
}
That's it. A tiny module is successfully created. Now clear all caches and then try again.
Best Answer
Actually this is a string saved to object not actual value that you can depend on. Best bet would be to alter the shipping method code to use different label on different rate directly.
you can see where it is genreated and set in code