
Nozonda
Members-
Posts
9 -
Joined
-
Last visited
Profile Information
-
Activity
Web development agency
Nozonda's Achievements
Newbie (1/14)
5
Reputation
-
Hello all, For some clients I am running Prestashop 1.4 and 1.5 websites. And it seems that in 1.4 the cart is not emptied when the payment process starts, so the order is made after the payment process. In 1.5 it seems that the order is made just before the payment process starts. My client with 1.5 prefers if the order is not yet made before the payment is finished. This way the visitors can still select a different payment method when they close the current payment method (according to them, this happens a lot.) Now the visitor's cart will be emptied even if they didn't pay and their order will be 'expired' after a while. Does anyone know a way to change this? Is there a module that can help for this? Can I change the payment method to work like that? Or could I save the Cart ID in a session and reload it on page request or smth? I hope someone can help us. Thanks in advance! Regards, Nico
-
Hello all, For some clients I am running Prestashop 1.4 and 1.5 websites. And it seems that in 1.4 the cart is not emptied when the payment process starts, so the order is made after the payment process. In 1.5 it seems that the order is made just before the payment process starts. My client with 1.5 prefers if the order is not yet made before the payment is finished. This way the visitors can still select a different payment method when they close the current payment method (according to them, this happens a lot.) Now the visitor's cart will be emptied even if they didn't pay and their order will be 'expired' after a while. Does anyone know a way to change this? Is there a module that can help for this? Or would I need to change the module of the payment method (would that be realistic / doable?) I hope someone can help us. Thanks in advance. Regards, Nico
-
[solved] Website very slow! Back office ok
Nozonda replied to mindaugelis's topic in Feedback On My Store
Try changing to another (default) theme. Try disabling all non-default plugins. Run your site local and debug some more. If that all doesn't work I would personally probably just install a new shop and then copy products, categories, orders, etc. Btw, always make backups. -
[solved] Website very slow! Back office ok
Nozonda replied to mindaugelis's topic in Feedback On My Store
Quick thing you can do, remove all files and directories from: /cache/cachefs/* /tools/cache/* /tools/compile/* And set settings back to caching etc. If that doesn't work I would disable plugins 1 by 1, especially the ones that you changed lately. Good luck. -
[solved] Website very slow! Back office ok
Nozonda replied to mindaugelis's topic in Feedback On My Store
Set this in performance settings: Smarty Force compile: no Cache: yes Cache Use cache: yes Cache type: filesystem Hope it helps. -
Translation problem in Blocks Modules
Nozonda replied to z4m0lx3's topic in Taxes, Translations & Laws
Hey guys, I also had this problem (with version 1.4.7.3) and decided to look into the code to fix it The problem is that the function to write the files, first checks if a file exists, if not, it will make it. Then it checks if the content is empty or not, if it is empty it ignores it and otherwise it writes it. So I changed that a bit. I made it so it will not make an empty file if the content is empty. What I did: First delete all the empty language files from themes/yourtheme/modules/*/ Then open /admin/tabs/AdminTranslations.php, search for the function findAndWriteTranslationsIntoFile Change: // Set file_name in static var, this allow to open and wright the file just one time if (!isset($_cache_file[($is_default ? self::DEFAULT_THEME_NAME : $theme_name).'-'.$file_name]) ) { $str_write = ''; $_cache_file[($is_default ? self::DEFAULT_THEME_NAME : $theme_name).'-'.$file_name] = true; if (!file_exists($file_name)) file_put_contents($file_name, ''); if (!is_writable($file_name)) die ($this->l('Cannot write the theme\'s language file ').'('.$file_name.')'.$this->l('. Please check write permissions.')); // this string is initialized one time for a file $str_write .= "<?php\n\nglobal \$_MODULE;\n\$_MODULE = array();\n"; $array_check_duplicate = array(); } to: // FIX BY NOZONDA - NICO // Fix: first get all the content, then check if it's not empty, and if not > make file. // Set file_name in static var, this allow to open and wright the file just one time if (!isset($_cache_file[($is_default ? self::DEFAULT_THEME_NAME : $theme_name).'-'.$file_name]) ) { // this string is initialized one time for a file $str_write = "<?php\n\nglobal \$_MODULE;\n\$_MODULE = array();\n"; $array_check_duplicate = array(); } // END OF FIX BY NOZONDA - NICO And after the foreach() loop add: // FIX BY NOZONDA - NICO if (!isset($_cache_file[($is_default ? self::DEFAULT_THEME_NAME : $theme_name).'-'.$file_name]) && $str_write != "<?php\n\nglobal \$_MODULE;\n\$_MODULE = array();\n") { $_cache_file[($is_default ? self::DEFAULT_THEME_NAME : $theme_name).'-'.$file_name] = true; if (!file_exists($file_name)) file_put_contents($file_name, ''); if (!is_writable($file_name)) die ($this->l('Cannot write the theme\'s language file ').'('.$file_name.')'.$this->l('. Please check write permissions.')); } // END OF FIX BY NOZONDA - NICO I think making changes in the core is very bad, but in this case it seems necessary. That is why I added my own name and company name as comment. I recommend you all to do the same with all core changes. This way you can easily find all core changes when you update Prestashop. Good luck. -
Little bit like his example, but then: for($i=0;$i<1000;$i++){ $accessroyImport = new AccessoryImporter(); $accessroyImport ->SetProductSource(array()); $accessroyImport ->Save(); } And then edit AccessoryImporter.php to make some random values. Like: protected function GetName(){ return "this is a random title ".rand(100000,999999); } You have to change almost every function in there to return something. For features you could use: protected function GetFeatures(){ return array('test'=>'bla','sfdsfd'=>'fsfd'); } Attributes is currently not supported, but shouldn't be too complicated to make if you look at the function AddFeature in ProductImporter.php. Good luck.
-
Even though it is a while ago that this is posted.. I just want to say thank you! Works great I am connecting an web service to get the products and your classes saved me a lot of time.
-
Today I'm working on a shop that has a top menu (blocktopmenu) with the categories. The menu on the left (blockcategories) should show only the subcategories (or only the main categories on the homepage and information pages.) Example, these are the categories: -Shoes: Running Boots Heels -T-shirt Blue Red Yellow What I wanted for this shop: On the home page it would show: Shoes, T-shirt And when you go to Shoes it would show: Running, Boots, Heels And when you go to Boots it would still show: Running, Boots, Heels So I changed my category-tree-branch.tpl, here is my code: /themes/theme-name/modules/blockcategories/category-tree-branch.tpl {assign var="show_child" value="false"} {if !isset($currentCategoryId)} <li {if isset($last) && $last == 'true'}class="last"{/if}> <a href="{$node.link}" title="{$node.desc|escape:html:'UTF-8'}">{$node.name|escape:html:'UTF-8'}</a> </li> {/if} {if isset($currentCategoryId) && ($node.id == $currentCategoryId)} {assign var="show_child" value="true"} {/if} {if $node.children|@count > 0} {foreach from=$node.children item=child name=categoryTreeBranch} {if isset($currentCategoryId) && ($child.id == $currentCategoryId)} {assign var="show_child" value="true"} {/if} {/foreach} {/if} {if $show_child == 'true'} {if $node.children|@count > 0} {foreach from=$node.children item=child name=categoryTreeBranch} {if isset($smarty.foreach.categoryTreeBranch) && $smarty.foreach.categoryTreeBranch.last} {include file="$branche_tpl_path" node=$child show='true' last='true'} {else} {include file="$branche_tpl_path" node=$child show='true' last='false'} {/if} {/foreach} {if $child.children|@count > 0} {foreach from=$child.children item=child2 name=categoryTreeBranch2} {if isset($currentCategoryId) && ($child2.id == $currentCategoryId)} {assign var="show_child" value="true"} {/if} {/foreach} {/if} {/if} {/if} {if isset($show)} <li {if isset($last) && $last == 'true'}class="last"{/if}> <a href="{$node.link}" {if isset($currentCategoryId) && ($node.id == $currentCategoryId)}class="selected"{/if} title="{$node.desc|escape:html:'UTF-8'}">{$node.name|escape:html:'UTF-8'}</a> {if $node.children|@count > 0} <ul> {foreach from=$node.children item=child name=categoryTreeBranch} {if isset($smarty.foreach.categoryTreeBranch) && $smarty.foreach.categoryTreeBranch.last} {include file="$branche_tpl_path" node=$child show='true' last='true'} {else} {include file="$branche_tpl_path" node=$child show='true' last='false'} {/if} {/foreach} </ul> {/if} </li> {/if} Not sure if this example is what you guys want, but I though I will just share it. Also perhaps this code is not optiomal, but at least it works for me