Zen Cart Error Message ‘Unauthenticated content’

This Zen Cart tutorial discusses an error message which reads ‘This page contains both secure and nonsecure items. Do you want to display the nonsecure items?’ This error can also read as ‘Page contains unauthenticated content’, or ‘connection partially encrypted’.

This error means that you have hard-coded URLs somewhere in your zen cart, rather than relative paths. This warning can also be triggered if there are banners in your zen cart with ‘http://’ links, which are set so that they will not show on SSL pages. Another cause is click-tracking tools which access your site using javascript, and link to http:// pages elsewhere.

The easiest way to figure out what is causing the problem is to search through your web browser’s View Source page for ‘src=”http://’. Once you find the hard link/s, fo through your template files/stylesheets and remove all the hard-coded links you found.

In the future, you can prevent this error from popping up again by enuring that you never hard-code a full ‘HTTP://’ URL anywhere on your site.

It should also be noted that this error can also be caused by images mentioned in your stylesheet that do not exist. In this case, they will produce ‘404 Not Found’ errors. In turn, these can sometimes create a ‘loop’ while attempting to display a 404-error-page, which often generates more error messages, and compounds the problem. Aside from throwing off a whole lot of error messages, this kind of repetitive loop can create a lot of extra traffic on your hosting account, which can get you into trouble with some web hosts, though this repercussion is highly conditional on what web hosting company owns the servers on which you host your zen cart store.

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

zen cart plus picaflor azul equals success

Zen Cart Shipping Cost Tied to an Attribute

Setting up your zen cart store to handle all of the various shipping situations can be a challenge. If you have complicated shipping set ups, most likely you will need to make some code changes to the zen cart php files. This example will show you how to add custom code to tie shipping cost to a product attribute.

Say, for example that you sell art prints. You sell prints and framed prints. Your framed prints are always Options Name ID (options_id) 1 and Options Values ID (options_values_id) 1. Your shipping set up is:

7 prints and 1 Framed Print the cost would be $8.00 + $22.00 = $30.00
7 prints and 2 Framed Print the cost would be $8.00 + 2 x $22.00 = $52.00
7 prints and 3 Framed Print the cost would be $8.00 + 3 x $22.00 = $74.00

In your favorite plain text editor open the includes/classes/shopping_cart.php file. Be sure to back this file up as it is a zen cart core file, and make a note that you have edited it so that you do not lose your changes in a future upgrade.

Find this:


    return $new_qty;
  }

Add immediately after:


// bof: change $total_count for options_id/options_values_id combo
/**
 * calculate the number of items in a cart based on an attribute option_id and option_values_id combo
 * USAGE:  $chk_attrib_1_16 = $this->in_cart_check_attrib_quantity(1, 16);
 * USAGE:  $chk_attrib_1_16 = $_SESSION['cart']->in_cart_check_attrib_quantity(1, 16);
 *
 * @param float $check_qty
 * @param int $check_option_id
 * @param int $check_option_values_id
 * @param string $message
 */
  function in_cart_check_attrib_quantity($check_option_id, $check_option_values_id) {
    // if nothing is in cart return 0
    if (!is_array($this->contents)) return 0;

    // compute total quantity for match
    $in_cart_check_qty = 0;
    // get products in cart to check
    $chk_products = $this->get_products();
    for ($i=0, $n=sizeof($chk_products); $i<$n; $i++) {
      if (is_array($chk_products[$i]['attributes'])) {
        foreach ($chk_products[$i]['attributes'] as $option => $value) {
          if ($option == $check_option_id && $value == $check_option_values_id) {
  //          echo 'Attribute FOUND FOR $option: ' . $option . ' $value: ' . $value . ' quantity: ' . $chk_products[$i]['quantity'] . '<br /><br />';
            $in_cart_check_qty += $chk_products[$i]['quantity'];
          }
        }
      }
    }
    return $in_cart_check_qty;
  }
// eof: change $total_count for options_id/options_values_id combo

