0

This is my tablerates.csv, for backend;:

"ITA","*","*",0,7
"ITA","*","*",18,4
"ITA","*","*",75,0

For example, if cart's amount is 66,94 euro, shipping cost is 4.

Anyway, It not works fine. I see that this is the query of Carrier/Tablerate model:

SELECT `shipping_tablerate`.* FROM `shipping_tablerate` WHERE (website_id=1) AND ((dest_country_id = "IT" AND dest_region_id = 260 AND dest_zip = 00018) OR (dest_country_id = "IT" AND dest_region_id = 260 AND dest_zip = '') OR (dest_country_id = "IT" AND dest_region_id = 0 AND dest_zip = '') OR (dest_country_id = "IT" AND dest_region_id = 0 AND dest_zip = 00018) OR (dest_country_id = '0' AND dest_region_id = 0 AND dest_zip = '')) AND (condition_name = "package_value") AND (condition_value <= 66.94) ORDER BY `dest_country_id` DESC, `dest_region_id` DESC, `dest_zip` DESC LIMIT 1

So, it returns only first record, but this isn't the right record: the query not order by condition_value DESC. So, it returns only a first, randomic, row. Why the Magento's developer set the query so? My csv/my purpose (3 range for every country/province) is wrong? Thanks!

1

It does order by condition_value desc, looks like your query is different so implies code was altered.

I checked 1.8.1 and 1.9.0.1 CE and this is whats there:

    $select = $adapter->select()
        ->from($this->getMainTable())
        ->where('website_id = :website_id')
        ->order(array('dest_country_id DESC', 'dest_region_id DESC', 'dest_zip DESC', 'condition_value DESC'))
        ->limit(1);

I'm not aware of issues here. If you need a more powerful tablerate solution look at MatrixRates which is very popular free shipping extn and allows more flexibility (and multiple shipping methods). That definitely works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.