Discount Coupon Entry not Displaying Opencart

Opencart Cart Version

We have been using opencart Version with a custom template or skin. We found that the skin had some coding that stepped users through the “cart” step of the checkout, directly to the checkout process.

The stops the “voucher or coupon” step being available to the end user during checkout. (Unless they had more than one item in their cart).

The problem appears to be that the template is using the code:

<a href="<?php echo $checkout; ?>"


rather than:

<a href="<?php echo $cart; ?>"


You see the difference is the word “checkout” vs “cart” in this string.

This means that when you click on the:


icon for checkout, you are directed to:

where you need to go to get the coupon option is:


Things to check first

1. Ensure you have added coupon codes!

The first obvious check is to ensure you have added voucher (discount) codes to your storethrough OpenCart’s administration panel, in Sales > Coupons.


2. Ensure Coupons are enabled in OpenCart

Next, we need to check the coupons feature is enabled in OpenCart. In OpenCart 1.5+, this is located in the Extensions > Order Totals menu in the administration panel. Make sure that the Coupons feature is enabled (it should be by default).


3. The Fix

Use a program that will search all files in your website structure looking for the phrase:

<a href="<?php echo $checkout; ?>"

and replace it with

<a href="<?php echo $cart; ?>"


What you will probably find is an error when you then try to proceed from the “Cart” to the correct “Checkout”

We found that the find and replace we did, broke the actual button found here:


But the good news was that the fix is really easy.

If you hover on that link / button you will find that the error message appears that says something like: Undefined Error in (and lists the file) and the line number.

Just open that file, find the correct line number, and replace the word “cart” with “checkout” in that once instance.

The net result being that you are changing all but one of the instance of the <a href="<?php echo $checkout; ?>" string.

Opencart on IIS 7.5 Windows 2008 Server FTP Permissions Changing

Opencart and PHP running on IIS, we found Permissions incorrect on uploaded files

After working with IIS server running PHP, we found the files uploaded through the web interface of the opencart CMS failed to inherit the correct permissions.

After spending weeks time to resolve this problem, believing that it was a glitch that required file permissions to be reset we found an easy solution.

The Problem

The problem lies with the PHP system running on IIS. When you use a web interface to upload files to your PHP CMS website, they are initially loaded to the PHP defined temporary folder. The temporary folder is set in the PHP.ini file.

To find this file and check the setting, you do this:

Open IIS and select PHP Manager



Then Check phpinfo()



Then search the php.ini file that opens for “upload_tmp_dir”

Notice that the default location (unless you have changed it) is: c:\windows\temp


Now navigate to that folder on your IIS server rick click and select Properties / Security Tab and find the IIS_IUSRS security group.


Edit the permissions there to match the permissions of your IIS website folder that is causing you the grief. Probably Read Write at least is needed.

Why the solution works.

As files are uploaded through the website interface, they land in the temp directory. Once there they inherit the temp directory permissions before being moved onto the website folders. By adding the website security to the temp folder, you allow the files to move across with the correct permissions set.

This would be applicable for WordPress running on IIS server, or Opencart.

WordPress 3.5 Manual Fix

Below is the manual fix you can apply to be able to get your WordPress 3.5 install working correctly, there are two options that should work.

1) In the file wp-config.php, add the following line before “That’s all, stop editing”

define( 'WP_TEMP_DIR', ABSPATH . 'wp-content/' );


2) In the file /wp-includes/class-http.php comment out lines 144 and 145, which look like the following:

if ( ! is_writable( dirname( $r['filename'] ) ) )
	return new WP_Error( 'http_request_failed', __( 'Destination directory for file streaming does not exist or is not writable.' ) );

After applying one of the above fixes you should be able to add/upgrade your plugins and upgrade your themes, and will allow you to use the auto upgrade feature when WordPress version 3.5.1 is released.

Opencart – HTTP Error 500.50 – URL Rewrite Module Error 0x80070005 Handler StaticFile


500 – Internal server error.

There is a problem with the resource you are looking for, and it cannot be displayed.


While working with Opencart shopping cart on an IIS server, we encountered this while browsing to a static image file that was uploaded as a website logo file.



The problem turned out to be related to IIS permissions. The folder structure hosting the website needed: IIS_IUSRS(<servername>\IIS_IUSRS) – modify to include Modify permissions.

As per this article:

Once we fixed that the problems all were solved.

Creating a New OpenCart Deployment on a Windows Server IIS

We are going to cover the deployment of an OpenCart (open source shopping cart) on a Windows 2003 Server, 2008 Server.

We are assuming that the server is setup to run IIS websites, and that you have some general idea about running websites in general on IIS. If this is not the case and you are learning from scratch. Better to learn on Linux server.

Assuming you want to get OpenCart running on IIS.


Step 1 – Web Platform Installer

Install the Microsoft Web Platform Installer on the server from this link.

In Windows 2003 you need to:

Go to the directory on your server: C:\php

Find the file: php.ini

Edit the file in a text browser, finding the following lines:




And remove the ; before each line:


Then save the file.

Start a Command Prompt “cmd” and type “iisreset”


This enabled MySQL, GD, and cURL,


Step 2 – Setup PHP on the server.

Start the Web Platform Installer and search PHP in the top right of the search window.

Select and install the latest version of PHP from the list.



Step 3 – Install MySQL on the server.

Also from the Web Platform Installer, search “MySQL” and install that.


During the install, you will be asked for a password for the –root- user. This is the Administrator account and the password should be very well guarded and complex.


Step 4 – Create a Database in MySQL.

Open the My SQL Command Line Tool and enter the –root- password selected above.


Modify the following script to replace the database name, user name and password.

create database mydb;
CREATE USER ‘myuser’@’localhost’ IDENTIFIED BY ‘mypassword‘;
CREATE USER ‘myuser‘@’%’ IDENTIFIED BY ‘mypassword’;
GRANT ALL PRIVILEGES ON mydb.* TO ‘myuser‘@’localhost’;
GRANT ALL PRIVILEGES ON mydb.* TO ‘myuser‘@’%’;

Enter your own values where highlighted above.

Copy and paste that line by line into the MySQL Command Line Window. You only need to run one from the first two, then one from the second two.

If you need to change a password.

SET PASSWORD FOR 'myuser'@'localhost' = PASSWORD('newpass');

SET PASSWORD FOR 'myuser'@'%' = PASSWORD('newpass');



Step 5 – Download and unzip to Web Located Folder the contents of OpenCart

Download here:

The contents of the download package is in a folder called “upload”


Extracted in our case to a folder we called:



Step 6 – Create an IIS instance to hit that directory.

Using the IIS skills that we suggested you should have. Create a new site that hits the directory you dropped the Upload contents to above.


For Windows make sure the following folders and files permissions allow Read and Write.


Step 7 – Set the permissions for IIS.

From the Exploring, Right click the folder with the web files in it, and select Security Tab. Modify the permissions for:

IUSR – Modify (you will probably need to add this)


IIS_IUSRS(<servername>\IIS_IUSRS) – modify



Step 8 – Visit the home page.

Visit the store homepage
e.g. or

Accept the license


Check the permissions you need.


Fill in the following details with the relevant information.


Using the MYSQL database settings you created above.


As per the instruction above, you need to delete the Instillation directory.



Step 9 – Deleted this directory.

Restart IIS from the command prompt again. “iisreset”

Common problem if permissions are not set correctly.