How to show dynamic shipping price in Magento? -
i have integrated matrix rate module shipping method. got requirement
for showing dynamic shipping prices changing on warehouse options.
for example, have 2 warehouses , b. when user selects warehouse a,
shipping prices should updated accordingly. , same case warehouse b.
i confused how should this?
please help.
i struggling similar requirement. have set shipping rate based on user selection of postage method.
here how proceeding if helps out:
create custom shipping method lets user select warehouse/postage/whatever. shall show in onepagecheckout shipping methods step. can create new shipping method, google out.
put
if($_rate->getcode()=='yourmodule_code')
condition in template/checkout/shipping_method/available.phtml , write code radio buttons user can see. eg. warehouse1 , warehouse2.based on user selection set shipping rate using collectrates() method[which have overridden] of module this
public function collectrates(mage_shipping_model_rate_request $request) { $result = mage::getmodel('shipping/rate_result'); if($show){ $method = mage::getmodel('shipping/rate_result_method'); $method->setcarrier($this->_code); $method->setmethod($this->_code); $method->setcarriertitle($this->getconfigdata('title')); $method->setmethodtitle($this->getconfigdata('name')); $method->setprice($price); //this price can available.phtml using ajax $method->setcost($price); $result->append($method); }else{ $error = mage::getmodel('shipping/rate_result_error'); $error->setcarrier($this->_code); $error->setcarriertitle($this->getconfigdata('name')); $error->seterrormessage($this->getconfigdata('specificerrmsg')); $result->append($error); } return $result; }
hope helps.
Comments
Post a Comment