1

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?

2

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:

$_rate->getPrice();
$_rate->getMethodTitle();

Alternately, just check out MagentoConnect:

http://www.magentocommerce.com/magento-connect/catalogsearch/result/?q=product+page+shipping&pl=0

There are a bunch of options available there.

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.