The easiest way to find the Opencart version that you are running is to see at the admin footer. Go to your site http://YOUR_URL/admin then see at the footer and you will be able to know which version of opencart it is because most of the programmer did not remove it, so it will be easy to find it out.
If you were not able to find it there then another option is to open the index.php of the root folder and look for
// Version
define('VERSION', '3.0.3.2');
The VERSION is the named constant for the Opencart version, here in the above example it is 3.0.3.2
Similarly, there are other places where we can find the Opencart version. We can also find it out by seeing the coding style also. One of the most changed styles is as below,
Open ../catalog/controller/module/latest.php, look at line 3
If it says: protected function index($module) { then you have 1.5.0.x
If it says: protected function index($setting) { then you have 1.5.1.x
Similarly, you can find out the opencart version, let us know if you are having any issues and we will help you on those.
I love the opencart but I am worried using the fancy box for image enlargement in the product details page, so I think to change the way to show the image enlargement with the use of the color box.
Download the following zip files, upload those files and folders in the root folder like in the image below:
colorbox-in-opencart
Go to the catalog/view/theme/default/template/product.tpl and place the code below, below the <?php echo $header; ?>
<link rel="stylesheet" href="colorbox.css" /> <script src="colorbox/jquery.colorbox.js"></script> <script> $(document).ready(function(){ $(".group1").colorbox({rel:'group1'}); $("#click").click(function(){ $('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here."); return false; }); }); </script>
module for free in opencart, image magnification
Now find “facybox” and replace with the “group1” and save, then bingo, things works.
fancy color box for opencart
Features of ColorBox
Supports photos, grouping, slideshow, ajax, inline, and framed content.
Lightweight: 10KB of JavaScript (less than 5KBs gzipped).
Appearance is controlled through CSS so it can be restyled.
Can be extended with callbacks & event-hooks without altering the source files.
Completely unobtrusive, options are set in the JS and require no changes to existing HTML.
Preloads upcoming images in a photo group.
Find out the example how the colorbox works out as the fancy box with some extra things.
Opencart tips and tricks post which shows you how we can show or insert the “you save” price. For the demo, you can check the site http://www.starpetshub.com/
We have managed to show the You Save in modules as well but we have hard-code it so we have to change in the controller of each module and in the product controller and the category controller. To make it work we have to Edit or insert product >> Click on Special tab >> Add your special price amount >> then Save it. Go to your site and click on the product. You will see a regular and discounted value with the discounted amount and You save as shown in the above image.
First, we are going to show how to insert the “You Save” on the category page.
Find the following line of codes in the catalog/controller/product/category.php
and paste the following code after if (($this->config->get(‘config_customer_price’) && $this->customer->isLogged()) || !$this->config->get(‘config_customer_price’)) {
Now go to the catalog/view/theme/default/template/product/category.tpl and replace the price section and paste the following and things work out in the category page.
insert the ‘save’ => $save, as in the above in the product array.
Now go to the catalog/view/theme/default/template/module/featured.tpl and replace the price section and paste the following and things work out in the category page.
Likewise, you can make the changes in the latest module, category module, special module, make some changes as in the featured module and things will work like in the demo site.
We have not made the language and other settings, for now, we will make the free module for you all till then take care of the above coding style.
the amount that customer saves, right under the price, when there is a special price for the product, shows the amount in an amount that customer saves, customer save modules, You save this module for all modules, discount % or amount of $ right under the picture on front page modules
I used Filezilla 3.5.3 to upload images and files. When i upload the other files it work but when i upload the images then no images are shown in the server but it is working fine in the localhost. After uploading the updates I noticed that images were corrupt. I verified that images worked on my system, uploaded them and tried to view, but nothing.
Then I downloaded the image and tried to view it on my laptop, but the downloaded image was corrupt as well. I finally used the built in Windows Explorer to upload the PNG files and that worked, so I know the issue is in Filezilla.
I have not had this issue in the past with Filezilla.
I finally find out that the file transfer server software, Filezilla have the setting from where there is
I mistakenly set the file transfer type to ASCII by which the images are not uploaded but other files are uploaded. Again setting to the Auto I am now able to transfer the images as well.
This is opencart 2 guides to send an email when reviews are given to the product. Changes to be done in the module’s product.php is shown in the following images
Likewise, we have to change the product.tpl, type the code for the form as per your need
Now to the javascript part of the product.tpl which pass the data to the model and return whether the review is successfully added or not.
We hope you will get it because writing a post and long stories I feel bored just post things that we have done and shown you the logic we used in opencart to send mail to the specified mail.
We have not focused on the languages so sorry for that as well will update this post when we will get the time cheers.
For the up-sell strategy, we can show recommended or related products on the cart page, we show the added related products as per the products in the cart as recommended products for now.
We are confused about whether to show products like the featured products or show the related product in the cart that is related to the products in the cart. Following is the steps of code changes and addition we have done in the Opencart:
For Opencart version 2
Open catalog/view/theme/default/template/checkout/cart.tpl and find <?php echo $content_bottom; ?> and paste following code:
<?php
$this->load->model('catalog/category');
foreach ($products as $product) {
$arrs[] = $results = $this->model_catalog_product->getProductRelated($product['key']);
}
if ($arrs) {
foreach ($arrs as $arr) {
foreach ($arr as $lastarr) {
echo $lastarr['name'];
}
}
}
?>
How the above code works?
$this->load->model(‘catalog/category’);
This will just load the model for retrieving the data from the database.
This lines detect the products in the cart and retrieve the related products as in the cart and keep things in the array $arrs.
if($arrs){
This checks whether there is related products or not, related with the products in the cart.
foreach ($arrs as $arr) { foreach ($arr as $lastarr) { echo $lastarr[‘name’]; } }
This just prints the name of the related products related to the products in the cart. Module and Vqmod will be published soon. Let us know if need any support. Please subscribe to our YouTube Channel for Opencart video tutorials and get lots of other Opencart free modules. You can also find us on Twitter and Facebook also.
I am working as the opencart programmer for 6 months and found out that opencart as the best open source for the e-commerce site. Yet some of the things to be taken into consideration which obviously increases the speed of the opencart sites.
We all know that indexing the table increases the performance of the database so creating the following index really increase the speed in the opencart sites. Run the query below and enjoy some little speed on loading your sites.
ALTER TABLE `category` ADD INDEX ( `parent_id` ) ; ALTER TABLE `category` ADD INDEX ( `top` ) ; ALTER TABLE `category` ADD INDEX ( `sort_order` ) ; ALTER TABLE `category` ADD INDEX ( `status` ) ; ALTER TABLE `option` ADD INDEX ( `sort_order` ) ; ALTER TABLE `option_description` ADD INDEX ( `name` ) ; ALTER TABLE `option_value` ADD INDEX ( `option_id` ) ; ALTER TABLE `option_value_description` ADD INDEX ( `option_id` ) ; ALTER TABLE `order` ADD INDEX ( `customer_id` ) ; ALTER TABLE `product` ADD INDEX ( `model` ) ; ALTER TABLE `product` ADD INDEX ( `sku` ) ; ALTER TABLE `product` ADD INDEX ( `upc` ) ; ALTER TABLE `product` ADD INDEX ( `manufacturer_id` ) ; ALTER TABLE `product` ADD INDEX ( `sort_order` ) ; ALTER TABLE `product` ADD INDEX ( `status` ) ; ALTER TABLE `product_option` ADD INDEX ( `option_id` ) ; ALTER TABLE `product_option_value` ADD INDEX ( `product_option_id` ) ; ALTER TABLE `product_option_value` ADD INDEX ( `product_id` ) ; ALTER TABLE `product_option_value` ADD INDEX ( `option_id` ) ; ALTER TABLE `product_option_value` ADD INDEX ( `option_value_id` ) ; ALTER TABLE `product_tag` ADD INDEX ( `product_id` ) ; ALTER TABLE `product_tag` ADD INDEX ( `tag` ) ; ALTER TABLE `url_alias` ADD INDEX ( `query` ) ; ALTER TABLE `url_alias` ADD INDEX ( `keyword` ) ; ALTER TABLE `user` ADD INDEX ( `username` ) ; ALTER TABLE `user` ADD INDEX ( `password` ) ; ALTER TABLE `user` ADD INDEX ( `email` ) ;
Likewise, we have to remove unnecessary queries which obviously increase the speed of the site.
Queries that can be removed are the category count in the opencart
Use the steps below to remove the category count:
Go to the file: /catalog/controller/module/category.php 1.Search CODE: