Bandai Posted June 1, 2010 Share Posted June 1, 2010 What do I need to learn enable to create themes for Prestashop 1.3?I know moderate PHP & MySQL and I can code valid HTML/CSS, but when I looked at some of the template files on the default theme I can't understand how it works. What do I need to learn to be able to create themes without any problem at all? Is there any special tools to make this easy?Need some advice please.Thanks! Link to comment Share on other sites More sharing options...
rocky Posted June 2, 2010 Share Posted June 2, 2010 You need to learn about Smarty, which is used in the theme's TPL files. There are no tools that I'm aware that let you edit a PrestaShop theme visually. You need to edit the theme code manually. Link to comment Share on other sites More sharing options...
Bandai Posted June 2, 2010 Author Share Posted June 2, 2010 How about offering some tips and tricks on creating a prestashop themes? Like a list of common variables that I should be familiar with?Also if you know smarty, then automatically you'll be able to make your own prestashop themes? or is prestashop using a modified smarty engine? Link to comment Share on other sites More sharing options...
rocky Posted June 2, 2010 Share Posted June 2, 2010 PrestaShop uses standard Smarty and some of Smarty's plugins. You can see a list of Smarty variables accessible to all TPL files at the bottom of init.php. The variables in the if block are available when "v1.1 theme compatibility" on the Preferences tab is turned off and the else block variables and available when "v1.1 theme compatibility" is turned on.You should copy the default PrestaShop theme and then play around with the code. If you understand HTML and CSS, then it isn't very hard to figure out. One trick is that you can override module TPL files within a theme by mirroring the file inside the theme. For example, themes/yourtheme/modules/blockuserinfo/blockuserinfo.tpl overrides modules/blockuserinfo/blockuserinfo.tpl. This lets you customise the module code to a theme without actually modifying the module. Link to comment Share on other sites More sharing options...
Bandai Posted June 2, 2010 Author Share Posted June 2, 2010 Thanks for the reply! the last part was very helpful. I'm going to read up on smarty now.Anyone else care to share some tips, that would be great! Link to comment Share on other sites More sharing options...
cercamon Posted July 21, 2010 Share Posted July 21, 2010 And what about overriding some PHP function?i.e. like some of the included in /admin/tabs/AdminOrders.phpDoes it exist any mechanism to do it? Link to comment Share on other sites More sharing options...
rocky Posted July 22, 2010 Share Posted July 22, 2010 You can create a new file like AdminOrdersCustom.php that extends from AdminOrders.php to override the functions, then go to Tools > Tabs, edit the "Orders" tab, then change the "Class" to "AdminOrdersCustom" to use your file instead of the default one. You could put SQL queries in the install and uninstall functions of a module to automatically do this. Link to comment Share on other sites More sharing options...
cercamon Posted July 22, 2010 Share Posted July 22, 2010 Thanks for the answer. That sounds good!And what about overriding php functions in core files located in root or Classes folders?I'm thinking here of files like:* /order-detail.php* /classes/Address.php* /classes/Cart.php* ...Would it be possible? Link to comment Share on other sites More sharing options...
rocky Posted July 22, 2010 Share Posted July 22, 2010 I haven't found a way to override the root files or classes, which limits what you can do with modules. The problem is that the calls to the classes are hardcoded as Address or Cart, for example, in PrestaShop's core files rather than being a specified class like with the tabs. You are limited to using PrestaShop's hooks to add code in specific places. If you want to put code in a place where no hook exists, then you are out of luck. The only way I can think of to override a root file is to create a modified copy of it in your module and change all links to point to it instead of the one in the root directory. I suppose you could also write code thats backs up the current root file and then replaces it with the one in your module, but that's probably a bad way of doing things. Let us know if you find any better way to override code. Link to comment Share on other sites More sharing options...
cercamon Posted July 23, 2010 Share Posted July 23, 2010 Thanks a lot. I appreciate your comments.By chance, do you know any written material that would facilitate the diving into prestashop module development, hooks...? Link to comment Share on other sites More sharing options...
rocky Posted July 23, 2010 Share Posted July 23, 2010 I started documenting PrestaShop's hooks here, but haven't got around to finishing it. I'm usually busy working, so it is hard to find the time to document PrestaShop. Link to comment Share on other sites More sharing options...
CalloSmart Posted February 3, 2011 Share Posted February 3, 2011 What do I need to learn enable to create themes for Prestashop 1.3?I know moderate PHP & MySQL and I can code valid HTML/CSS, but when I looked at some of the template files on the default theme I can't understand how it works. What do I need to learn to be able to create themes without any problem at all? Is there any special tools to make this easy?Need some advice please.Thanks! HiI have over 13 years of software development in Microsoft based software development technologies. But I am a newbie to PHP and especially to Prestashop framework. I am learning the framework and in the process, started to write a series of posts(Creating a Prestashop 1.4 theme from scratch) to outline the creation of a new Prestashop theme using Visual Studio and other tools. The posts primarily are targeted towards a PHP/Prestashop newbie.Please visit Creating a Prestashop 1.4 theme from scratch and share my experiences through my learning phase. I hope active participation from other novice Prestashop programmers like me and advices from Prestashop experts to make the posts helpful for others who require it. Link to comment Share on other sites More sharing options...
botmez Posted May 31, 2011 Share Posted May 31, 2011 Override RUNS in 1.3.1.1. ????? Link to comment Share on other sites More sharing options...
rocky Posted May 31, 2011 Share Posted May 31, 2011 Yes, you can override module TPL files in PrestaShop v1.3.1.1. You can't override classes and controllers like in PrestaShop v1.4 though. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now