Jump to content

morrisa

Members
  • Posts

    10
  • Joined

  • Last visited

Profile Information

  • Location
    Wirral, UK
  • Activity
    Freelancer

morrisa's Achievements

Newbie

Newbie (1/14)

1

Reputation

2

Community Answers

  1. Nemo1, In /override/controllers/front I created CategoryController.php and in there added: class CategoryController extends CategoryControllerCore { // array with the selected categories private $customCategories = array(1051, 1052, 1053); public function init() { parent::init(); if (in_array($this->category->id, $this->customCategories)) { print $this->category->id; $this->setTemplate(_PS_THEME_DIR_.'category-type1.tpl'); } } } I know that the logic goes through the block of code that sets the category template as the category ID is printed at the top of the rendered page. What I don't know if when this code is executed in relation to parent - is it before, instead of, or after? I've been able to get the template switch to take place by adding the code to /controllers/front/CategoryController.php, but would rather not do this. Thanks for the link to the page discussing overrides - I'll have a look at this. Alan
  2. I'm using PrestaShop 1.6.0.9. I need to override the default category layout for specific category IDs and have created an override CategoryController.php to do this. I need to change the default_subcat image to another of a different size that I have set up. For specific category IDs I am executing $this->setTemplate(_PS_THEME_DIR_.'category-type2.tpl'); I believe that this code is being executed as if I put "print $this->category->id;" in the same block, the category IDs of those I would like to override is shown at the top of the page. However, it seems that the default category template is being used and that the override is not effective. I cannot see any errors or other messages, just the category ID being displayed for the specific categories I need to override. Why might this be? I have cleared the cache several times. Any help would be much appreciated! Thanks, Alan
  3. On the question of the display of tax, I've noticed that at line 719 of the amended product.js is if (noTaxForThisProduct) Is this the right way round? If I change the first line to if (!noTaxForThisProduct) Then the tax inclusive price is used and the total is displayed with tax. However, I then ran into the issue with Javascript floating point arithmetic that resulted in the calculated price being wrong. I changed { basePriceDisplay = basePriceWithoutTax * (taxRate/100 + 1) * currentVal; priceWithDiscountsDisplay = priceWithDiscountsWithoutTax * (taxRate/100 + 1) * currentVal; } else { basePriceDisplay = basePriceWithoutTax * currentVal; priceWithDiscountsDisplay = priceWithDiscountsWithoutTax * currentVal; } to { basePriceDisplay = (Round((basePriceWithoutTax*100) * (taxRate/100 + 1),0) * currentVal)/100; priceWithDiscountsDisplay = (Round((priceWithDiscountsWithoutTax*100) * (taxRate/100 + 1),0) * currentVal)/100; } else { basePriceDisplay = ((basePriceWithoutTax*100) * currentVal)/100; priceWithDiscountsDisplay = ((priceWithDiscountsWithoutTax*100) * currentVal)/100; } The Round function came from http://joncom.be/code/javascript-rounding-errors/ This seemed to fix the problem for me and my calculated prices are now correct. I use the first block of the code (my prices are inclusive of tax) and so the second block may need checking. I hope this helps move things along. My revised product.js is attached as product.js.txt - I couldn't upload it without the .txt extension! product.js.txt Alan
  4. I found that the Date of Birth field seems to be coming from code further down in authentication.tpl - I'd commented out the block at line 133, but the code that actually places the field on the page appears to be at line 452. Having commented this out, the Date of Birth field no longer appears. Thanks to the people who came back to me on this. Alan
  5. Thanks for coming back on this - I commented out this code in authentication.tpl, identity.tpl and order-opc-new-account.tpl (though I'm not configured for OPC), where these files are in /themes/mytheme, which is active. I have also tried deleting the code. I have flushed the PrestaShop cache both manually and in the BO interface and recompiled the templates, but the Date of Birth field still appears. I have also flushed my browser cache and tried different browsers. Do you have any ideas on where the Date of Birth field is coming from? Many Thanks, Alan
  6. Thanks for coming back on this issue. Localization, Countries shows Date of Birth as a field that can be included in the Address Format, but I can see no option to include or exclude it from the User Registration process. Where exactly is it being generated? Thanks, Alan
  7. There are several posts about how to remove the Date of Birth field from the information on the user registration form. I'm using 1.6.0.5 and have commented out the DoB code in authentication.tpl, identity.tpl and order-opc-new-account.tpl (though I'm not configured for OPC), where these files are in /themes/mytheme, which is active. I have cleared the cache in Advanced Parameters, Performance and have forced recompilation many times. I've also manually deleted the Smarty cache. I have also cleared my browser cache and tried different browsers. However, Date of Birth still appears in the user registration form. Could anyone suggest a way to remove this field, which works in 1.6.0.5? Many Thanks, Alan
  8. Vekia, Thanks for coming back on this, which I've now figured out. I'm running PrestaShop in a subdirectory, using the instructions at http://dobetterit.com/prestashop-in-sub-folder/ What happened was instead of accessing the BO as http://mydomain/admin12345 I ended up accessing as http://mydomain/subdir/admin12345. When the subdirectory was included, all the BO pages looked fine, but I noticed that I couldn't see the category tree and after digging deeper found that JQuery and several other .js files were not being loaded. I saw the errors "ReferenceError: $ is not defined" and so went to look at why this might be. Anyway, after taking the subdirectory out of the path, I found that everything was actually working correctly. I hope this helps anyone using this sort of config, should they run into the problem I had. Thanks again for coming back to me on this. Alan
  9. Along with other people I am having a problem with JQuery not being loaded. I was running at 1.5.6.0 when I spotted this and so I upgraded to 1.5.6.1 using the 1 Step Upgrade process, which reported that the upgrade had completed successfully. The errors "ReferenceError: $ is not defined" continued to appear after this. From other postings I uploaded the admin and js directories from a new download of 1.5.6.1. I have checked the version of JQuery in defines.inc.php and that this matches with the js/jquery/jquery-1.7.2.min.js. I've also checked for PHP errors on the server and this looks clean. The problem seems to be that the code to load JQuery is missing from the HTML being generated for the Admin pages. Can anyone suggest what will fix this?
×
×
  • Create New...