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.

Regards,
Straightlight


Guru Member
Online

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/onlinev2/index.ph ... 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.

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.

Regards,
Straightlight


Guru Member
Online

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.

Regards,
Straightlight


Guru Member
Online

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.

Regards,
Straightlight


Guru Member
Online

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.

Regards,
Straightlight


Guru Member
Online

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.

Regards,
Straightlight


Guru Member
Online

Posts

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

Users browsing this forum: No registered users and 8 guests