Search the Community
Showing results for tags 'var'.
-
[SOLVED] Slow Performance When Customer Have a Lot of Orders
duredo posted a topic in General topics
hi, I have reseller that have a lot of orders. the problem is when they login, it will get slower and slower. my suspicious, because prestashop load all saved addresses. if my reseller have 1000 addresses, then it will load 1000 addresses. I can see in view-source: var prestashop = {"addresses": can we limit the var prestashop = {"addresses": just 100 or 200? how to do this, I can edit code. but don't know how to. thank you -
Hallo Zusammen Ich habe auf die neuste Version upgedatet (PS 1.7.8.3 mit PHP 7.4). Leider erhalte ich von Zeit zu Zeit im Backoffice plötzlich eine Blank Page ohne Fehlermeldung. Ich kann danach nichts mehr machen. Bin ausgesperrt vom Backoffice. Kann alle Browser Cookies löschen, bringt alles nichts mehr. Dies passiert einfach, wenn ich im Backoffice arbeite, egal was ich drücke, ob Bestellungen ansehen, Thema anklicke oder unter Einstellungen den Cache löschen will. Plötzlich kommt die Blank Page. Danach muss ich das Verzeichnis /var/prod löschen, erst ab dann habe ich wieder Zugriff. Ist nicht effektiv, täglich das Verzeichnis 2-mal zu löschen. Ich habe mem-cache installiert und nutze zusätzlich noch das Modul JPresta - Page Cache Ultimate. Im Error-Log habe ich folgenden Fehler: [Thu Feb 24 08:08:24.336276 2022] [fcgid:warn] mod_fcgid: stderr: PHP Fatal error: Uncaught Symfony\\Component\\Filesystem\\Exception\\IOException: Cannot rename "//var/cache/prod/Container8sngpr4/getPrestashop_Adapter_Category_CommandHandler_EditRootCategoryHyg63EM" to "//var/cache/prod/Container8sngpr4 /getPrestashop_Adapter_Category_CommandHandler_EditRootCategoryHandlerService.php". in //vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php:289, referer: /improve/design/themes-catalog/?_token=xQxGZOAf577YRmCYUv7WSQEKUwSwChFTMkxV6h-IbJA [Thu Feb 24 08:08:24.336874 2022] [fcgid:warn] mod_fcgid: stderr: Stack trace:, referer: improve/design/themes-catalog/?_token=xQxGZOAf577YRmCYUv7WSQEKUwSwChFTMkxV6h-IbJA [Thu Feb 24 08:08:24.336884 2022] [fcgid:warn] mod_fcgid: stderr: #0 //vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php(693): Symfony\\Component\\Filesystem\\Filesystem->rename('/XXX/XXX/w...', '/XXX/XXX/w...', true), referer: /improve/design/themes-catalog /?_token=xQxGZOAf577YRmCYUv7WSQEKUwSwChFTMkxV6h-IbJA [Thu Feb 24 08:08:24.336888 2022] [fcgid:warn] mod_fcgid: stderr: #1 /vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(868): Symfony\\Component\\Filesystem\\Filesystem->dumpFile('/XXX/XXX/w...', '<?php\\n\\nuse Symf...'), referer: /improve/design/themes-catalog/?_token=xQxGZOAf577YRmCYUv7WSQEKUwSwChFTMkxV6h-IbJA [Thu Feb 24 08:08:24.336891 2022] [fcgid:warn] mod_fcgid: stderr: #2 // in /home/ch63302/web/www.anjasshop.ch/public_html/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php on line 289, referer: improve/design/themes-catalog/?_token=xQxGZOAf577YRmCYUv7WSQEKUwSwChFTMkxV6h-IbJA Leider finde ich keinen Ähnlichen Fehler bei Google oder im Forum. Hat jemand eine Idee was der Grund sein könnte? Besten Dank für eure Hilfe. ANjAS-SHOP
-
- blank page
- symfony
-
(and 1 more)
Tagged with:
-
I have recently upgraded to ps 1.7.4.2 . I found a fix to some of the issues I encountered. No major problems. I lost access to all my modules, I can no longer configure them, with this error message " You are not authorized to configure a module" This issue started after I removed my ps-access table and replaced it with a clean ps-access DB as I had problem accessing my orders and stats menu. This action solved the issue I had with orders and stats menu, however, it caused issues to configure my modules In the images are more details of the issues. Please does somebody have explanations for these errors? Thank you for your help in advance
-
Prestashop-Version: 1.6.0.6 EDIT: fadeToggle(); did the trick, don't need to know the id at this point. I did an onchange-event for the radio-buttons in order-carrier.tpl: <input id="delivery_option_{$id_address}_{$option@index}" class="delivery_option_radio" type="radio" name="delivery_option[{$id_address}]" data-key="{$key}" data-id_address="{$id_address|intval}" onclick="handleClick(this)" onchange="yeon();" value="{$key}"{if isset($delivery_option[$id_address]) && $delivery_option[$id_address] == $key} checked="checked"{/if} /> Following code works in Chrome: function yeon() { if ($('#delivery_option_8_1').is(':checked')) { $('#abhol').show(); } else { $('#abhol').hide(); [spam-filter]; but for Firefox it needs to be 4_1 not 8_1: function yeon() { if ($('#delivery_option_4_1').is(':checked')) { $('#abhol').show(); } else { $('#abhol').hide(); [spam-filter]; And I dont know about the other browsers. The best thing would be if it would be possible to set: #delivery_option_*_1 So the star could be anything. I also tried detecting the browser like: function yeon2() { var isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; // Opera 8.0+ (UA detection to detect Blink/v8-powered Opera) var isFirefox = typeof InstallTrigger !== 'undefined'; // Firefox 1.0+ var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0; // At least Safari 3+: "[object HTMLElementConstructor]" var isChrome = !!window.chrome && !isOpera; // Chrome 1+ var isIE = /*@cc_on!@*/false || !!document.documentMode; // At least IE6 yeon(); }; in combination with: function yeon() { if (isChrom) { if ($('#delivery_option_8_1').is(':checked')) { $('#abhol').show(); } else { $('#abhol').hide(); } } if (isFirefox) { if ($('#delivery_option_4_1').is(':checked')) { $('#abhol').show(); } else { $('#abhol').hide(); } } } I can imagine that my coding is noob-style (sorry for that), but Im open for any suggestions. (I don't mind putting my code into the trash) I would be very happy if anyone could help me. Thanks soo much
-
I saw some topics in this forum. It's said Prestashop 1.5 doesnt use $_SESSION. They recommend to use $cookie->myvar = myvalue to store var. I tried, but it is stored in the cookie, and value cannot be array, but only string. Meanwhile, I want the var expires when the session is over. But according to the method above, when I close brower, open it again, the var is still there. So, how does Prestashop1.5 simulate the SESSION? Any help would be very appreciated.
-
Hello everyone, I have e-shop on prestashop version 1.4.7.3. Today I did upgrade on prestashop version 1.5.6.0. In the administration, when I click on the customer who has performed an invalid order or I the order canceled - error will be displayed. PLEASE HELP ME [PrestaShopException] Invalid product vars at line 104 in file classes/Link.php 98. if (is_array($product) && isset($product['id_product'])) 99. $product = new Product($product['id_product'], false, $id_lang, $id_shop); 100. elseif ((int)$product) 101. $product = new Product((int)$product, false, $id_lang, $id_shop); 102. else 103. throw new PrestaShopException('Invalid product vars'); 104. } 105. 106. // Set available keywords 107. $params = array(); 108. $params['id'] = $product->id; LinkCore->getProductLink - [line 640 - controllers/admin/AdminCustomersController.php] - [6 Arguments] 634. $product->link_rewrite, 635. Category::getLinkRewrite($product->id_category_default, $this->default_form_language), 636. null, 637. null, 638. $interested[$i]['cp_id_shop'] 639. ); 640. $interested[$i]['id'] = (int)$product->id; 641. $interested[$i]['name'] = Tools::htmlentitiesUTF8($product->name); 642. } 643. 644. $connections = $customer->getLastConnections(); AdminCustomersControllerCore->renderView - [line 1495 - classes/controller/AdminController.php] - [0 Argument] 1489. elseif ($this->display == 'view') 1490. { 1491. // Some controllers use the view action without an object 1492. if ($this->className) 1493. $this->loadObject(true); 1494. $this->content .= $this->renderView(); 1495. } 1496. elseif (!$this->ajax) 1497. { 1498. $this->content .= $this->renderModulesList(); 1499. $this->content .= $this->renderList(); AdminControllerCore->initContent - [line 182 - controllers/admin/AdminCustomersController.php] - [0 Argument] 176. )); 177. 178. if (!$this->can_add_customer && !$this->display) 179. $this->informations[] = $this->l('You have to select a shop if you want to create a customer.'); 180. 181. parent::initContent(); 182. } 183. 184. public function initToolbar() 185. { 186. parent::initToolbar(); AdminCustomersControllerCore->initContent - [line 167 - classes/controller/Controller.php] - [0 Argument] 161. 162. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) 163. $this->initHeader(); 164. 165. if ($this->viewAccess()) 166. $this->initContent(); 167. else 168. $this->errors[] = Tools::displayError('Access denied.'); 169. 170. if (!$this->content_only && ($this->display_footer || (isset($this->className) && $this->className))) 171. $this->initFooter(); ControllerCore->run - [line 348 - classes/Dispatcher.php] - [0 Argument] 342. // Execute hook dispatcher 343. if (isset($params_hook_action_dispatcher)) 344. Hook::exec('actionDispatcher', $params_hook_action_dispatcher); 345. 346. // Running controller 347. $controller->run(); 348. } 349. catch (PrestaShopException $e) 350. { 351. $e->displayMessage(); 352. } DispatcherCore->dispatch - [line 53 - administracee/index.php] - [0 Argument] 47. $_POST['controller'] = strtolower($_POST['tab']); 48. if (!isset($_REQUEST['controller']) && isset($_REQUEST['tab'])) 49. $_REQUEST['controller'] = strtolower($_REQUEST['tab']); 50. 51. // Prepare and trigger admin dispatcher 52. Dispatcher::getInstance()->dispatch();
-
Hi! I have a variable assigned only in productcontroller and available in product.tpl. I need this variable to be available in product-list.tpl also. Here it is (from productcontroller) protected function assignPriceAndTax() { /*DIGISELLER*/ $xml=" <digiseller.request> <id_goods>REPLACEME</id_goods> </digiseller.request> "; $xml=str_replace("REPLACEME", (int)$this->product->reference ,$xml); function _GetAnswer($address, $xml){ $ch = curl_init($address); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_POST,1); curl_setopt($ch, CURLOPT_POSTFIELDS, $xml); $result=curl_exec($ch); return $result; } $answer=_GetAnswer("http://shop.digiseller.ru/xml/personal_goods_info.asp", $xml); $xmlres = simplexml_load_string($answer); foreach ($xmlres->price_goods->wmr as $price_goods) ; $xmlres = simplexml_load_string($answer); foreach ($xmlres->price_goods->wmu as $wmu ); self::$smarty->assign('product-list_tpl',$wmu ); $xmlres = simplexml_load_string($answer); foreach ($xmlres->price_goods->pcr as $pcr ); $xmlres = simplexml_load_string($answer); foreach ($xmlres->reward as $reward ); $xmlres = simplexml_load_string($answer); foreach ($xmlres->reward_summ as $arew ); $xmlres = simplexml_load_string($answer); foreach ($xmlres->reward_curr as $arewc ); $id_customer = (isset($this->context->customer) ? (int)$this->context->customer->id : 0); $id_group = (isset($this->context->customer) ? $this->context->customer->id_default_group : _PS_DEFAULT_CUSTOMER_GROUP_); $id_country = (int)$id_customer ? Customer::getCurrentCountry($id_customer) : Configuration::get('PS_COUNTRY_DEFAULT'); $group_reduction = GroupReduction::getValueForProduct($this->product->id, $id_group); if ($group_reduction == 0) $group_reduction = Group::getReduction((int)$this->context->cookie->id_customer) / 100; // Tax $tax = (float)$this->product->getTaxesRate(new Address((int)$this->context->cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')})); $this->context->smarty->assign('tax_rate', $tax); $product_price_with_tax = Product::getPriceStatic($this->product->id, true, null, 6); if (Product::$_taxCalculationMethod == PS_TAX_INC) $product_price_with_tax = Tools::ps_round($product_price_with_tax, 2); $product_price_without_eco_tax = (float)$product_price_with_tax - $this->product->ecotax; $ecotax_rate = (float)Tax::getProductEcotaxRate($this->context->cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); $ecotax_tax_amount = Tools::ps_round($this->product->ecotax, 2); if (Product::$_taxCalculationMethod == PS_TAX_INC && (int)Configuration::get('PS_TAX')) $ecotax_tax_amount = Tools::ps_round($ecotax_tax_amount * (1 + $ecotax_rate / 100), 2); $id_currency = (int)$this->context->cookie->id_currency; $id_product = (int)$this->product->id; $id_shop = $this->context->shop->id; $quantity_discounts = SpecificPrice::getQuantityDiscounts($id_product, $id_shop, $id_currency, $id_country, $id_group, null, true); foreach ($quantity_discounts as &$quantity_discount) if ($quantity_discount['id_product_attribute']) { $combination = new Combination((int)$quantity_discount['id_product_attribute']); $attributes = $combination->getAttributesName((int)$this->context->language->id); foreach ($attributes as $attribute) $quantity_discount['attributes'] = $attribute['name'].' - '; $quantity_discount['attributes'] = rtrim($quantity_discount['attributes'], ' - '); } $product_price = $this->product->getPrice(Product::$_taxCalculationMethod == PS_TAX_INC, false); $address = new Address($this->context->cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); $this->context->smarty->assign(array( 'quantity_discounts' => $this->formatQuantityDiscounts($quantity_discounts, $product_price, (float)$tax), 'ecotax_tax_inc' => $ecotax_tax_amount, 'ecotax_tax_exc' => Tools::ps_round($this->product->ecotax, 2), 'ecotaxTax_rate' => $ecotax_rate, 'productPriceWithoutEcoTax' => (float)$product_price_without_eco_tax, 'group_reduction' => (1 - $group_reduction), 'no_tax' => Tax::excludeTaxeOption() || !$this->product->getTaxesRate($address), 'ecotax' => (!count($this->errors) && $this->product->ecotax > 0 ? Tools::convertPrice((float)$this->product->ecotax) : 0), 'tax_enabled' => Configuration::get('PS_TAX'), 'digsale'=>$price_goods, 'digsalewmu'=>$wmu, 'digsalepcr'=>$pcr, 'digsalereward'=>$reward, 'digsalearew'=>$arew, 'digsalearewc'=>$arewc, )); A variable {$digsalewmu} works fine on product page. But I need to put it in product-list. tpl also. The main problem is that this variable is formed with a help of an xml request wich uses productcontroller variable ($this->product->reference) so I can't move it to another controller, categorycontroller, for example. Could anyone please share an advice how to solve this? Thanks!
-
Hi there, i would like to echo REFERENCE or LOCATION into the order area into admin. i did use the real product name for echo the package name ( in ex : 3bottles, 2bottles etc ) That's ok for the client side. But when it come to the admin side, in the order spot, it's hard to know what people bought. So i did remove the picture table and would like to echo one of these 2 var in the first table. http://d.pr/wtzK Like that. Thx in advance, kevin
-
My custom template uses the following line of code which I have tracked down was supported by jquery-1.2.6.pack.js and not included in the new jquery-1.4.4.min.js The code that stopped working, upgrading Prestashop is $("#group_2").val(id_attribute); in this case, specifically the use of the val() If I put jquery-1.2.6.pack.js in the new header.tpl then it works, but other things that need the new JQuery break as a result. This has been an emergency issue for us for months, since trying to upgrade from Prestashop 1.3.6 Thanks for any advice here on how to make that work.
- 1 reply
-
- jquery-1.2.6.pack.js
- var
- (and 7 more)
-
Dear members i need some help. My client want to see in the email confirmation the gender (mr. or ms.). When i say email im talking about the email wich he recieves. So i need something like this: "You've a new order from {gender} {firstname} {lastname}" I have several hours fighting with this. Thanks for your time Daniel