Then open the includes/modules/shipping/table.php file. Find this code:


 function quote($method = '') {
    global $order, $shipping_weight, $shipping_num_boxes, $total_count;

Add immediately after it:


// bof: change $total_count for options_id/options_values_id combo
    $chk_options_id = 20;
    $chk_options_values_id = 72;
    $additional_shipping = 22.00;
    $reduce_count = $_SESSION['cart']->in_cart_check_attrib_quantity($chk_options_id, $chk_options_values_id);
    $total_count = $total_count - $reduce_count;
// eof: change $total_count for options_id/options_values_id combo

In the same file, find this code:


    $this->quotes = array('id' => $this->code,
    'module' => MODULE_SHIPPING_TABLE_TEXT_TITLE . $show_box_weight,
    'methods' => array(array('id' => $this->code,
    'title' => MODULE_SHIPPING_TABLE_TEXT_WAY,
    'cost' => $shipping + (MODULE_SHIPPING_TABLE_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_TABLE_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_TABLE_HANDLING) ) ));

Change it to:


// bof: change $total_count for options_id/options_values_id combo
    $additional_shipping_charge = $reduce_count * $additional_shipping;

    $this->quotes = array('id' => $this->code,
    'module' => MODULE_SHIPPING_TABLE_TEXT_TITLE . $show_box_weight,
    'methods' => array(array('id' => $this->code,
    'title' => MODULE_SHIPPING_TABLE_TEXT_WAY,
    'cost' => $shipping + $additional_shipping_charge + (MODULE_SHIPPING_TABLE_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_TABLE_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_TABLE_HANDLING) ) ));
// eof: change $total_count for options_id/options_values_id combo

    if ($this->tax_class > 0) {

Now, the module will charge the count for Products based on the number of regular Products that are Prints using the Table Rate table settings and for the Framed Prints it will charge $22.00 each.

Be sure to change the values on:


 $chk_options_id = 20;
    $chk_options_values_id = 72;

To match your options_id value and the options_values_id value.

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.

zen cart plus picaflor azul equals success

Zen Cart How to Change Meta Title Comma to Pipe

The zen cart meta title tag for is super important for SEO (search engine optimization). Google uses this tag to determine what a page will be about. By default, zen cart uses a comma in the meta title tag. This Easy Help Zen Cart Tutorial will show you how to change the comma to a pipe or vertical bar.

In your favorite plain text editor, open the includes/languages/YOUR_LANGUAGE/override/meta_tags.php file. If you do not already have an override for this file, copy the includes/languages/YOUR_LANGUAGE/meta_tags.php file to your includes/languages/YOUR_LANGUAGE/override/meta_tags.php to create one.

On or around line 53 change this:


// Define Tertiary Section Output
  define('TERTIARY_SECTION', ', ');

to this:


// Define Tertiary Section Output
  define('TERTIARY_SECTION', ' | ');

Save the file and upload it to your server making sure that you select to overwrite the file already on your server. Navigate to the front of your store, refresh your browser, and see the changes.

If you need help with your zen cart web site, please 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. Did you know that our responsive zen cart designs are optimized for desktops, laptops, portrait and landscape tablets, and portrait and landscape phones. With the ever increasing number of customers who are visiting your site using their mobile devices, responsive design had become a must have. Check your google analytics account to get an idea of what percentage of your customers are visiting using mobile devices and what the bounce rates and conversion rates are for these customers. Having a clean, easy to navigate site that has been optimized for these devices will increase your sales, conversion rates, and customer satisfaction.

zen cart plus picaflor azul equals success

Zen Cart Free Media Mail Shipping Show USPS Upgrade Rates

Your zen cart site offers products which meet media mail shipping requirements. You want to offer free shipping by media mail to all of your zen cart customers for all of your products. You also want to offer regular USPS shipping rates since media mail can take a long time to deliver and you want your customers to have the choice about whether they want to pay extra to upgrade to a faster shipping time, or just select the slower, free media mail shipping. This tutorial will show you how to add custom php code to your zen cart usps shipping module to cater to this situation.

In your favorite plain text editor, open the includes/modules/shipping/usps.php file. Be sure to back up the file and make a note that you have altered it for future upgrades.

Find this, on or around line 566:


$show_hiddenCost = '';

Add this immediately after:


// bof: offer Free Media if total >= 100.00
if ($_SESSION['cart']->total >= 100.00 && preg_match('#(Media Mail)#i', $type_rebuilt)) {
$cost = 0.00;
}
// eof: offer Free Media if total >= 100.00

So you will have this:


$show_hiddenCost = '';
// bof: offer Free Media if total >= 100.00
if ($_SESSION['cart']->total >= 100.00 && preg_match('#(Media Mail)#i', $type_rebuilt)) {
$cost = 0.00;
}
// eof: offer Free Media if total >= 100.00
$methods[] = array('id' => $type_rebuilt,
'title' => $title . $show_hiddenCost,
'cost' => $cost,
);

Save the file, upload it to your server, choosing to overwrite the file already on your server. Add a product to your cart and navigate to your check out page to test the code. You should see the option for free media mail shipping as well as the various options for USPS shipping that you have selected to show.

If you need help with your zen cart project, or need a quote for a customization that is beyond your skill level, contact us for a quote.

zen cart customization

Zen Cart Turn Off Shipping Modules by Testing for Products in Cart

The situation: You sell certain products that you don’t want to ship due to the extreme inconvenience or cost of shipping the product. You want these certain products to have the pick up only option shown at checkout. Or you might have certain products that you only want to show the USPS shipping module at checkout, etc.

One way to accomplish this would be to turn off the shipping modules byflat.php testing for the Products in the shopping cart.

For example, on the Flat Rate flat shipping module you could add the code below to prevent the module from working for products_id 12, 17 and 18.

In your favorite plain text editor, open the includes/modules/shipping/flat.php file.


// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
}

// bof: turn off for various products in the cart
if (!IS_ADMIN_FLAG) {
global $db, $cart;
// check how many products are in the cart for products_id 12, 17, 18
$chk_products = 0;
$chk_products += $_SESSION['cart']->in_cart_check('products_id', '12');
$chk_products += $_SESSION['cart']->in_cart_check('products_id', '17');
$chk_products += $_SESSION['cart']->in_cart_check('products_id', '18');
if ($chk_products > 0) {
// turn off shipping module
$this->enabled = false;
}
}
// eof: turn off for various products in the cart

Save the file and upload it to your server.

This tutorial features the Westminster New responsive zen cart template. It is designed for zen cart version 1.5x and has been released to the community by Picaflor Azul under the GPL licence. Use it for your clients web site, or for your personal zen cart site. The template comes with a neutral, modern color palette. The colors can be easily changed using css and the zen cart stylesheets. If you do not have any experience at all with css and need help matching the template to your logo, contact the professionals at Picaflor Azul for a quote.

If you need help with your zen cart project, or need a quote for a customization that is beyond your skill level, contact us for a quote.

zen cart customization

Zen Cart How to Set a Low Order Fee by Manufacturer?

If you have a zen cart business that offers products or custom products from several different manufacturers, and these manufacturers have different low order fees and thresholds, you will need a way to program this into your zen cart to avoid headaches in order fulfillment. By default, zen cart does not offer this functionality. This tutorial will show you how to program your zen cart to set a low order fee by manufacturer.

In your favorite plain text editor, open the includes/modules/order_total/ot_loworderfee.php file. Be sure to create a back up of this file before you make any modifications, and make a note that this file has been modified in your records as it is a zen cart core file, and you will need to know about this modification for future upgrades.

Replace the whole function process with this new code:


function process() {
global $order, $currencies;

$chk_manufacturers_1_id = 3; // manufacturers_id 3
$chk_manufacturers_1_total = 0;
$chk_manufacturers_1_min = 30.00;
$chk_manufacturers_1_extra = 3.00;

$chk_manufacturers_2_id = 4; // manufacturers_id 4
$chk_manufacturers_2_total = 0;
$chk_manufacturers_2_min = 40.00;
$chk_manufacturers_2_extra = 4.00;

$products = $_SESSION['cart']->get_products();
//echo '<pre>'; echo print_r($products); echo '</pre>';
for ($i=0, $n=sizeof($products); $i<$n; $i++) {
$product_id = $products[$i]['id'];
$ppe = $products[$i]['final_price'];
$ppt = $ppe * $products[$i]['quantity'];
$productsPriceTotal = $ppt + $products[$i]['onetime_charges'];
//echo 'product_id: ' . $product_id . ' $ppt: ' . $ppt . ' qty: ' . $products[$i]['quantity'] . ' $productsPriceTotal: ' . $productsPriceTotal . '
';
if (zen_products_lookup($product_id, 'manufacturers_id') == $chk_manufacturers_1_id && (int)$product_id == (int)$products[$i]['id']) {
$chk_manufacturers_1_total += $productsPriceTotal;
//echo '$chk_manufacturers_1_id: ' . $chk_manufacturers_1_id . ' $product_id: ' . $product_id . ' $chk_manufacturers_1_total: ' . $productsPriceTotal . '
';
}
if (zen_products_lookup($product_id, 'manufacturers_id') == $chk_manufacturers_2_id && (int)$product_id == (int)$products[$i]['id']) {
$chk_manufacturers_2_total += $productsPriceTotal;
//echo '$chk_manufacturers_2_id: ' . $chk_manufacturers_2_id . ' $product_id: ' . $product_id . ' $chk_manufacturers_2_total: ' . $productsPriceTotal . '
';
}
} // end FOR loop
$extra_fee = ($chk_manufacturers_1_total > 0 && $chk_manufacturers_1_total < $chk_manufacturers_1_min ? $chk_manufacturers_1_extra : 0) + ($chk_manufacturers_2_total > 0 && $chk_manufacturers_2_total < $chk_manufacturers_2_min ? $chk_manufacturers_2_extra : 0) if ($extra_fee > 0) {
$tax_address = zen_get_tax_locations();
$tax = zen_get_tax_rate(MODULE_ORDER_TOTAL_LOWORDERFEE_TAX_CLASS, $tax_address['country_id'], $tax_address['zone_id']);
$tax_description = zen_get_tax_description(MODULE_ORDER_TOTAL_LOWORDERFEE_TAX_CLASS, $tax_address['country_id'], $tax_address['zone_id']);

// calculate from flat fee or percentage
$low_order_fee = $extra_fee;

$order->info['tax'] += zen_calculate_tax($low_order_fee, $tax);
$order->info['tax_groups']["$tax_description"] += zen_calculate_tax($low_order_fee, $tax);
$order->info['total'] += $low_order_fee + zen_calculate_tax($low_order_fee, $tax);
if (DISPLAY_PRICE_WITH_TAX == 'true') {
$low_order_fee += zen_calculate_tax($low_order_fee, $tax);
}

$this->output[] = array('title' => $this->title . ':',
'text' => $currencies->format($low_order_fee, true, $order->info['currency'], $order->info['currency_value']),
'value' => $low_order_fee);
}
}

Then set the variables to match your manufacturers_id, minimum, and extra fee for each set. For example:
$chk_manufacturers_1_id = 3; // manufacturers_id 3
$chk_manufacturers_1_total = 0;
$chk_manufacturers_1_min = 30.00;
$chk_manufacturers_1_extra = 3.00;

This would give you manufacturers_id 3, minimum of $30.00 and an extra fee of $3.00.

If you need help with your zen cart project, or need a quote for a customization that is beyond your skill level, contact us for a quote.

zen cart customization

Zen Cart What is CHMOD and What do the Numbers Mean?

When you set up your zen cart store, you will need to set your configure.php files to permissions 444 for security reasons. What does this mean? What does the number 444 signify? This easy help zen cart tutorial will explain what CHMOD is and what the numbers mean.

This tutorial features the Dover Fine free responsive zen cart template. It is released under the GPL, so feel free to use it for your clients or your own zen cart site.

Download the Dover Fine template package here.

dover fine responsive zen cart template
This template is a responsive design and has been optimized for desktops, laptops, landscape and portrait tablets, and landscape and portrait phones. Increasingly, visitors are shopping online using their mobile devices so it is important that your site is optimized for these devices. Don’t lose sales, go responsive today!

A guide to the numbers:

444 = (r– r– r–): owner/group/others are all only able to read the file. They cannot write to it or execute it.
644 = (rw- r– r–): same as 444 except the owner can write to it.
755 = (rwx r-x r-x): owner can read, write and execute the file, members in the user group and others can read and execute the file but cannot write to it.

r = read, w = write and x = execute.

The first group of three characters represents the owner’s level of permission, the second group represents permission for others in the same user group as the owner, and the last group represents the permission for all others (including website visitors).

Permissions are normally set using your web host control panel. They can also be set using the chmod command in many ftp programs.

If you need help with your zen cart project, or need a quote for a customization that is beyond your skill level, contact us for a quote.

zen cart customization

Zen Cart: How to Change the Home Breadcrumb Link

In most circumstances, you will want the “Home” link in your zen cart breadcrumbs to link to the main page of your zen cart. But, if you have occasion to change this link, this tutorial will show you how.

dover fine responsive zen cart template

Our Dover Fine zen cart template comes packed with features.

Dover Fine Responsive Zen Cart Template:

  • Super flexible design perfect for all types of ecommerce stores–the possibilities are endless!
  • Super easy 3 step install!
  • Responsive 2 column, full width layout
  • Optimized Drop Down Navigation for hand held devices
  • Matching CSS icons included
  • CSS Buttons for easier multi language implementation
  • Responsive Full Screen Home Page slideshow included
  • Add your slide show images, set their links, enable/disable images/links, and set open in new window easily, and add captions using the admin banner manager.
  • Add This social bookmarking added to all product pages (includes Facebook like button, Twitter Tweet Button, Pinterest Pin it button, and 300+ Sharing Services)
  • Customized product info page layout
  • Tabbed product description, details, reviews, and a custom tab (ad your content using the banner manager) which converts automatically to accodions on hand held devices
  • Product reviews show on the product info page
  • “View All” option on the product listing pages
  • Cross Browser tested in Firefox, IE11, IE10, IE9, IE8, Google Chrome, Opera, and Safari.
  • Tested on the iPhone 5 with Mobile Safari 6.0; iPad 4 with Mobile Safari 6.0; Windows Phone 8 with IE10 Mobile; Blackberry Bold 9900 with Blackberry Browser 9900; and Android Nexus 4 with Chrome Mobile 18, Dolphin Mobile 9.3, Firefox Mobile 19, Marathon Mobile 4, Opera Mobile 12, Sleipnir Mobile 2.9 , HTC One, Nokia Lumia 920, Google Nexus 7, Apple iPad Mini, Kindle
  • W3C Valid XHTML and CSS
  • Comes with the following modules installed: Column Layout Grid, About Us Page, Back to Top, Bestsellers Thumbnails, Easy Responsive Tabs, DG Reveiws on Product Info Page, Contact Us Add Subject, Supersized Full Screen Slideshow, Flyout Sidebar Category Menu
  • Detailed HTML readme file with written instructions and screenshots, and links to videos for the installation and customization steps.
  • Fully compatible with versions 1.5x.

In your favorite plain text editor, open the file includes/classes/breadcrumb.php. Be sure to back this file up before you edit it as it is a zen cart core file.

Find this line:


$trail_string .= ' <a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . $this->_trail[$i]['title'] . '</a>';

Change this to your new url:


' . HTTP_SERVER . DIR_WS_CATALOG . '

Save the file and upload it to your server. Refresh the page to view your changes.

Zen Cart Templates: Product Links in Account History

The account history page in zen cart is an important page for your customers. It allows them to log into their account and check the status of their orders, view tracking information (if you have this add on functionality installed), view their order history, etc. By default, the product names shown on the account history page are not linked. To encourage customers to leave reviews and to make it easier for them to find products that they have purchased that need reviews, you can customize the account history page of your zen cart template make the product names linked to their product info pages.

In your favorite plain text editor, open the includes/templates/your-template-override/templates/tpl_account_history_default.php file. If this file is not already in your template override directory, create an override for it by copying the includes/templates/template_default/templates/tpl_account_history_default.php to includes/templates/your-template-override/templates/tpl_account_history_default.php.

Find this code:


<td class="accountProductDisplay"><?php echo $order->products[$i]['name'];
if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {

and change it to this:


<?php
// bof: add Product Link to Order History
$products_link = '<a href="' . zen_href_link(zen_get_info_page($order->products[$i]['id']), 'cPath=' . zen_get_generated_category_path_rev(zen_get_products_category_id($order->products[$i]['id'])) . '&products_id=' . $order->products[$i]['id']) . '">' . $order->products[$i]['name'] . '</a>';
?>
<td class="accountProductDisplay"><?php echo $products_link;
// eof: add Product Link to Order History

if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {

Now customers can click through to the product info pages of products directly when they view their order history. This will make leaving product reviews easier and faster.

Zen Cart Templates: How to Customize the Down for Maintenance Page

The default zen cart “Down for Maintenance” page is very generic and may not make the best impression on your customers. With just a little effort, the text and image on this page can be customized to match your zen cart templates. This will look a lot more professional and give your customers the confidence to come back and complete their transaction once your site is back up live again. This zen cart templates tutorial will show you how to customize the down for maintenance page text and image to match your store design.

To complete this tutorial you will need to know how to use a ftp program (filezilla is our favorite), how to use a plain text editor (Notepad++ is our favorite), and how to edit a php file.

zen cart templates

Zen Cart Templates Tutorial: How to Customize the Text and Image on the Down for Maintenance Page

1. In your favorite plain text editor open the includes/langages/english/override/down_for_maintenance.php. This is a php file and must be edited in a plain text editor. If you open this file using an html or wysiwyg editor, it will break the php code and when you upload the file back to your server it will break your zen cart site.

2. This file contains the definitions for all of the Down for Maintenance page text. You can change the navigation bar title, the heading title, the down for maintenance text message, the text for when maintenance will be turned on, the maintenance period, and the verify site status text.

Make your changes to the file but be sure that you keep all of the single quotes in tact. If you need to use an apostrophe or single quote in your text, be sure to escape it or else it will cause a blank page when you copy the file back to your server.

Save the file and upload it to the includes/langages/english/override directory on your server. Be sure to select “overwrite” so that the new file overwrites the one already on your server.

3. To customize the image shown on this page, create your image in your favorite image editing program, name it down_for_maintenance.gif and upload it to the includes/templates/override/images directory on your server.

4. Navigate to your zen cart home page in your browser and click on the “refresh” button.

zen cart templates

If you need help with your zen cart project, or need a quote for a customization that is beyond your skill level, contact us for a quote.

zen cart customization