i'm using table rates to calculate the shipping costs for our products. Now i would like to show the shipping costs on the product page. Does anybody know an extension or solution therefore? Point would be, that the people would have to do type in their zip code on the product page, before the shipping costs could be calculated. Idea?
Here's a sneak peak at the controller code you'd have. The design is up to you, you'd parse through the details using POST:
$quote = Mage::getModel('sales/quote')->setStoreId(Mage::app()->getStore('default')->getId()); $product = Mage::getModel('catalog/product')->load($productId); $quote->addProduct($product, $qty); $quote->getShippingAddress()->setCountryId($countryId)->setPostcode($postal); $quote->getShippingAddress()->collectTotals(); $quote->getShippingAddress()->setCollectShippingRates(true); $quote->getShippingAddress()->collectShippingRates(); $_rates = $quote->getShippingAddress()->getShippingRatesCollection();
Then, on your $_rates object, you can:
Alternately, just check out MagentoConnect:
There are a bunch of options available there.