Post by virtualgadjo » Thu Dec 21, 2017 9:52 pm

Hi all,

first message for me here so, glad to meet you :)

i'm running into a funny little issue, when i click on en empty category or run a search with no result, it's always the language/common/cart.php text_empty string that is displayed instead of the product/category.php or the search.php one
in order to be sure i've replaced the original string by a personal one i can't miss

if any of you had an idea that would help solve this, i would be lifelong grateful :)
all the best
chris
Last edited by virtualgadjo on Fri Dec 22, 2017 1:09 am, edited 1 time in total.

Newbie

Posts

Joined
Wed Dec 13, 2017 4:45 pm

Post by straightlight » Thu Dec 21, 2017 11:38 pm

Since it is your first post, it is understandable. Although, you need to post your 4 decimals OC version when creating a new post. In this case, the steps you did in order to obtain the text_empty results would be needed as well as the route location (?route=xxxxx) on your platform to provide an accurate solution.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by virtualgadjo » Fri Dec 22, 2017 12:38 am

Hi straightlight,

thanks a lot for your answer and, you know, as soon as i clicked on submit, i slapped my head and was waiting for my post to appear to add "sorry guys, forgot to say, using the very last opencart release (3.0.2.0)"

i talked a little with the great guys behind journal2 to see if they had any insight about this but having investigated a bit they ended thinking like i was that it must be an opencart issue

the website is currently local and i use extensively url_rewriting but i could easily reproduce the problem with, for example
route=product/manufacturer/info&manufacturer_id=8 (no products for this manufacturer)
or
route=product/search&search=toto&description=true (of course, no result for toto in the search field)
same for
guitares-acoustiques/guitares-acoustiques-occasions for example with url rewriting which routes to category_id=67 that has no products (yet :))

actually whichever page that has no product in it displays the cart.php text_epty string instead of the category/search/ and so on text_empty one, funny isn't it? :)

thanks again for your time and answer
all the best
chris

Newbie

Posts

Joined
Wed Dec 13, 2017 4:45 pm

Post by straightlight » Fri Dec 22, 2017 12:43 am

actually whichever page that has no product in it displays the cart.php text_epty string instead of the category/search/ and so on text_empty one, funny isn't it?
As funny as trying this already working solution here: viewtopic.php?f=202&t=187159&p=704301#p704140

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by virtualgadjo » Fri Dec 22, 2017 1:00 am

Hi again,

and now to say that those great guys i talked about above that are behind journal2 theme found out the solution, it's an opencart little issue
in case it helps anybody else, solved by adding

Code: Select all

$data['text_empty'] = $this->language->get('text_empty');
before

Code: Select all

$data['breadcrumbs'] = array();
in the catalog/product/controller/category.php, search.php, special.php and manufacturers controllers (refreshing opencart modification afterwards)

have a great day and thanks again for having taken time to answer :)
all the best
chris

Newbie

Posts

Joined
Wed Dec 13, 2017 4:45 pm

Post by webs_bd » Wed Apr 04, 2018 8:33 pm

v 3.0.2.0.
Successfully sorted this in search.php with the above fix.
I carried out this fix in 'catalog/controller/account/order.php' and successful here also.
However can't seem to fix in catalog/controller/account/address.php' - this file seems a little different and can't find the right place for the extra code. Can anyone help here please? Currently if there are no customer addresses I get the 'Your Shopping Cart is empty!' message.

Big Decision
Website Production, Ecommerce & Digital Marketing in the UK
http://www.bigdecision.co.uk


New member

Posts

Joined
Sat Nov 09, 2013 8:29 pm

Post by dpanderson » Thu Apr 05, 2018 2:01 am

Same problem for me webs_bd, in multiple locations. I see the text_empty is not getting loaded, but have not successfully figured out where to load it at, or it is getting overwritten by a later called module. 3.0.2.0 with no modifications.

Newbie

Posts

Joined
Sat Mar 31, 2018 10:40 pm

Post by straightlight » Thu Apr 05, 2018 2:03 am

