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.

cflsystems 04-30-2012 08:41 AM

Re: X-Cart 4.4.x/4.5.x (Smarty2 -> Smarty3 update)
 
Since QT just released that probably all non-standard XC mods will not function properly until patched by their developers. This is normal. I personally would suggest anyone using anything before 4.5.x not to upgrade or to upgrade if this will be new store. The patch will work only on XC files and if you have custom skin not using one of the default XC skins as base then the patch will not apply to it - you need to manually go over all files and update them. And of course all 3rd party mods and customizations....

cflsystems 04-30-2012 11:36 AM

Re: X-Cart 4.4.x/4.5.x (Smarty2 -> Smarty3 update)
 
On a clean 4.5.0 install the upgrade runs without any issues. There is a problem with it though - after smarty is upgraded the ajax add to cart on product details pages doesn't work. It reloads the page. On product details page the ajax add to cart works. Please fix

qualiteam 05-01-2012 10:13 PM

Re: X-Cart 4.4.x/4.5.x (Smarty2 -> Smarty3 update)
 
Quote:

Originally Posted by cflsystems
On a clean 4.5.0 install the upgrade runs without any issues. There is a problem with it though - after smarty is upgraded the ajax add to cart on product details pages doesn't work. It reloads the page. On product details page the ajax add to cart works. Please fix


I'm sorry, but it seems I failed to replicate this problem. Could you please let me know if there are any error records in X-Cart error logs?

cflsystems 05-02-2012 08:18 AM

Re: X-Cart 4.4.x/4.5.x (Smarty2 -> Smarty3 update)
 
There are no errors. Perhaps I wasn't clear - the "buy now" button on products list pages works and adds to cart but instead of doing it in the background it reloads the page. The "add to cart" button on product details page works as it should - without reloading the page

qualiteam 05-03-2012 11:21 PM

Re: X-Cart 4.4.x/4.5.x (Smarty2 -> Smarty3 update)
 
OK, I see. I tried the same steps in the featured products section list on the ideal comfort skin on the home page. I got product added without any page reload. Probably there is some admin backend option difference.

cflsystems 05-04-2012 08:19 AM

Re: X-Cart 4.4.x/4.5.x (Smarty2 -> Smarty3 update)
 
There were no changes to XC, just as it is installed, applied the patch and the button stops working. Try any other skin and you will see it not working.

JFYI so you can fix that upgrade
1. Ideal Comfort - skin loads, button works
2. Books & Magazines - skin loads, button doesn't work
3. Light & Lucid - skin loads, button doesn't work
4. Artistic Tunes - skin doesn't load at all - error
Code:

PHP Fatal error:  Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "/var/www/blacksea/xcart450smarty/skin/artistictunes_business/customer/bread_crumbs.tpl"  on line 5 "{if $location and not($main eq &quot;catalog&quot; and $current_category.category eq &quot;&quot;)}" unknown function "not"' in /var/www/blacksea/xcart450smarty/include/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php:627
Stack trace:

5. Fashion Mozaic - skin loads, buttons doesn't work
6. Vivid Dreams - skin loads, button doesn't work

cflsystems 05-05-2012 02:11 PM

Re: X-Cart 4.4.x/4.5.x (Smarty2 -> Smarty3 update)
 
Just my observation - seems like XC 4.5.0 gets slower with Smarty3 upgrade. I thought Smarty 3 is supposed to be faster and more efficient....

qualiteam 05-07-2012 02:33 AM

Re: X-Cart 4.4.x/4.5.x (Smarty2 -> Smarty3 update)
 
Quote:

Originally Posted by cflsystems
Just my observation - seems like XC 4.5.0 gets slower with Smarty3 upgrade. I thought Smarty 3 is supposed to be faster and more efficient....


I've done several tests and sometimes Smarty3 works faster, but not always.
Obviously the speed is almost the same (since no specific Smarty3 features used).

I cannot perform a complete test at the moment as it requires a dedicated server.

qualiteam 05-07-2012 03:57 AM

Re: X-Cart 4.4.x/4.5.x (Smarty2 -> Smarty3 update)
 
Quote:

4. Artistic Tunes - skin doesn't load at all - error

The issue has been fixed. I've updated the pack.

cflsystems 05-07-2012 08:17 AM

