Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by sooly

  1. Solution is to add ob_clean(); at begginning of function.
  2. Is there any way to speed up deleting? We are having eshop with 300 000 products and deleting one of them takes around 3 minutes. I need to bulk delete around 300 products with specified product reference code.
  3. Hello dear Prestashopers, my question is simple and none of tips i found here on forums didnt help. When I have eshop with 300 000+ product and want to bulk delete 100 products deleting becomes extremly slow. For example it deletes 1 product per 2 minutes. Is there any way to speed it up?
  4. You can access functions of your module anywhere in .tpl files by {YourModule::yourFunction()} and set if like {if YourModule::yourFunction() != 1} Hello {/if}
  5. Im trying to pass my own variable from module to template file .tpl I have this code that is used for displaying availability in eshop. Product.tpl {if $product.availability == 'available'} {if $product.quantity <= 0 && $product.allow_oosp} {if isset($product.available_date) && $product.available_date != '0000-00-00'} <i class="fa fa-truck rtl-no-flip" aria-hidden="true"></i> {$product.availability_message} ({if $product.available_date|strtotime > $smarty.now}<span class="available-date">{l s='naskladnění' d='Shop.Theme.Catalog'} {$product.available_date|date_format:"%d.%m.%Y"}</span>{/if}) {/if} {/if} {/if} Then Im having my own module where im assigning value to smarty Mymodule.php $in_stock = 1; $this->context->smarty->assign("is_in_stock", $in_stock); My question is if there is any way to access my smarty variable directly from theme tpl? I need to set up another {if else} with that variable but cant access it. When I add variable to custom hook I cant access it neither.. Or maybe I dont know how. I tried to create front controller but nothing happened. Something like {if isset($product.available_date) && $mymodule.is_in_stock = 1 && $product.available_date != '0000-00-00'} php prestashop
  6. Its awesome, but im getting 404 errors on cms pages and manufacturer pages with same ID as category IDs. Only solution i found is by adding "/" at the end of category urls.
  7. Hello dear community.. im having eshop with over 200 000 products and when I try to load prestools, im getting timeout errors or errors like this: Error: MySQL error 2006: mysql server has gone away I have already set up script timeout to 1800s, also did this on server: [mysqld] max_allowed_packet=500M But it still doesnt work well.. is there any solution or workaround? Thanks for any ideas.
  8. Hello everyone, Im having eshop with 400 000 products and my search queries takes about 9 seconds to process. I have indexed everything. Our MYSQL runs on SSD. Search priorities are set to : Product name : 10 Product refference : 5 Others: 0 webpage: https://powerparts.cz Is there any way to speed up search? Or recode search.php ? Thanks.
  9. We need it in short description because we are exporting XML to google merchant and we have short description blank. So we want to have product featrues there. Any ideas ? 😕
  10. We have eshop with batteries. We have stored informations like capacity or voltage in features. I would like to take these features and put them in short description so customer can see it.
  11. In "public function validateField". Should I place it anywhere else ?
  12. Thanks for help but thats probably not what im looking for. In ProductController.php im able to use code for displaying product features: if (isset($this->product)){ $features = $this->product->getFrontFeatures($this->context->language->id); $vypis = $features[0]['name']; $this->product->description=str_replace("{FEATURE_VAR}","{$vypis}","{$this->product->description}"); } but in Product.php this doesnt work.
  13. Hello, im trying to make some changes in short description but i can't find which files should i edit. In long description its ProductController.php but i have no idea how short description is being processed. Anyone has idea? Thanks
  14. Hello, I would like to hide last text block from breadcrumb navigation on mobile phones. Example (on product page): Notebooky > Adaptéry k notebookům > Adaptéry náhradní > Nabíječka na notebook acer 19v 3.42a (5.5x1.7) Im trying to make it look like this: Notebooky > Adaptéry k notebookům > Adaptéry náhradní I have already tried some CSS, Javascript and editing breadcrumb.tpl but I dont understand how are breadcrumbs made. Could anyone help ? Thanks. Code in breadcrumb.tpl <!-- Breadcrumb --> {if isset($smarty.capture.path)}{assign var='path' value=$smarty.capture.path}{/if} <div class="breadcrumb clearfix {if isset($warehouse_vars.breadcrumb_width) && $warehouse_vars.breadcrumb_width == 0}fullwidth-breadcrumb{/if}"> {if isset($warehouse_vars.breadcrumb_width) && $warehouse_vars.breadcrumb_width == 0}<div class="container">{/if} <a class="home" href="{if isset($force_ssl) && $force_ssl}{$base_dir_ssl}{else}{$base_dir}{/if}" title="{l s='Return to Home'}"><i class="icon-home"></i></a> {if isset($path) AND $path} <span class="navigation-pipe"{if isset($category) && isset($category->id_category) && $category->id_category == (int)Configuration::get('PS_ROOT_CATEGORY')} style="display:none;"{/if}>{$navigationPipe|escape:'html':'UTF-8'}</span> {if $path|strpos:'span' !== false} <span class="navigation_page">{$path|@replace:'<a ': '<span itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a itemprop="url" '|@replace:'data-gg="">': '><span itemprop="title">'|@replace:'</a>': '</span></a></span>'}</span> {else} {$path} {/if} {/if} {if $page_name == 'product'} {hook h='productnavs'} {/if} {if isset($warehouse_vars.breadcrumb_width) && $warehouse_vars.breadcrumb_width == 0}</div>{/if} </div> <!-- /Breadcrumb --> Generated HTML code by breadcrumb.tpl <div class="breadcrumb clearfix "> <a class="home" href="https://powerparts.cz/" title="Zpět na hlavní stránku"> <i class="icon-home"></i></a> <span class="navigation-pipe">&gt; </span> <span class="navigation_page"> <span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"> <a itemprop="url" href="https://powerparts.cz/457-notebooky/" title="Notebooky"> <span itemprop="title">Notebooky </span></a> </span> <span class="navigation-pipe">&gt; </span> <span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"> <a itemprop="url" href="https://powerparts.cz/50-adaptery-k-notebookum/" title="Adaptéry k notebookům"> <span itemprop="title">Adaptéry k notebookům </span></a> </span> <span class="navigation-pipe">&gt; </span>Nabíječka na notebook acer 19v 3.42a (5.5x1.7) </span> <div id="productsnavpn" class="pull-right"> </div> </div> Example: https://i.imgur.com/VGbqRqg.png
  15. Hello, I would like to add customers email address right next to their name in backoffice. Screen of how it should look like: https://i.imgur.com/vTes488.png Does anyone know, how to ? Thanks!
  16. Hello, Im trying to update prestashop on my localhost, but everytime it comes to database update I get an error: "[INTERNAL] C:\xampp\htdocs\pwr3\classes\Validate.php line 27 - Cannot declare class ValidateCore, because the name is already in use" https://i.imgur.com/qMpLTfL.png Apache log: "[Thu Sep 20 16:21:45.010145 2018] [php7:error] [pid 7048:tid 1660] [client ::1:57404] PHP Fatal error: Cannot declare class ValidateCore, because the name is already in use in C:\\xampp\\htdocs\\pwr3\\classes\\Validate.php on line 27, referer: http://localhost/pwr3/admin151561hba/index.php?controller=AdminSelfUpgrade&token=f1fed8131378770ed8b989a8866d8f1d" Im using latest 1 click update module version (4.2) I have no clue where could the problem be. Tried to update it 3x and always the same. Is there any other way to update database? Thanks for any help.
  17. Hello, im running presta and when I go to module page or script page, im getting blank page. https://i.imgur.com/axlB2Dx.png When I turn ON debug mode, it shows nothing. Server log is empty aswell. Do you know where the problem could be?
  18. I have a question about Prestashop smarty. I would like to display a product features in product description but I dont know which smarty should I use in new prestashop. In version 1.6 it was this code: {foreach from=$features item=feature} {if $feature.id_feature = 1} <tr> <td>{$feature.value|escape:'htmlall':'UTF-8'}</td> <td>{$feature.id|escape:'htmlall':'UTF-8'}</td> </tr> {/if} {/foreach} Does anyone know right solution for Prestashop 1.7? Thank you!
  19. Solved. Way to get around was to copy link of clear cache witch ctrl+c (for me it was http://website.cz/admin123456/index.php/configure/advanced/clear_cache?_token=wcagvRixFKsTeu_rcwdsmx21mC-W1D86KxSjPcAhGyA .. turning debugging OFF -> getting error again -> paste url of clear cache to browser and hit enter.
  20. Hello, I made a eshop on localhost and tried to move it to live website. When i turn debugging TRUE, everything works but when I turn it OFF, eshop gives me this error. Is is connected with cache? How do I force symfony to regenerate bootstrap.php.cache ? Error appears when I try to go to products page or performance page. Cache is turned off. Server sided cache is off aswell. Thanks.Fatal error: Uncaught exception 'Symfony\Component\Validator\Exception\MappingException' with message 'The mapping file "/www/teleskopy24_www/www\vendor\symfony\symfony\src\Symfony\Component\Form/Resources/config/validation.xml" does not exist' in /www/teleskopy24_www/www/vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Loader/FileLoader.php:38 Stack trace: #0 /www/teleskopy24_www/www/vendor/symfony/symfony/src/Symfony/Component/Validator/ValidatorBuilder.php(328): Symfony\Component\Validator\Mapping\Loader\FileLoader->__construct('/www/teleskopy2...') #1 /www/teleskopy24_www/www/app/cache/prod/appProdProjectContainer.php(4628): Symfony\Component\Validator\ValidatorBuilder->getValidator() #2 /www/teleskopy24_www/www/app/bootstrap.php.cache(2252): appProdProjectContainer->getValidatorService() #3 /www/teleskopy24_www/www/app/cache/prod/appProdProjectContainer.php(1595): Symfony\Component\DependencyInjection\Container->get('validator') #4 /www/teleskopy24_www/www/app/bootstrap.php.cache(2252): appProdProjectCo in /www/teleskopy24_www/www/app/bootstrap.php.cache on line 3231
  • Create New...

Important Information

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