X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   X-Cart 4.4.x/4.5.x (Smarty2 -> Smarty3 update) (https://forum.x-cart.com/showthread.php?t=63437)

qualiteam 04-26-2012 11:45 PM

X-Cart 4.4.x/4.5.x (Smarty2 -> Smarty3 update)
 
3 Attachment(s)
Dear customers,

We are introducing the Smarty3 update patch for X-Cart 4.4.x and 4.5.x

The patch has been tested on clean 4.4.5/4.5.0 installations, any feedback is welcome.

So, here are steps required to do the Smarty2 -> Smarty3 ( Smarty-3.1.8 ) engine update in X-Cart and use the new features introduced in Smarty3.

1. Prepare for update:
* Make a complete back-up of the store (DB + Files).
* Make sure you have the SSH or FTP access to your store.

2. Update:
* Apply the attached file patch (SMARTY3_4.4.x.zip, SMARTY3_4.5.x.zip) via X-Cart admin backend (or manually or via command line patch utitlity). The patch applies via X-Cart admin back-end automatically for a clean 4.4.5/4.5.0.

NOTE: the store will become non operational after this step.

* Delete the "<xcart_dir>/include/lib/smarty" folder and all its content.

* Upload the "include" folder content from the attached archive to the X-Cart's "include" directory ("<xcart_dir>/include/"). Only new files should be added (in case of a clean X-Cart 4.4.5/4.5.0). So, there should be no overwrite promt.

3. Update completed. Check your store. It should be back to normal working state.

Known limtations: Not for production sites yet! Debugging console is not fully updated, only template names are shown.

ADDISON 04-27-2012 12:23 AM

Re: X-Cart 4.4.x -> Smarty3 update
 
This is a good news. I was one who asked about having Smarty 3 in XC mainly because of speed and also for other new benefits of it.

Please spend time and update the Debug Console for functioning like in Smarty 2. This is a very important tool. I will watch this thread and give a test to your addition. Thanks for taking in consideration Smarty 3. It is a big step forward.

ADDISON 04-27-2012 12:30 AM

Re: X-Cart 4.4.x -> Smarty3 update
 
One more thing for those who would like to give it a try. Read this

http://smarty-php.googlecode.com/svn/trunk/distribution/SMARTY_2_BC_NOTES.txt

I hope you are familiar with your Smarty 2 and any custom modifications in your XC, especially those with {php} tag.

Smarty 3 Overview: http://www.smarty.net/v3_overview

cflsystems 04-27-2012 07:44 AM

Re: X-Cart 4.4.x (Smarty2 -> Smarty3 update)
 
Agreed - this was needed long time ago. Thanks for doing it.

Question (I think I know the answer though) - is 4.5.x using Smarty3 or still on Smarty2? Are templates cleared of the old code?

Mark N 04-27-2012 09:09 AM

Re: X-Cart 4.4.x (Smarty2 -> Smarty3 update)
 
So...

Followed the directions, applied the patch (including manually patching the necessary files manually), deleted the smart directory and uploaded the files as noted.

Getting this error in my php log file:

Quote:

[27-Apr-2012 17:04:44 UTC] PHP Fatal error: Uncaught exception 'SmartyException' with message 'template property 'current_resource_name' does not exist.' in /home/alinc101/public_html/445/include/lib/smarty/sysplugins/smarty_internal_template.php:666
Stack trace:
#0 /home/alinc101/public_html/445/include/templater/plugins/function.math.php(66): Smarty_Internal_Template->__get('current_resourc...')
#1 /home/alinc101/public_html/445/var/templates_c/df86eebcf005b3b363f51eebd97966a1/7658a2debad54153929fab57e82940aebc14de12.file.prod uct.tpl.php(76): smarty_function_math(Array, Object(Smarty_Internal_Template))
#2 /home/alinc101/public_html/445/include/lib/smarty/sysplugins/smarty_internal_templatebase.php(180): content_4f9ad1ac111e49_04775690(Object(Smarty_Inte rnal_Template))
#3 /home/alinc101/public_html/445/include/lib/smarty/sysplugins/smarty_internal_template.php(285): Smarty_Internal_TemplateBase->fetch(NULL, NULL, NULL, NULL, false, false, true)
#4 /home/alinc101/public_html/445/var/templates_c/df86eebcf005b3b363f51eebd97966a1/390b561a421efed6ea146149 in /home/alinc101/public_html/445/include/lib/smarty/sysplugins/smarty_internal_template.php on line 666


Get this or a similar error with any customer-facing page I try to access. The admin page seems to be working just fine though.

Did I miss something?

cflsystems 04-28-2012 08:54 AM

Re: X-Cart 4.4.x (Smarty2 -> Smarty3 update)
 
Seems like 4.5.0 is still using Smarty2 -> 2.6.26. Will this Smarty3 upgrade work on 4.5.0 to upgrade smarty on it?

cflsystems 04-29-2012 09:28 PM

Re: X-Cart 4.4.x (Smarty2 -> Smarty3 update)
 
Ok answering my own question

This Smarty3 upgrade works on 4.5.0 but:
1. some files are missing in 4.5.0 so their upgrade has to be deleted from the diff file.
2. the upgrade does not have the 2 new skins (since they are new for 4.5.0) so their templates have to be patch manually based on skin/common_files changes in the diff file
3. not sure about 4.4.5 but on 4.5.0 there were like 6 files to be patched manually


There are files missing from the upgrade diff file that needs to be patched on 4.4.5 and 4.5.0 as well. QT has not checked everything so in some cases there will be errors and site will not load. This is what I found so far but there could be more missing files

1. cleanup.php is not included in the diff file but it needs to be patched as well. New code
Code:

$result = $smarty->clearCache(null);
$result = $smarty->clearCompiledTemplate();


2. function.math.php is not included in the diff file but needs to be patched as well. New code
Code:

$error_prefix = 'math ``<b>'.htmlspecialchars($params['equation']).'</b>\'\' in ``'.$smarty->template_resource.'\'\': ';

3. configuration.php is not included in the diff file but need to be patched as well. New code
Code:

          if
(func_option_is_changed($option, $v))
{
$smarty->clearCompiledTemplate();
$smarty->clearCache(null);
break;
}


So anyone looking to upgrade smarty - wait. The provided upgrade is buggy

qualiteam 04-29-2012 10:29 PM

Re: X-Cart 4.4.x (Smarty2 -> Smarty3 update)
 
Thank you for the feedback, much appreciated.
I've updated the patch and added the necessary bugfixes.

qualiteam 04-30-2012 04:02 AM

Re: X-Cart 4.4.x/4.5.x (Smarty2 -> Smarty3 update)
 
Smarty3 4.5.x patch has been created and uploaded.

I've updated my first message.

Mark N 04-30-2012 08:00 AM

Re: X-Cart 4.4.x/4.5.x (Smarty2 -> Smarty3 update)
 
So I've been testing out this upgrade. I think it goes without saying but perhaps it should be noted that if you use third party modules, this upgrade will quite likely make many of them not function correctly - in my initial testing I found that the WebsiteCM Dynamic Tabs and the Altered Cart One Page Checkout did not function anymore. Not to single out these two modules - they just happen to be two that I use on my site that I noted problems with.

This is clearly a very significant upgrade, affecting over 300 files, probably more depending on how much your site is customized.


All times are GMT -8. The time now is 10:50 AM.

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