How can you add the product name on the OpenCart Download Page?

How can you add the product name on the OpenCart download page? | Knowband

If you are into the eCommerce business, it is sure that you must be familiar with the name of OpenCart as an eCommerce platform. It is one of the fastest growing eCommerce platforms that is a perfect choice for multiple small, medium and large eCommerce stores due to the availability of more than 14,000 OpenCart extensions, themes, integrations, and APIs.

These extensions and other features have made it a delectable platform for various eCommerce stores around the world. However, the platform does not just mean features and functionalities alone without any customer support services. To resolve the issues of its ever growing OpenCart customers, the platform offers the dedicated customer support and technical assistance through community forums.

I have observed a common problem that many site owners have also mentioned on community forum discussions. The issue is that site owners while downloading any virtual products on their OpenCart site are unable to get product name information. The list of all the downloadable virtual products are available on the “Account downloads” page but the names of the downloadable products are not shown to site owners. Due to this scenario, it becomes extremely difficult for OpenCart site owners to know which product has been downloaded or not. To have a better idea about this problem, you need to check out the image shown below:

Opencart download page- Before | Knowband
In the default case, the name of the downloadable product is not shown.

Here, under the “Account Downloads page, the product name is not mentioned which makes it difficult for owners to get proper information about the product which is downloaded. If you want to resolve this problem, here are the few changes that are required in the coding files of your OpenCart site.

1. Site owners need to make required changes in mainly three OpenCart files to display the name of their downloadable products. They need to first search this required file /catalog/view/theme/default/template/account/download.tpl and find out this code as shown below:

<div><b><?php echo $text_remaining; ?></b> <?php echo $download[‘remaining’]; ?></div>

After locating the above statement, it needs to be replaced with the given code:

<div><b><?php echo $text_remaining; ?></b> <?php echo $download[‘remaining’]; ?><br> <b> Product Name:</b> <?php echo $download[‘product_name’]; ?> </div>

2. Once, you are done with making changes in the /catalog/controller/account/download.php file, it is necessary to search this coding,

foreach ($results as $result) {

and then replace it with the PHP coding as shown below.

foreach ($results as $result) {$q_result=$this->db->query(‘SELECT name from ‘.DB_PREFIX.’order_product where order_product_id=’.$result[‘order_product_id’].”);

In the same file, you need to search for this given code,

‘name’ => $result[‘name’],

and then change it with the programming code as shown below,

‘name’ => $result[‘name’],’product_name’=>$q_result->row[‘name’],

3. Finally, you need to make changes in this catalog/model/account/download.php file and then search for the below coding part,

$query = $this->db->query(“SELECT o.order_id, o.date_added, od.order_download_id, od.name, od.filename, od.remaining FROM ” . DB_PREFIX . “order_download od LEFT JOIN `” . DB_PREFIX . “order` o ON (od.order_id = o.order_id) WHERE o.customer_id = ‘” . (int)$this->customer->getId() . “‘ AND o.order_status_id > ‘0’ AND o.order_status_id = ‘” . (int)$this->config->get(‘config_complete_status_id’) . “‘ AND od.remaining > 0 ORDER BY o.date_added DESC LIMIT ” . (int)$start . “,” . (int)$limit);

After locating the above code, you need to replace it with the programming statements as shown below:

$query = $this->db->query(“SELECT od.order_product_id, o.order_id, o.date_added, od.order_download_id, od.name, od.filename, od.remaining FROM ” . DB_PREFIX . “order_download od LEFT JOIN `” . DB_PREFIX . “order` o ON (od.order_id = o.order_id) WHERE o.customer_id = ‘” . (int)$this->customer->getId() . “‘ AND o.order_status_id > ‘0’ AND o.order_status_id = ‘” . (int)$this->config->get(‘config_complete_status_id’) . “‘ AND od.remaining > 0 ORDER BY o.date_added DESC LIMIT ” . (int)$start . “,” . (int)$limit);

Opencart download Page- After | Knowband

By making small changes in the above files, site owners can add the product name on the download page of OpenCart site without any trouble. In case, you want to add any other desired functionality in the OpenCart site, you can add desired OpenCart extensions from Knowband store.

This Would Also Interest You:

Joe Parker

We boast of the best in the industry plugins for eCommerce systems and has years of experience working with eCommerce websites. We provide best plugins for platforms like - Magento, Prestashop, OpenCart and Shopify . We also provide custom module development and customization services for the website and modules..

Leave a Reply

Your email address will not be published. Required fields are marked *