Zen Cart How to Show a Specific Category if the Shopping Cart is Empty.

Optimizing what displays on the various pages in your zen cart is a good idea and can increase your sales. The empty shopping cart page can be set from the admin to show the new , featured, or specials centerbox. Another way to customize this page would be to shoe products from a specific category. This Easy Help Zen Cart Tutorial will show you how to add custom php code to your zen cart files to shoe a specific category on the empty shopping cart page.

On your favorite plain text editor open the includes/templates/your_template/tpl_shopping_cart_default.php. If there is not already an override for this file, create one by copying the includes/templates/template_default/tpl_shopping_cart_default.php to includes/templates/your_templates_dir/tpl_shopping_cart_default.php.

Find this:


<?php
$show_display_shopping_cart_empty = $db->Execute(SQL_SHOW_SHOPPING_CART_EMPTY);

Add this immediately after:


// bof: force category 3 on empty cart
$new_products_category_id = 3;
$cPath = '3';
// eof: force category on empty cart

So you now have:


<?php
$show_display_shopping_cart_empty = $db->Execute(SQL_SHOW_SHOPPING_CART_EMPTY);

// bof: force category 3 on empty cart
$new_products_category_id = 3;
$cPath = '3';
// eof: force category on empty cart

while (!$show_display_shopping_cart_empty->EOF) {
?>

Now you will see the products listed from category 3 (you can replace this number with your desired category id number) on the empty shopping cart page.

If you need help with your zen cart web siteplease contact us for a quote.

Picaflor Azul specializes in responsive zen cart design. Contact us to convert your current zen cart to a responsive design, or to have a fantastic new custom design made just for your business. There is no better time like now to go responsive. A responsive zen cart design will allow your customers to shop from your site no matter what device they are using. Our responsive designs are optimized for desktops, laptops, landscape and portrait tablets, and landscape and portrait mobile phones.

zen cart plus picaflor azul equals success

Leave a Reply