Re: X-Cart 4.4.x/4.5.x (Smarty2 -> Smarty3 update)
 
Quote:

Originally Posted by qualiteam
The issue has been fixed. I've updated the pack.


Only the skin not loading issue or the buy now button issue as well?

qualiteam 05-07-2012 10:25 PM

Re: X-Cart 4.4.x/4.5.x (Smarty2 -> Smarty3 update)
 
Quote:

Originally Posted by cflsystems
Only the skin not loading issue or the buy now button issue as well?


Only skin not loading issue. Buttons issue is still being investigated.

ADDISON 06-10-2012 05:13 AM

Re: X-Cart 4.4.x/4.5.x (Smarty2 -> Smarty3 update)
 
Is this update in great shape for v4.5.0? I would like to update my version and need some testimonials.

I would like to know if Smarty3 will replace Smarty2 in future versions in 4.5 branch, even starting with the most wanted 4.5.1. I appreciate a qualified answer.

cflsystems 06-10-2012 08:14 AM

Re: X-Cart 4.4.x/4.5.x (Smarty2 -> Smarty3 update)
 
You can use it but as I have posted earlier there are issues with some of the skins. QT has not come up with fixes yet and may guess is they will not try to fix it for 4.5.0 at all but wait until 4.5.1 is out and make it work there. Since 4.5.1 is taking so much time (compare to before) to be released they may even release it with Smarty 3 included but who knows...

ADDISON 06-10-2012 08:23 AM

Re: X-Cart 4.4.x/4.5.x (Smarty2 -> Smarty3 update)
 
QT says a new update will be available mid of June. No problem if it will be available end of June. By the way DPI module almost killed me how many issues I found.

Quote:

Originally Posted by cflsystems
You can use it but as I have posted earlier there are issues with some of the skins. QT has not come up with fixes yet and may guess is they will not try to fix it for 4.5.0 at all but wait until 4.5.1 is out and make it work there. Since 4.5.1 is taking so much time (compare to before) to be released they may even release it with Smarty 3 included but who knows...


Mark N 06-11-2012 05:51 AM

Re: X-Cart 4.4.x/4.5.x (Smarty2 -> Smarty3 update)
 
Try as I might, I was unable to get Smarty3 to work - it just broke too many things in third party modules. And talking to the authors of the modules, the fact that this is, in a lot of ways, an "optional" upgrade, supporting what will amount to two different branches of X-Cart (but with the same version numbers) was daunting to say the least.

I think ultimately they will need to officially move to Smarty3 before this sort of thing will get worked out. 4.5.0 would have probably been the logical point to do that, but what ya gonna do...

ADDISON 06-11-2012 06:05 AM

Re: X-Cart 4.4.x/4.5.x (Smarty2 -> Smarty3 update)
 
@Mark N - 3rd party modules, some of them, use {php} Smarty tag which is deprecated starting with v3.

As an advice, I recommended this before to QT, offer Smarty3 support only starting with v4.5 branch, by default. This will help 3rd party developers and QT customers who would like to update their own modules. Image how is making compatible with Smarty 3 modules in XC 4.1.12 ... especially when those 3rd party developers disappeared and they did not update their own modules for many years.

cflsystems 06-11-2012 09:40 AM

Re: X-Cart 4.4.x/4.5.x (Smarty2 -> Smarty3 update)
 
Did you change your forum name?

Yes I think they should have (maybe they will with 4.5.1) gone with Smarty3 for 4.5.x branch. Since this requires some re-coding of modules anyway

ADDISON 06-11-2012 11:02 AM

Re: X-Cart 4.4.x/4.5.x (Smarty2 -> Smarty3 update)
 
Yeap Steve, now it is easy for everyone to call me by name.

Quote:

Originally Posted by cflsystems
Did you change your forum name?

Yes I think they should have (maybe they will with 4.5.1) gone with Smarty3 for 4.5.x branch. Since this requires some re-coding of modules anyway


shan 10-10-2012 07:38 AM

Re: X-Cart 4.4.x/4.5.x (Smarty2 -> Smarty3 update)
 
so did the debug module get sorted out to include the page variables as well as the templates.

with just the templates its pretty useless


All times are GMT -8. The time now is 03:47 AM.

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