Apply base shipping cost for all orders to show in header_minicart
-
12-12-2019 - |
Question
I am looking for a way if possible to apply a base shipping cost to all orders that will display in the mini cart in the header then when the customer goes to checkout they can get a more accurate shipping estimate using the normal functions.
Firstly is this possible
Secondly if it is would any one know where I could start.
Used the answer below with this in /checkout/cart/minicart/items.phtml around line 82;
<?php
$totals = Mage::getSingleton('checkout/session')->getQuote()->getTotals(); //Total object
$grandtotal = $totals["grand_total"]->getValue(); //Grandtotal value
echo $formattedPrice = Mage::helper('core')->currency($grandtotal , true, false);
?>
my header now displays subtotal and an estimated grandtotal.
Solution
What you want is to apply a default destination to a new quote, so that Magento thinks it will be shipped there and thus show shipping costs to that location. Luckily there's a small extension that does just that: http://www.rapidcommerce.eu/blog/2012/04/allways-show-shipping-costs-in-magento/ (note the updated version, it's still working on newer versions of Magento even though it was released in '12).
You can find the settings in the configuration under Shipping Settings.