Page 1 of 1
Show Recently View Products On Empty Cart Page
Posted: Sat Feb 04, 2017 3:55 pm
by vssoft
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
Re: Show Recently View Products On Empty Cart Page
Posted: Sat Feb 04, 2017 4:10 pm
by thekrotek
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.
Re: Show Recently View Products On Empty Cart Page
Posted: Sat Feb 04, 2017 8:54 pm
by vssoft
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.
Re: Show Recently View Products On Empty Cart Page
Posted: Sun Feb 05, 2017 1:20 pm
by opencartmart
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 '';
Re: Show Recently View Products On Empty Cart Page
Posted: Sun Feb 05, 2017 1:23 pm
by thekrotek
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? :-)