Search for help



Sort products in category by latest in opencart PDF Print E-mail

Go to catalog/controller/product/category.php


Code: Select all
if (isset($this->request->get['sort'])) {
$sort = $this->request->get['sort'];
} else {
$sort = '';

Change to

Code: Select all
if (isset($this->request->get['sort'])) {
$sort = $this->request->get['sort'];
} else {
$sort = 'p.date_added'; //Can also do by p.date_modified


OpenCart Administrator Password Reset tool PDF Print E-mail

After seeing a thread earlier asking how to reset their admin password I thought I'd create a little app that hopefully will be useful when people get stuck. It's taken from my Wordpress admin reset file I made a while back, with just a few tweaks to allow resetting OC passwords - It's actually taken me more time to write this post than to code it

Displaying something other than $0 if no price is given - opencart mod PDF Print E-mail
There is a solution, I don't know whether you'd call it "easy".

In your top level language file (ie. "catalog/language/english/english.php"), insert the following:-
Code: Select all
$_['text_no_price'] = 'Coming Soon';

Then in the following files:-
Welcome Message / Customer Name in Header of opencart PDF Print E-mail

I've had a few requests for this from people who have visited my dev site. Since this is not mine (it's something that was in version 0.7.7), I'm quite happy to post the necessary information to get it working.

You will need to edit the following files:–
* catalog/controller/common/header.php
* catalog/language/english/common/header.php
* catalog/view/theme/default/template/common/header.tpl
* catalog/view/theme/default/stylesheet/stylesheet.css

Basic SEO to kick-start your opencart Online Store PDF Print E-mail

I've launched a new online store using OpenCart and I've been researching ways to improve your website presence and performance on search engines both safely and effectively.

On-Site SEO
1. Home Title (title of your website) should reflect your main keywords

2. Use SEO-friendly URL
[ie - instead of]

How to backup your opencart database using phpmyadmin PDF Print E-mail

First, navigate to your phpMyAdmin page via cPanel or whatever alternative administration system your host provides i.e. Plesk etc. and log in.
From the dropdown box on the left (or the text link) click on your OpenCart database to show all the fields.
In the main page, click on the 'Export' tab.
Make sure the main 'Structure' 'select all' and 'Data' boxes are ticked.
In the right box, make sure 'Add drop table', 'Add AUTO_INCREMENT value' and 'Enclose table and field names with backquotes' are ticked.
select the SQL format in the 'export' column'.
Tick 'Save as file'.

Opencart Multi-Store on Localhost PDF Print E-mail

Create 2 "sub" stores of your main store, called "store_1" and "store_2".

XAMPP for Windows
XAMPP installation directory: C:\xampp
OpenCart Store directory: C:\xampp\htdocs\store
Main Store URL: http://localhost/store

"How To" Videos for OpenCart PDF Print E-mail

OpenCart v1.x Framework Explanation PDF Print E-mail

OpenCart 1.x is a cart application built on top of its own in-house framework. The framework uses an MVC(+L) style design pattern. The +L isn't part of the pattern persay, but it is important to understand the localization and how text for different languages is used:

First off, OpenCart's root directory looks something like this:
admin - the admin directory path is all the code on the front end of your site. This is completely separate from the catalog area and can even be stored on a different host if you prefer.

How to put the Category module in the footer in OpenCart without editing the source code PDF Print E-mail

I’ve been busy setting up a shop recently, but I’ve now started developing themes for OpenCart again. I’ve sorted out the problems with my post on how to add the Information module in the footer in OpenCart and have applied the same technique to add the Category module in the footer in OpenCart without editing the source code.

The principle is exactly the same as listing the Information in the footer. Firstly you need to load the category model. You can then run the getCategories function and output the results.

How to highlight the current category in the header in OpenCart PDF Print E-mail

If you use categories in the header in OpenCart as navigation, it helps with usability to highlight the parent, or top-level category of the page your user is on. Here’s how to list categories and highlight the parent category without any edits to the source code.

Following on from my previous posts about listing categories in the header and listing categories and sub-categories in the header in OpenCart, I thought I’d try to work out how to highlight the top-level category, just to finish the job I’d started.

It turned out to be reasonably easy.

If you are on a category page, or on a product page reached via a category, and you run $this->request->get['path'] it outputs the category path that you see in the URL. For example, if you are on a page with a URL like this:
then $this->request->get['path'] will output “25_28″.

Better search in OpenCart – search product descriptions by default PDF Print E-mail

By default, the search function in OpenCart is pretty limited and only searches product names. In Advanced Search there is an option to Search in product descriptions. Here’s how to make OpenCart search in product descriptions, and in all categories, by default.

If you are running a large shop with thousands of products you don’t want to search the product descriptions by default as it will take a long time. However, if you’ve only got a small or medium-sized shop you can give your visitors a better search experience by enabling search in product description by default.

How to add an AJAX cart in the header in OpenCart PDF Print E-mail

Basically, if you want to display a cart in your  header you can put the following in your header.tpl file:

<div id="cart_in_header">
$cart_number = $this->cart->countProducts();
if ($cart_number == 1) {echo "1 item in shopping cart";}
else {echo $cart_number." items in shopping cart";}
echo"<br />";
echo "Total: ".$this->currency->format($this->cart->getTotal());

What information do I need for UPS shipping in opencart? PDF Print E-mail

Q: What information do I need for UPS shipping?
How to configure UPS shipping module?

The UPS extension uses an online rate lookup. This means it connects to the API that UPS offers to retrieve up-to-the-minute rates directly from their site, and then displays them on your cart during checkout. This ensures customers are paying exactly the right amount.

How does weight-based shipping work in opencart? PDF Print E-mail

Weight based shipping uses your own personal "table" rates to determine the shipping cost.
It allows multiple ranges of rates based on different weights. The format of the weight to cost in the admin area is:
weight:cost, weight:cost, etc

For example if you want to setup the following:
Cart weight 10lbs or less cost $10
Cart weight 11-20lbs cost $15
Cart weight 21-40lbs cost $20
Cart weight more than 40lbs cost $30

read full article here

Sleek Slide Show for OpenCart PDF Print E-mail

Easy add a Slide Show to your OpenCart Store.

- Unlimited number of Slides.
- Each Slide can have it's own Link.
- Links can open in New Window or Existing.
- Choose Fade Duration.
- Choose Slide Duration.

Opencart jquery scroll to top PDF Print E-mail

ome of you may find this useful, especially for larger stores. It's just a very simple jquery scroll to top. As OC as jquery built in it only requires 2 steps.

Before the </body> and after the last div on the footer.tpl (depends on your theme) add:

read full article here

Hide add to cart if price is negative in opencart PDF Print E-mail

How to hide Add to cart if price is negative and show cart if price is >= 0.
If it's equal to 0 must show add to cart.

I've tried this in product.tpl:

<?php if ($price < 0 ) { echo "See related products"; } else { ?>
<div class="content"><?php echo $text_qty; ?>
<input type="text" name="quantity" size="3" value="1" />
<a onclick="$('#product').submit();" id="add_to_cart" class="button"><span><?php echo $button_add_to_cart; ?></span></a></div>
<div><input type="hidden" name="product_id" value="<?php echo $product_id; ?>" />
<?php }?>

jQuery Based Featured Content Slider for opencart PDF Print E-mail

Hello everyone. This is my first Contribution, and it's a small one. I have been playing with OpenCart for a few months now and have finally decided to build and launch a full website based on OpenCart. During my venture building the website so far, I wanted to integrate a Featured Content Slider like you see on my websites such as Crutchfield.Com and others. Being that OpenCart uses jQuery, there are a lot of options for this. I wanted a pretty basic one that would allow for as many images and links as needed and would load everything automatically. The actual script I used and tutorial can be found here: ... jquery-ui/" onclick=";return false;. For the purpose of OpenCart though, I am writing this contribution to help others integrate it.

How to create an opencart module PDF Print E-mail

It is very rare that this will be needed. Even when you think you have to duplicate a module like "flat rate", it is actually best done using one of the zone based options like weight-based or zone plus.

But in any case, for those that are hell bent on duplicating existing sideboxes, payment, or shipping modules. This hi-level breakdown should get you going.

First think of which module you new module is most similar too. In this example, we will make a clone of the "Cash on Delivery" payment module and name it "Cash on Pickup".

How to Speed Up Page Content in opencart PDF Print E-mail

I've been working with a few techniques over the past week to try and speed up the loading time of my site.
Mostly working with Firebug + Google Page Speed.

You can also use:
to test your site too, for some more in-depth stats.

This is to make the user experience better and in anticipation of Google's recent announcement that page-loading-time will take more of a role in search results.

Opencart geozones help PDF Print E-mail

This seems to plague a lot of people so I will try to make some GeoZones for Dummies notes here:

Country - A country entry in in OpenCart'
Zone - a section of the land residing within the country. States, Territories, Provinces that belong to a country
GeoZone - short for "Geographical Zone" and is a group of countries and/or zones that are in a user-defined area.

How is the OpenCart framework structured? PDF Print E-mail

How is OpenCart structured? / How do I add/change content on my site?

OpenCart uses a pseudo MVC architecture. You can learn more about MVC from google, but for OpenCart, the breakdown is like this:

There are 2 halves to OpenCart. "admin" & "catalog". It is pretty clear what each half does. But the best part about it, is that they both have the same functionality and structure. There is also a common file set between them called the "library". Files inside library are used to create the structures and globals needed for the rest of the cart, as well as handle any core functions.

How to exclude some categories when listing categories in the header in OpenCart PDF Print E-mail

In trying to introduce a bit more flexibility into OpenCart I’ve realised that category pages are great for special promotions or themed pages in OpenCart. However, you may not want these promotional pages or themed pages to show up in your main navigation. Here’s how to exclude some categories from the main navigation in your header in OpenCart.

As an example, at this time of year you might have some products that you want to promote for Christmas. You could use a Category page to create a beautiful Christmas page and list your Christmas products there. However, you may prefer to promote this page on your home page with a big splash image and link to it from there, rather than have it appear in your main navigation, which you may want to keep the same all year round.

How to put the Information module in the footer in OpenCart without editing the source code PDF Print E-mail

Not being a programmer, it’s taken me a while, but I’ve started to work out how OpenCart works. So when I decided I wanted to try and put the Information details in the footer without editing any source code it wasn’t too hard.

Firstly you need to load the SEO URL tool (incase people are using SEO URLs, which they should be) and you need to load the Information language module (to allow for different language options). After that you can use the getInformations() function to access most of the Information module.

getInformations() doesn’t include “Contact Us” or “Site Map” for some reason, so you have to add them at the end. Apart from that, it’s pretty straightforward. Here’s the code:

How to list all categories and sub-categories in the header in OpenCart PDF Print E-mail

In an earlier post I detailed how to list categories in the header in OpenCart without changing any of the source files. I’ve now extended the script to list sub-categories.

Basically, the original script looped through all the top-level categories and put them in an unordered list. In this new script I’ve just repeated the loop within each top-level category. It loops through all the sub-categories of the top-level category (if there are any) and puts them in an unordered list too.

Please note that it will only output the top-level, and second-level categories. If you have third- and fourth-level categories you will need to repeat the loop again within each sub-category in order to list them. But, honestly, if you have third- and fourth-level categories in your shop I’d think about restructuring how you’ve ordered it.

How to list categories in the header in OpenCart PDF Print E-mail

I’m working on a one column layout theme for OpenCart. This of course means that there are no sidebars at the left or right hand side so, as well as putting the cart in the header area, I needed to list the top level categories in the header. This is how I did it without editing the OpenCart source code.

Why do I get "Error: No shipping options" when I checkout in opencart? PDF Print E-mail

Q: Why do I get "Error: No shipping options available" when I checkout
Why do I have no shipping options?

"Error: No Shipping options are available" can happen for a few reasons:

  • No shipping modules are enabled or configured
  • Shipping modules are not enabled for the customer geozone. See geozone help
  • Shipping modules that use table rates either aren't set across the range that the product falls into.

read full article here

What information do I need for USPS shipping in opencart? PDF Print E-mail

How to configure USPS shipping module?
The USPS extension uses an online rate lookup. This means it connects to the API that USPS offers to retrieve up-to-the-minute rates directly from their site, and then displays them on your cart during checkout. This ensures customers are paying exactly the right amount.

How to create/clone a Shipping Extension for opencart PDF Print E-mail

Shipping extensions can be created by cloning an existing one that does something similar to what you want.

For Example, If you want to make DHL shipping rates mod using live rate lookup from the DHL site, I would start with the existing UPS shipping extension. If creating a special case scenario based on static table rates, then try cloning the weight based shipping. For this example I will use the UPS files for a new DHL extension.

« StartPrev123NextEnd »

Page 2 of 3