Originally Posted by
MeltDown
OK, here's what I did to force the shipping estimator to display only when logged in: In includes/templates/your_template/templates/tpl_shopping_cart_default.php at around line 180, I changed this:
PHP Code:
<?php
break;
case (SHOW_SHIPPING_ESTIMATOR_BUTTON == '2'):
To this:
PHP Code:
<?php
break;
case ($_SESSION['customer_id'] > 0 && SHOW_SHIPPING_ESTIMATOR_BUTTON == '2'):
My setting in admin/configuration/Shipping/Packaging/Shipping Estimator Display Settings for Shopping Cart is set to option "2".
Also, in define_shopping_cart.php I added the following text:
This looks to be working well. Thanks again for your help!!
I know it's an old post now but I didn't want to sacrifice the shipping estimator for non-logged-in customers. Instead, I combined the above solution with the original suggestion of using $order->info['total'] instead of $order->info['subtotal'].
'total' works fine when not logged in whereas 'subtotal' is blank.
However, when logged in, 'total' includes the cost of any selected shipping option while 'subtotal' is correct.
My solution - in the constructor and quote functions:
PHP Code:
$order_value = $_SESSION['customer_id'] > 0 ? $order->info['subtotal'] : $order->info['total'];
Then substitute $order_value for each reference to $order->info['subtotal'].
It works well for me and my customers and they can see the shipping cost before they log in or create an account.
Bookmarks