Originally Posted by
ryanc44
Here's my very remedial solution. Open your shipping module file located in:
/includes/modules/shipping
In my case I'm using per weight unit shipping, so I'm editing the perweightunit.php file. You want to look for the quote function- in this file starts on line 93.
Lines 97-102 make the initial quote calculation. The best bet is to grab that calculation and wrap the answer in an if/else statement- where you're adding an additional amount to the "quote" if the country is not 223. I haven't quite figured out the proper syntax to do that, so I just wrapped all of line 97-102 into the "if" part of my if/else statement and duplicated those same lines a second time into the "else" part.
I used the conditional that Ajeh supplied andt set it to NOT equal 223 - the code inside that part of the conditional I added the "10" after the handling fee. The else code I left alone. I'm not sure if that makes sense, so here's my hack code:
if ($order->delivery['country']['id'] != 223) {
$this->quotes = array('id' => $this->code,
'module' => MODULE_SHIPPING_PERWEIGHTUNIT_TEXT_TITLE,
'methods' => array(array('id' => $this->code,
'title' => MODULE_SHIPPING_PERWEIGHTUNIT_TEXT_WAY,
'cost' => (MODULE_SHIPPING_PERWEIGHTUNIT_COST * $total_weight_units) + MODULE_SHIPPING_PERWEIGHTUNIT_HANDLING + 10)));
}
else {
$this->quotes = array('id' => $this->code,
'module' => MODULE_SHIPPING_PERWEIGHTUNIT_TEXT_TITLE,
'methods' => array(array('id' => $this->code,
'title' => MODULE_SHIPPING_PERWEIGHTUNIT_TEXT_WAY,
'cost' => (MODULE_SHIPPING_PERWEIGHTUNIT_COST * $total_weight_units) + MODULE_SHIPPING_PERWEIGHTUNIT_HANDLING)));
}
Hope that helps...
Bookmarks