|
I have a pretty easy way to do it :D
how much do you pay for it? im just jocking:
here is how I did…
admin/system/configuration/shipping method
I have enabled only the flat rate… and give the 5 euro for the default amount..
now the client ordered the stuff with 5 eur shipping cost..
you can see his order under the admin/sales/order page right?
now my trick is:
1. STEP
/app/design/adminhtml/default/default/template/sales/order/create/shipping/method/form.phtml
after the third row (<dl class="shipment-methods">)
insert this:
<input id="lol" type="text" style="width: 100px;" /><input type="button" onclick="order.setShippingMethod('12345'+document.getElementById('lol').value)" value="save special shipping price" />
2. STEP
/app/code/core/Mage/Sales/Model/Quote/Address/Total/Shipping.php
find
if ($method) { foreach ($address->getAllShippingRates() as $rate) { if ($rate->getCode()==$method) { $amountPrice = $address->getQuote()->getStore()->convertPrice($rate->getPrice(), false); $address->setShippingAmount($amountPrice); $address->setBaseShippingAmount($rate->getPrice()); $address->setShippingDescription($rate->getCarrierTitle().' - '.$rate->getMethodTitle()); break; } } }
and after that insert:
if (substr($method, 0, 5)=="12345") { $method2="flatrate_flatrate"; foreach ($address->getAllShippingRates() as $rate) { if ($rate->getCode()==$method2) { $amountPrice = $address->getQuote()->getStore()->convertPrice($rate->getPrice(), false); $address->setShippingAmount(str_replace("12345","",$method)); $address->setBaseShippingAmount($rate->getPrice()); $address->setShippingDescription($rate->getCarrierTitle().' - '.$rate->getMethodTitle()); break; } } }
STEP 3-10
no step three-then for hardcoding, thats all…
now if you see the order in the admin
1. go to edit, click yes, that you accept to cancel this order…
2. go to the Shipping Method,
3. click “Get shipping methods and rates”
(then you will see my custom text field and the original flat rate combobox)
4. type into my custom field the amount you want to charge…
5. and click my custom button called: save special shipping price…
thats it :D
Image Attachments
|