CS-Cart Customization: Product Downloads Counter

By | 19/09/2013

Notice: This post is aimed at experienced users. It applies to CS-Cart v.3.0.x.

I have already written posts about the CS-Cart shopping cart, here is a new one!

Here is a scenario:

You sell downloadable digital products in your CS-Cart store.

You want to know how many times a user downloaded a file.

You need to keep records of when the customer first and last downloaded the product.

CS-Cart lets you sell digital and downloadable products very easily. It keeps also track of how many times a user “clicked” on the download link (but does not tell you if the file was correctly sent to the user, which might cause an issue if you want to fully refund not-downloaded orders)

Make these modifications to put things in the right way:

1- Edit: <CS-CART_ROOT>/controllers/customer/orders.php

and replace the ‘get_file’ mode block (lignes 403 to 435, may vary upon versions) with the following block:

2- Edit <CS-CART_ROOT>/core/fs.fs.php and change the line 332 (where the fn_get_file function calls the “exit;”) to the following:

These modifications, make sure the file is sent to the user before increasing the download counter.

Now, lets make the download counter visible in your administration panel.

1- Edit <CS-CART_ROOT>/skins/<ACTIVE_ADMIN_SKIN>/admin/views/orders/details.tpl

After line 343, inside the TR tag, add the column header:

Now, after line 354, add the download counter value:

Save your file and refresh your CS-Cart cache by opening your store’s administration panel and then adding &cc to the end of the page url (if you are on the admin index, also add a “?”)

example: https://www.examplestore.com/administration.php?&cc

Now, go to a confirmed/processed order and on the downloads tab you will have:

CS-Cart download counter in administration panel

In the next post, I will write about how to keep track of first and last download times to let you know more about your customers.


Category: E-commerce Tags: ,

About Gi

I love new technologies and try to use them in my everyday life. Since many years ago, I write about these technologies, and provide solutions to the issues people might get using the new world. I tested and experienced the solutions I provide. I love helping people, and that's why my publications have been free until now.

One thought on “CS-Cart Customization: Product Downloads Counter

  1. shahriar rahman

    do you have cs cart gorgeous templates for version 1.3.5? we need 1



Leave a Reply

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

CommentLuv badge