Post by vssoft » Sat Feb 04, 2017 3:55 pm

Hi,

I am using custom theme which is having "Recently View Products" module which shows recently view products by a visitor. Now, I want to show this module on the Empty Cart page. (suppose visitor has not entered yet any products to the cart and visit empty cart page then on that page it will show the Recently View module)

How I can add above mentioned modules by code into the respective files? Please guide.


Thanks

Active Member

Posts

Joined
Mon Jun 15, 2015 2:58 pm

Post by thekrotek » Sat Feb 04, 2017 4:10 pm

You can't without coding. But you can add Recently Viewed module to cart page, which will be display every time visitor opens the cart. Leave it as is, you really don't need to mess with the code, because the whole idea is pretty doubtful.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by vssoft » Sat Feb 04, 2017 8:54 pm

Actually, I want to show Recently Viewed Products only if the Cart is Empty.

I got this idea from other sites which is good one to show recently viewed products by the visitor.Well, if I can add this module on empty cart page it looks pretty to show recently product on empty cart page.

Active Member

Posts

Joined
Mon Jun 15, 2015 2:58 pm

Post by opencartmart » Sun Feb 05, 2017 1:20 pm

You can add a condition for empty cart checking in the module controller. If cart is empty, then proceed to execute module otherwise, return empty string.

Module controller is located on catalog/controller/extensions/module (OC 2.3) OR catalog/controller/module (non OC 2.3). Non-Empty cart checking code look like follows:

Code: Select all

 if ($this->cart->getProducts()) return '';

XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart


Active Member

Posts

Joined
Wed Oct 02, 2013 3:59 am

Post by thekrotek » Sun Feb 05, 2017 1:23 pm

vssoft wrote:Actually, I want to show Recently Viewed Products only if the Cart is Empty.

I got this idea from other sites which is good one to show recently viewed products by the visitor.Well, if I can add this module on empty cart page it looks pretty to show recently product on empty cart page.
So if cart is not empty, page just won't look pretty with this module? :-)

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am

Who is online

Users browsing this forum: No registered users and 54 guests