Jump to content

Mitchell Ransom

Members
  • Posts

    10
  • Joined

  • Last visited

Mitchell Ransom's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Ok another update. Uninstalling / reinstalling didn't work. For some reason, copying the entire module folder, and renaming everything to headerchanger4 and then applying the translations for it in the back office has done the trick. I didn't edit any of the code other than renaming it. I don't fully understand why it was happening or why this solution worked so I'm still looking for an explaination.
  2. Changing those tag's didn't help, also tried uninstalling and reinstalling with the modified code with no effect. I think possible I need an uninstall function in the .php file so I will see what I can come up with.
  3. Just seen my mistake now. I'll change the mod="" tags and see if that works.
  4. UPDATE: I've changed my code and added a .tpl file. This has stopped the parse errors, and added the expressions to the back office module translations. Though when changing languages in the front office the module still remains in english. I've tried clearing all cache and tempoary files etc and using ctrl +f5 to refresh but nothing is changing. The links are correct now so when in another language the links relate to that language instead of the default of english, but the text for the links remains in english. Here's the code: headerchanger3.php <?php class headerchanger3 extends Module { function __construct() { $this->name = 'headerchanger3'; $this->tab = 'Other Modules'; $this->version = 1.0; parent::__construct(); // The parent construct is required for translations $this->page = basename(__FILE__, '.php'); $this->displayName = $this->l('Header Changer 3'); $this->description = $this->l('Use this to modify header html.'); } function install() { if (!parent::install()) return false; if (!$this->registerHook('top')) return false; return true; } /** * Returns module content * * @param array $params Parameters * @return string Content */ function hookTop($params) { return $this->display(__FILE__, 'headerchanger3.tpl'); } } ?> headerchanger3.tpl getPageLink('index.php', true)}" title="{l s='Homepage' mod='headerchanger'}">{l s='Home' mod='headerchanger'} | getPageLink('1-home', true)}" title="{l s='Product List' mod='headerchanger'}">{l s='Products' mod='headerchanger'} | {l s='Web Design' mod='headerchanger'} | getPageLink('contact-us', true)}" title="{l s='Contact Neon Flame' mod='headerchanger'}">{l s='Contact Us' mod='headerchanger'} | {if $logged} getPageLink('index.php')}?mylogout" title="{l s='Log me out' mod='headerchanger'}">{l s='Log out' mod='headerchanger'} {else} getPageLink('my-account.php', true)}">{l s='Log in' mod='headerchanger'} {/if}
  5. Hi, I've made a simple module to display some links in the header of my website. I've tried to use the php code to add translations but everytime I add this code aand refresh the front office the page just goes blank and there is an error listed in the back office modules page "Parse error(s) in module(s) 1.headerchanger". Here is the code I'm trying to use if someone could check it for me I would greatly appreciate it. Kind regards, Mitchell Ransom <?php class headerchanger extends Module { private $_html = ''; function __construct() { $this->name = 'headerchanger'; parent::__construct(); $this->tab = 'Homepage'; $this->version = '0.1.1'; $this->displayName = $this->l('Header Changer'); $this->description = $this->l('Use this module to add html lto the header.'); } public function install() { parent::install(); if (!$this->registerHook('top')) return false; } public function hookTop() { return ' getPageLink('index.php', true)}" title="{l s='Homepage' mod='headerchanger'}">{l s='Home' mod='headerchanger'} | getPageLink('/1-home', true)}" title="{l s='Product List' mod='headerchanger'}">{l s='Products' mod='headerchanger'} | {l s='Web Design' mod='headerchanger'} | getPageLink('/contact-us', true)}" title="{l s='Contact Neon Flame' mod='headerchanger'}">{l s='Contact Us' mod='headerchanger'} | {l s='Welcome' mod='headerchanger'}, {if $logged} {$customerName} (getPageLink('index.php')}?mylogout" title="{l s='Log me out' mod='headerchanger'}">{l s='Log out' mod='headerchanger'}) {else} getPageLink('my-account.php', true)}">{l s='Log in' mod='headerchanger'} {/if} ' ; } } // End of: headerchanger.php
  6. Hi, I've created a few custom modules using some very simple code. I am using multiple languages on my website and want to add translations to my modules however whenever I use the following commands in the code for my modules my front office goes blank after reaching the custom module, that is to say everything on the page loads as normal up until the custom module and then the page load stops leaving only blank areas after the custom module. Code I am using for the translations: {l s='Welcome to Neon Flame' mod='homechanger'} I place this code into my homechanger.php file inside the class: public function hookHome() { return '{l s='Welcome to Neon Flame' mod='homechanger'}'; } I am not using a .tpl file or back office configuration, I'm simply using the homechanger.php file to directly modify the html output. If you have any ideas of where I am going wrong or if you know of any relevant documentation on creating prestashop modules with translations then I would be very greatful if you could reply here. Kind regards, Mitchell Ransom
  7. No idea of the release date, it's on beta version 5 now though so I would say it's less than a month away for sure. Basically when you upgrade you just have to do all your modifications again, it's easier than when you first did it because you already have the code you modified but it's certainly a pain to have to do it all again.
  8. It's the biggest pain in the ass ever to upgrade. But when the official 1.4 is released I seriously recommend taking the time and effort to upgrade. It's just too good not to upgrade to.
  9. Normally there are small differences between the browsers always, but if your code is clean and up to date then there shouldn't be any huge problems. It's always best to test using firefox and chrome then test in internet explorer afterwards to see if theres any bugs.
  10. OK I found a tempoary solution which is better than no solution I guess but it seems like a huge amount of work for something so simple. I've created a new module to replace the home text editor. This module is virtually blank and has no configuration, it simply allows you to insert your own html code however you like. Unfortunatally it doesn't seem to accept scripts so the solution for that is to make a custom html page and upload it to your website, then use an iframe tag inside my module to display the content you want. I'm still looking for a better solution so if anyone has ideas please contact me with them. Below is my module code so I hope it helps. <?php class HomeChanger extends Module { private $_html = ''; function __construct() { $this->name = 'homechanger'; parent::__construct(); $this->tab = 'Homepage'; $this->version = '0.1.1'; $this->displayName = $this->l('Homepage Changer'); $this->description = $this->l('Use this module to edit the homepage html.'); } public function install() { parent::install(); if (!$this->registerHook('home')) return false; } public function hookHome() { return ' <!-- MODULE Homepage Changer --> <!-- Add your own HTML between these 2 comments and it will display on the homepage. --> <iframe width="550" height="200" scrolling="no" name="homeGallery" src="http://www.neonflame.co.uk/homegallery/homegalleryDefault.html" frameborder="0"></iframe> <!-- /MODULE Homepage Changer --> '; } } // End of: homechanger.php
  11. In google chrome simply right click on the page and click view source. And yes basically your looking for the names of the classes which are inside the id="" parameters. They don't have to be divs but searching there will get you started on finding what you are looking for. In my experience learning where to look is a much better fix than a simple copy and paste code, this way you will be better able to solve problems without help in future, and if you are new to e-commerce sites then believe me there will be plenty of problems to solve
  12. Most of this can be solved under the /* global layout */ section in the global.css file. If you eneable your shop at www.protectandenhance.co.uk so I can view the source I might be able to give you some more hints but for now all I can say is explore the global.css
  13. Navigate to your themes folder, inside the theme you are using open the css folder and open global.css Then use the search button to find these lines; /* global layout */ #page { width: 980px; margin: 0 auto 2px auto; text-align: left } Changing this value will affect a lot of different things on your site, but this is where you can start, backup before making changes and have a play around you might just be able to do what you need.
  14. I've been reading forums all day and playing around and I cannot seem to make some changes to these files. I am trying to add a gallery and some custom html code into the centre colum on the homepage. The gallery requires adding extra css and script file links between the head tags. I understand that this code must be placed into the header.tpl file in the relevant theme folder. When I place the links into header.tpl refresh my homepage and view the sorce the links are not showing up. That's problem number 1. Problem number 2. I want to place the gallery code and some other html into editorial.tpl and display this on the homepage. I placed my code between the tags, refreshed the homepage and there was no change at all, despite deleting the code that was already in editorial.tpl for displaying text and an image the old text and image still remained there. I have refreshed all cache and deleted tempoary files etc. I can change the text using the module in the back office and these changes show, but any change to the code in editorial.tpl does not show at all. As a last resort I tried inserting code directly into index.tpl and as with editorial.tpl no change could be seen in the front office. I've searched around all day trying to find a solution for this, theres many people with similar problems but there doesn't seem to be any solutions on the forums. I've run out of things to try so any help would be appreciated, thanks. Kind regards, Mitchell Ransom Code I want inserted into the header file: [removed][removed] [removed][removed] [removed][removed] [removed][removed] <link rel="stylesheet" href="homegallery/css/layout.css" type="text/css" media="screen" charset="utf-8" /> <link rel="stylesheet" href="homegallery/css/jd.gallery.css" type="text/css" media="screen" charset="utf-8" /> Code I want inserted into the homepage centre colum: [removed] var myGallery; function startGallery() { var myGallery = new gallery($('myGallery'), { timed: true, delay: 8000, showArrows: true, showCarousel: false, showInfopane: true }); var galleryDiv = $('myGallery'); galleryDiv.addEvent('mouseenter', function() { myGallery.clearTimer(); }); galleryDiv.addEvent('mouseleave', function() { myGallery.prepareTimer(); }); } window.addEvent('domready', startGallery); [removed] Corsair Obsidian Series 800D Full-Tower Case The Obsidian Series 800D is built to last through years of motherboard, power, memory, cooling and component upgrades! Perfect for gaming enthusiasts and professionals. NVidia GEFORCE GTX 580 Fast. Quiet. Deadly. The perfect weapon behind enemy lines. Meet the worlds fastest graphics card. Extra HTML and Text I want to add here.
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More