I installed "Shopping Cart Free-Shipping-Qualifier Sidebox Template, " and it works wonderfully. It tells you how much more to add to qualify for free shipping. My problem is, showing the shopping cart in the sidebox reduces my website performance. I want to turn it off, so I want to move the function to my shopping cart page.
I copied and pasted the PHP code into tpl_shopping_cart_default.php in different places, but I can't get it to work. I noticed that variables were different, so I tried to fix it, but I'm not a PHP coder (basically, I don't know what I'm doing). Any help is appreciated!
BTW, the code that's inserted to templates/CUSTOM/sideboxes/tpl_shopping_cart.php is:
PHP Code:
<?php
$free_ship_on = MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING;
if ($free_ship_on == 'true') {
$free_limit = MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER;
if ($_SESSION['cart']->count_contents() > 0) {
$_SESSION['cart']->get_products();
$basket_total = $_SESSION['cart']->show_total();
if ($basket_total < $free_limit) {
$diff_to_free = ($free_limit - $basket_total);
$content .= '<span class="redtext">' . 'Add '. $currencies->format($diff_to_free) .' to your order to qualify for Free Shipping!' . '</span>';
} else {
$content .= '<span class="redtext">' . 'Your order qualifies for Free Shipping!' . '</span>';
}
} else {
$content .= '<span class="redtext">' . 'Free Shipping on orders over ' . $currencies->format($free_limit) . '!' . '</span>';
}
$content .= '<br class="clearBoth" />';
$content .= '<a href="' . zen_href_link(FILENAME_SHIPPING) . '">' . 'Click here for details.' . '</a>';
}
?>
Bookmarks