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?
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.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
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.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I am unable to add a manufacturer to the demo site, so hence I am unable to test it out.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
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.
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.No language definitions have been removed.
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.My confusion is, Opencart v2 returns the expected variable, but v3 does not return the expected variable.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
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.
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.straightlight wrote: ↑Tue Nov 14, 2017 10:39 pmWe do hope to see those defined keys back in a future release of Opencart.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
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?straightlight wrote: ↑Tue Nov 14, 2017 10:57 pmThe $this->load->language object is still being implied. Although, the data array no longer calls those defined arrays from the language files.
The only way to resolve this would be by manually declaring the right language key from the related controller.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Can someone with the "official" demo for v3.0.2.0 see if they can duplicate the issue with an empty wishlist?
I was told: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)
which sounded to me like 'code speak' for someone got some code wrong but won't admit it....... it is not a bug. Simply a missed concept approach to announce an event to the user.
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');
Code: Select all
$data['sort'] = $sort;
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();
HTH
Users browsing this forum: moreduff and 90 guests