Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

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

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 04-26-2012, 11:45 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Lightbulb X-Cart 4.4.x/4.5.x (Smarty2 -> Smarty3 update)

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.
Attached Files
File Type: zip SMARTY3_4.4.x.zip (322.6 KB, 277 views)
File Type: zip SMARTY3_4.5.x.zip (376.8 KB, 269 views)
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions

Last edited by qualiteam : 05-07-2012 at 03:59 AM. Reason: + 4.5.0 patch added; Bugfixes: #7, #19
Reply With Quote

The following 5 users thank qualiteam for this useful post:
am2003 (04-27-2012), anandat (04-27-2012), cflsystems (04-27-2012), cherie (05-02-2012), seyfin (04-26-2012)
  #2  
Old 04-27-2012, 12:23 AM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default 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.
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote
  #3  
Old 04-27-2012, 12:30 AM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default 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
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote

The following user thanks ADDISON for this useful post:
qualiteam (04-27-2012)
  #4  
Old 04-27-2012, 07:44 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default 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?
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #5  
Old 04-27-2012, 09:09 AM
 
Mark N Mark N is offline
 

Senior Member
  
Join Date: Sep 2011
Posts: 121
 

Default 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?
__________________
X-Cart Gold Plus 4.6.5
Mods - WebsiteCM Dynamic Product Tabs, Smack Digital CDSEO Pro, AlteredCart Smart Search, AlteredCart One Page Checkout, Cart Works Power Filter, Firetank Software Feed Manager
Reply With Quote
  #6  
Old 04-28-2012, 08:54 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default 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?
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #7  
Old 04-29-2012, 09:28 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default 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
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following 4 users thank cflsystems for this useful post:
am2003 (04-30-2012), flyclothing (05-01-2012), Mark N (04-30-2012), qualiteam (04-29-2012)
  #8  
Old 04-29-2012, 10:29 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default 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.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #9  
Old 04-30-2012, 04:02 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default 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.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #10  
Old 04-30-2012, 08:00 AM
 
Mark N Mark N is offline
 

Senior Member
  
Join Date: Sep 2011
Posts: 121
 

Default 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.
__________________
X-Cart Gold Plus 4.6.5
Mods - WebsiteCM Dynamic Product Tabs, Smack Digital CDSEO Pro, AlteredCart Smart Search, AlteredCart One Page Checkout, Cart Works Power Filter, Firetank Software Feed Manager
Reply With Quote

The following 2 users thank Mark N for this useful post:
elmirage001 (04-30-2012), qualiteam (05-01-2012)
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:34 AM.

   

 
X-Cart forums © 2001-2020