need4speed Posted February 7, 2011 Share Posted February 7, 2011 I have uploaded a php tell a friend script.But how do i include the file to fx my header? Back in the days I just written <?php include("tell_a_friend.php"); ?> But it doesnt add anything. I have put the file in the root of the webshop.Is there a different way to include a php file? Link to comment Share on other sites More sharing options...
Truemedia Posted February 8, 2011 Share Posted February 8, 2011 You could make it part of module or make it its own module quite easily. Link to comment Share on other sites More sharing options...
need4speed Posted February 8, 2011 Author Share Posted February 8, 2011 Can you make me small example?I actually just need to place the module into the left hook and include some php code. Link to comment Share on other sites More sharing options...
Truemedia Posted February 8, 2011 Share Posted February 8, 2011 I'll make a tutorial on it at some point as part of developers resource if thats ok (on youtube)? Link to comment Share on other sites More sharing options...
need4speed Posted February 9, 2011 Author Share Posted February 9, 2011 Please let me know when you get it finished. That whould be really helpful. Link to comment Share on other sites More sharing options...
Paul C Posted February 9, 2011 Share Posted February 9, 2011 You could always read my Writing a Prestashop Module articles and you'll have a framework to download at the end of it to get you started Paul Link to comment Share on other sites More sharing options...
need4speed Posted February 9, 2011 Author Share Posted February 9, 2011 I have actually seen your article I just need a really basic example of how to show some php at the frontend. And the article you have made is quite more advanced but still really good. I just need a more simpel example. Link to comment Share on other sites More sharing options...
Paul C Posted February 9, 2011 Share Posted February 9, 2011 The problem is that you need all that code just to do something simple It isn't actually as hard as it looks. The only things you really need to change are:1) Name of the module (and maybe the description etc. but that's cosmetic)2) Decide which parts of the theme you need to insert code into (e.g. html header, left column)3) Install the hook functions in the install() member function for the areas identified in (2) (i.e. `handlers` to insert js/css in header & markup in leftcolumn)4) Populate the hook functions with the code you need to produce your markup.Note that you can directly `echo` from them (as is done in the example), or you can assign variables to and pass output through, the smarty template engine (added unnecessary complication if you don't need/want the mark-up to be end-user `tweakable`).It isn't hard really, but without having all that framework overhead in place a module won't work and you'll have to resort to editing the core files directly to add your code. You can do that of course, but I suspect you will regret it when you try and upgrade Paul 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