X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   News and Announcements (https://forum.x-cart.com/forumdisplay.php?f=28)
-   -   X-Cart 5.2.14: code changes that you should be aware of (https://forum.x-cart.com/showthread.php?t=73961)

qualiteam 05-13-2016 04:01 AM

X-Cart 5.2.14: code changes that you should be aware of
 
Hi!

In X-Cart 5.2.14 the directory structure and the logic for the "top categories" widget has changed a lot.

If you have a module or a skin that replaces any of the files under the "/src/skins/default/en/categories/" directory, you will likely get a "fatal error" on pages displaying the widget after upgrading to 5.2.14.

What is changed:
1. The template directory structure is different. It may be that now you should replace a different template.
2. In earlier XC5 versions the widget retrieved a collection of \XLite\Model\Category objects. Now, for performance reasons, the widget works with a raw array of information about categories. The array may not contain some fields that you use in your custom module/skin. If so, you should look into \XLite\Model\Repo\Category::getCategoriesAsDTOQuer yBuilder() and \XLite\View\TopCategories::collectCategories() methods and adjust them to get the information you need.

ou812 05-15-2016 07:50 PM

Re: X-Cart 5.2.14: code changes that you should be aware of
 
so how can I fix this... it happened to me for categories and unsure how to fix

https://www.pomeroyandcompany.com/robot-vacuum-cleaner-battery-parts-accessories/irobot-battery-parts-acce...t-battery-pack

gives error:

ERROR: "Includes\ErrorHandler::FATAL_ERROR" (code 2)
Call to a member function display() on a non-object

ou812 05-16-2016 08:41 AM

Re: X-Cart 5.2.14: code changes that you should be aware of
 
if there is more than one product.. category doesn't work or display correctly and gives that error code...

can you help?

paulmighty 05-16-2016 04:09 PM

Re: X-Cart 5.2.14: code changes that you should be aware of
 
I'm noticing errors after the upgrade from 5.2.13 to 5.2.14 when deploying a store that includes Bootstrap glyphicons-halflings font-face.

The file is:
Code:

skins/common/bootstrap/css/variables.less

line 6:
Code:

@{common-skin}: false;

line 78:
Code:

@icon-font-path:          "@{common-skin}/bootstrap/fonts/";

In the deployed CSS file, this renders with a directory title "false" in the path like so:
Code:

@font-face {
font-family: 'Glyphicons Halflings';
src: url("false/bootstrap/fonts/glyphicons-halflings-regular.eot");
src: url("false/bootstrap/fonts/glyphicons-halflings-regular.eot?#iefix") format('embedded-opentype'), url("false/bootstrap/fonts/glyphicons-halflings-regular.woff") format('woff'), url("false/bootstrap/fonts/glyphicons-halflings-regular.ttf") format('truetype'), url("false/bootstrap/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular") format('svg')
}


Did not have this issue in 5.2.13 and am wondering what is the best way to fix this? Can I add something to my custom theme other than just overwriting the @font-face include?

Thanks!
-Paul

xplorer 05-18-2016 12:40 PM

Re: X-Cart 5.2.14: code changes that you should be aware of
 
Please try the 5.2.15 upgrade that has been released a few hours ago.
I've tried it on my local computer and it seems that the glyphicons URLs are correct in 5.2.15.

paulmighty 05-18-2016 01:30 PM

Re: X-Cart 5.2.14: code changes that you should be aware of
 
Quote:

Originally Posted by xplorer
Please try the 5.2.15 upgrade that has been released a few hours ago.
I've tried it on my local computer and it seems that the glyphicons URLs are correct in 5.2.15.


Thanks Slava, will do.

-Paul

More-Japan 05-19-2016 08:04 AM

Re: X-Cart 5.2.14: code changes that you should be aware of
 
So how exactly should we go about making the necessary changes to update custom skin so that we don't get fatal errors? Is it as straightforward as updating a few lines of code or is it more involved process?

If there is a guide or something, it would be greatly appreciated.

qualiteam 05-19-2016 10:59 AM

Re: X-Cart 5.2.14: code changes that you should be aware of
 
Unfortunately, I can help with adapting your custom skin to the new structure directory as I know neither what the custom modifications were nor what the purpose of these changes is.

It is not that a few words have been changed in the files. The widget now uses a different set of templates and pass data in a different format to the templates.

You will have to look into the directory, check what the new template files are and update your custom changes accordingly.

qualiteam 05-24-2016 10:43 PM

Re: X-Cart 5.2.14: code changes that you should be aware of
 
Perhaps this forum thread may help you to fix related issues on your websites:
https://forum.x-cart.com/showthread.php?t=74006

When you face the "Call to a member function ....{your function name there}.... on a non-object", you should
1) locate the place where it is called in your custom module/theme
2) use \XLite\Logger::logCustom('debug', var_export($your_variable_name, true)); line to print the structure of the variable that triggers the error
3) replace the broken method call with getting the value from the array key that seems to be related to that method (for instance, "$c->getCategoryId()" => "$c['id']").


All times are GMT -8. The time now is 06:38 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.