Post by CSR » Mon Nov 13, 2017 10:08 pm

Hello
I have spotted the following with v3.0.2.0.

Where a brand is listed in the manufacturers list, but not assigned to any products, when you click on the brand name from the Brands Link (which lists all the brands) in v3 the message returned is 'Your shopping cart is empty!'

I believe the message returned should be 'There are no products to list.' (Which is what V2.3.0.2 returns as an error message)

The 'text_empty' field in the language file \language\en-gb\product\manufacturer.php is = 'There are no products to list.';

The 'text_empty' field in the language file \language\en-gb\checkout\cart.php is = 'Your shopping cart is empty!';

So it appears that the text_empty field is being referenced from the wrong php file somehow.

Whilst it is not the end of the world, it would be more polite to website visitors to return a slightly more meaningful message?

Has anyone else noticed this?
Last edited by CSR on Mon Nov 13, 2017 10:36 pm, edited 1 time in total.

CSR
Newbie

Posts

Joined
Sun Mar 19, 2017 3:12 am

Post by straightlight » Mon Nov 13, 2017 10:27 pm

That analogy would be partially correct. The other end side of the 'Your shopping cart is empty!' message is also useful when deleting products from the cart itself. When originating from other pages in the store, it is possible to indicate another message based on the last referred page that does not include the cart page in order to show the message: 'There are no products to list'

Another way of seeing this for the 'There are no products to list' message is to display this message when the cart is empty but from a success JSON message in the event response of the user.

With that being said, it is not a bug. Simply a missed concept approach to announce an event to the user.

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

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

Post by CSR » Tue Nov 14, 2017 6:32 pm

Thank you for your reply. I appreciate that returning Your shopping cart is empty! is relevant to the cart, I do not understand why in this case this message is being returned.

In this particular instance is Opencart 3.0.2.0 not sourcing the language from the wrong language file?

The path is: ?route=product/manufacturer/info

In:
catalog\controller\product\manufacturer.php

is the reference to the language file

$this->load->language('product/manufacturer');

In the template file (default opencart template) manufacturer_info.twig file is the reference to {{ text_empty }}

In the language file in:
catalog\language\en-gb\product\manufacturer.php is:
$_['text_empty'] = 'There are no products to list.';

The variable is There are no products to list.

But the variable being returned for {{ text_empty }} is Your shopping cart is empty!

So what I cannot get my head around is why the Your shopping cart is empty! is being returned when clearly in the language file the correct variable should be There are no products to list.

You can see in this link (demo V3 store): http://www.mapw.co.uk/cartv3/index.php? ... urer_id=11

If I try the same thing with a demo store in version 2.3.0.2 the returned variable is the expected There are no products to list.

This Link (demo v2 store): http://www.mapw.co.uk/oconlinev2/index. ... urer_id=65

Is there an easy solution to get the correct variable returned in the V3 store?

Secondary to this is the fact that if you go and edit the language file in V3 within the admin panel (which is a new feature), it will not affect the result returned.
Last edited by CSR on Thu Apr 05, 2018 5:14 pm, edited 1 time in total.

CSR
Newbie

Posts

Joined
Sun Mar 19, 2017 3:12 am

Post by straightlight » Tue Nov 14, 2017 8:47 pm

The provided demo web site is part of a 3rd party website. The official demo web site of Opencart is: http://demo.opencart.com . Can you see the same message when reproducing the event on that site?

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

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

Post by CSR » Tue Nov 14, 2017 9:05 pm

There are no empty brand categories listed on the official demo site link, hence correctly that error will not be shown. Perhaps if one is added it will replicate the error I am seeing?

I am unable to add a manufacturer to the demo site, so hence I am unable to test it out.
Last edited by CSR on Tue Nov 14, 2017 9:09 pm, edited 1 time in total.

CSR
Newbie

Posts

Joined
Sun Mar 19, 2017 3:12 am

Post by straightlight » Tue Nov 14, 2017 9:07 pm

If the proper empty message is displayed on the Opencart demo website, then the issue is not with the core.

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

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

Post by CSR » Tue Nov 14, 2017 9:12 pm

I am unable to replicate the error on the demo site because there are no empty brands on the demo site. On my V3 test site I have not modified any core code and have what I believe to be an incorrect variable being output, just by reviewing the language files I have listed you can see the expected output is different to the actual output.

CSR
Newbie

Posts

Joined
Sun Mar 19, 2017 3:12 am

Post by straightlight » Tue Nov 14, 2017 9:24 pm

In this case, as explained above, it is possible that this issue occurs because of the language definitions being removed. That being considered strategy, the browser will load the last available text definition on the browser rather than using insisted language definition keys which obviously may be misleading outputs. The only way to resolve this would be by manually declaring the right language key from the related controller.

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

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

Post by CSR » Tue Nov 14, 2017 10:23 pm

No language definitions have been removed. My test store is as out of the box, as the opencart demo site with one manufacturer brand added but without allocating any products.

OC v3 returns a different variable for an empty manufacturer field to the expected {{ text_empty }} field stored in the language file. The language file {{ text empty }} field has 'There are no products to list.' as the stored variable but the output is 'Your shopping cart is empty!'

Check the same thing in OC v2 and you get the expected 'There are no products to list.'