dpanderson wrote:
Thu Apr 05, 2018 2:01 am
Same problem for me webs_bd, in multiple locations. I see the text_empty is not getting loaded, but have not successfully figured out where to load it at, or it is getting overwritten by a later called module. 3.0.2.0 with no modifications.
When viewing the admin pages, do you see the English text or the defined keys such as text_empty?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by dpanderson » Thu Apr 05, 2018 3:08 am

The issue is on several catalog pages, it's the "shopping cart is empty" issue that has several forum posts running right now. Easiest way I have found to reproduce it is to register for a customer account, then go to "Wish List" when the wish list is empty.

Newbie

Posts

Joined
Sat Mar 31, 2018 10:40 pm

Post by leeburgess » Wed Aug 01, 2018 3:01 am

same issue here. any fix?

New member

Posts

Joined
Sat Sep 16, 2017 3:19 am

Post by HSLGuy » Sat Aug 04, 2018 2:42 am

edited to remove the code to fix issue with page titles. That is a separate issue and a simpler fix was provided by Journal theme support.

Thanks everyone for the code to fix this. There were still some other pages where I needed a fix, like recurring payments and address book, which needed the code in a different location. With some trial & error, I was able to find a location to insert the code given above on everything I could find that needed fixing. I'll compile all of my changes here:


Insert this code in all locations below:

Code: Select all

$data['text_empty'] = $this->language->get('text_empty');
In:
catalog/controller/account/download.php
catalog/controller/account/order.php (find first occurance of code only)
catalog/controller/account/reward.php
catalog/controller/account/transaction.php
catalog/controller/account/wishlist.php
catalog/controller/product/category.php
catalog/controller/product/compare.php
catalog/controller/product/manufacturer.php (find first occurance of code only)
catalog/controller/product/search.php
catalog/controller/product/special.php


BEFORE:

Code: Select all

$data['breadcrumbs'] = array();
===========================================

In:
catalog/controller/account/address.php

BEFORE

Code: Select all

$data['addresses'] = array();
===========================================

In:
catalog/controller/account/recurring.php

AFTER

Code: Select all

$this->document->setTitle($this->language->get('heading_title'));
===========================================

In:
catalog/controller/account/return.php

AFTER 1ST OCCURANCE (index function) OF

Code: Select all

$this->document->setTitle($this->language->get('heading_title'));
===========================================

In:
catalog/controller/information/contact.php

BEFORE:

Code: Select all

$data['continue'] = $this->url->link('common/home');

Don't forget to refresh the cache after making these changes.

That's all I've found,
Please mention any errors or other files that need fixing

Newbie

Posts

Joined
Thu Apr 19, 2018 3:19 am

Post by devth » Mon Apr 29, 2019 11:45 am

This problem is caused by this line in every page.

Code: Select all

$data['header'] = $this->load->controller('common/header');
It will load controller/common/cart.php that will load its language file by this line.

Code: Select all

$this->load->language('common/cart');
So, text_empty in every page will be replaced by controller/common/cart.php.
For me, I fix it by change "text_empty" to "text_empty_cart" in these files.

common/cart.twig
language/en-gb/common/cart.php

Newbie

Posts

Joined
Tue Feb 26, 2019 5:01 pm

Post by straightlight » Mon Apr 29, 2019 7:25 pm

devth wrote:
Mon Apr 29, 2019 11:45 am
This problem is caused by this line in every page.

Code: Select all

$data['header'] = $this->load->controller('common/header');
It will load controller/common/cart.php that will load its language file by this line.

Code: Select all

$this->load->language('common/cart');
So, text_empty in every page will be replaced by controller/common/cart.php.
For me, I fix it by change "text_empty" to "text_empty_cart" in these files.

common/cart.twig
language/en-gb/common/cart.php
Ahh ! yes, as explained to Daniel regarding the conflicted array keys on Github. :bang:

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Mr.Pikatchu » Mon Sep 23, 2019 6:41 pm

Someone on Github named PlusA2M found a much simpler solution . Go to system/config/catalog.php and change:

This:
'controller/*/after' => array(
'event/debug/after'
)
To this:
//'controller/*/after' => array(
// 'event/debug/after'
// )

Newbie

Posts

Joined
Tue Jul 03, 2018 10:32 pm
Who is online

Users browsing this forum: No registered users and 39 guests