My confusion is, Opencart v2 returns the expected variable, but v3 does not return the expected variable.

CSR
Newbie

Posts

Joined
Sun Mar 19, 2017 3:12 am

Post by straightlight » Tue Nov 14, 2017 10:39 pm

No language definitions have been removed.
What I was referring was based on prior versions of Opencart. Prior versions of Opencart used to have their own variables to declare the language definitions from the controllers. Nowadays, Opencart no longer uses that methodology since the TWIG engine has been implemented.
My confusion is, Opencart v2 returns the expected variable, but v3 does not return the expected variable.
That is correct; which is what I explained on my previous statement above since the languages are now automatically detected rather than leaving the defined keys into the controllers. By doing that, the browser captures the last available key that was passed through the browser instead of using enforced keys from the controllers. We do hope to see those defined keys back in a future release of Opencart.

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

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

Post by CSR » Tue Nov 14, 2017 10:51 pm

Thank you, and apologies for being slow on the uptake. I understand what you mean by language definitions being removed comparing v2 to v3 - I was completely misunderstanding what was taking place.

I was under the impression that in the controller: catalog\controller\product\manufacturer.php the language variables were declared using $this->load->language('product/manufacturer');

if this was the case I was expecting to see this returned: $_['text_empty'] = 'There are no products to list.'; which is definded in the related language file for product\manufacturer.
straightlight wrote:
Tue Nov 14, 2017 10:39 pm
We do hope to see those defined keys back in a future release of Opencart.
That would be useful, as it would make the online shopping experience more customer friendly and a customisable one, rather than a computer generic one error message fits all scenario.

CSR
Newbie

Posts

Joined
Sun Mar 19, 2017 3:12 am

Post by straightlight » Tue Nov 14, 2017 10:57 pm

The $this->load->language object is still being implied. Although, the data array no longer calls those defined arrays from the language files.

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

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

Post by KingCryptoServices » Mon Nov 27, 2017 8:20 am

straightlight wrote:
Tue Nov 14, 2017 10:57 pm
The $this->load->language object is still being implied. Although, the data array no longer calls those defined arrays from the language files.
Hey, new to OpenCart, and I really like v3, but of course I'm having this same issue. You wrote something earlier (quoted below) where you stated there could be a temporary fix until it's patched in the official core. Would you recommend using a temporary fix or using v2 until some of the bugs like this are removed?
The only way to resolve this would be by manually declaring the right language key from the related controller.


Posts

Joined
Mon Nov 27, 2017 12:27 am

Post by straightlight » Mon Nov 27, 2017 10:00 pm

This question is rather about common sense. It is simply best to remain with the latest version by reporting nowadays encountered issues rather than going back in time to encounter the already encountered problems all over again.

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

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

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

I am having similar problems on my 3.0.2.0 website. I tried to duplicate the problem on the demo website (register as a new user, then check my empty Wishlist is one easy way). I do not see the problem on the demo site, but I believe the demo is version 3.0.1.1

Can someone with the "official" demo for v3.0.2.0 see if they can duplicate the issue with an empty wishlist?

Newbie

Posts

Joined
Sat Mar 31, 2018 10:40 pm

Post by CSR » Thu Apr 05, 2018 5:43 pm

My issue was, as stated in the original post:
Where a brand is listed in the manufacturers list, but not assigned to any products, when you click on the brand name from the Brands Link (which lists all the brands) in v3 the message returned is 'Your shopping cart is empty!'

I believe the message returned should be 'There are no products to list.' (Which is what V2.3.0.2 returns as an error message)
I was told:
...... it is not a bug. Simply a missed concept approach to announce an event to the user.
which sounded to me like 'code speak' for someone got some code wrong but won't admit it.

Personally I thought that it was a bug as I felt the 'correct' error message should be shown 'There are no products to list.', rather than 'Your shopping cart is empty!' as the error message for a brand with no products assigned to it. i.e. an empty brand category. It might be a missed concept regarding the coding, but it makes no sense to the poor end user - who will not understand 'Your shopping cart is empty!' when they have not perhaps added anything to the cart.

I even replicated this error on my demo v3 Opencart site (with no modifications) to prove it was in the original OC 3.0.2.0 core code, so that I could not be told the usual 'it is to do with your Journal2 theme/other modifications/any other excuse other than the OC core code'.

I have since rectified this issue on my live site, which I worked through the fix for during original development of my site, before going live. There are fixes on this forum to help further.

My fix was as follows:
Insert into file: catalog/controller/product/manufacturer.php

Code: Select all

// Line below added to return correct text_empty field for empty manufacturer category.
data['text_empty'] = $this->language->get('text_empty');
ABOVE LINE (which is around line 330)

Code: Select all

$data['sort'] = $sort;
An empty Brand/Manufacturer now returns There are no products to list.

Additionally if catalog/controller/product/category.php is amended accordingly as above, then an empty category returns the more appropriate error message.

Also in catalog/controller/product/search.php, catalog/controller/product/special.php and in catalog/controller/account/transaction.php the above code added above:

Code: Select all

$data['breadcrumbs'] = array();
(which is around line 76) will alter their empty field error message.

HTH

CSR
Newbie

Posts

Joined
Sun Mar 19, 2017 3:12 am
Who is online

Users browsing this forum: No registered users and 10 guests