Jump to content

Matteo

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by Matteo

  1. p.s. Oh, it's not $e ust because I removed the $e variable from the code.
  2. Hello, I have developed a custom module that allows purchasing specific products individually. Every time a product from that group is added to the cart, I check for it and remove any other products already in the cart. This works fine for most products, but when I add a product with combinations (like 1 or 2 variations, so it's not too large), it leads to high memory consumption and possibly an infinite loop. I'm not sure why this is happening. Here's my code: public function hookActionCartSave() { $arrayMembership = array(151029, 150995, 150996, 150997, 150998, 150999, 151000, 151001, 151077); // get cart id if exists if(isset($this->context->cart)){ //$this->context->cart = $this->context->cart; //$objectCartCustom = $this->context->cart->getProducts(); $objCart = new Cart($this->context->cookie->id_cart, $this->context->cookie->id_lang); $has_membership_in_cart = false; foreach ($arrayMembership as $id_membership) { $check_qnt = $objCart->containsProduct($id_membership); if(isset($check_qnt['quantity']) && $check_qnt['quantity'] > 0){ $has_membership_in_cart = true; } } //echo $has_membership_in_cart;die(); //print_r($this->context->cart->containsProduct($arrayMembership[1]));die(); if($has_membership_in_cart){ $has_deleted = false; foreach ($objCart->getProducts() as $cart_row) { if(!in_array($cart_row["id_product"], $arrayMembership)){ $objCart->deleteProduct($cart_row["id_product"]); $has_deleted = true; } } return $e; } } }
  3. Hello, nope, but we ended up with cookie. There a known issue with prestashop cookie size causing header bigger than normal. We are trying to look for a fix but it seems that dev didn't switch to something light, so the only answer is Apache
  4. Hi everyone, we have a problem on our side. Basically we have a checkout handled by: With a simple conf: PHP 7.4 PHP FPM Apache Prestashop 1.7.8 PHP ini tuning (memory, max input ecc) sometimes we receive an error 502 when some of us try to log in. Randomically the problem is solved by deleting the browser cache or with private browsing, but sometimes the problem persist. We didn't receive any error on server. Can you please help us to look into the problem? Thx to all in advance, Matteo
  5. Hello to all, i'm stuck with this situation: Product price: 114,99 Discount reduction: 50% Currency precision: 2 Total amount: 57.49 Prestashop Version: 1.7.8 Now everything is "right", but we have an erp that fetch prestashop orders to create&manage our needs. Where is the problem? The problem is related to the method of round because that's our situation on erp: Product price: 114,99 Discount reduction: 50% Total amount: 114,99 / 2 = 57.495 --> rounded up to 57.5 How we can work on Prestashop to allow a situation like the erp one? I have tried with round configuration but nothing happens cause for sure the precision is the key, but i don't know how to touch it. 2° try Try to figured out with override on variable $precision in Classes/Tools.php to work with 3 decimals but nothing happens. Many thanks, Matteo
  6. Hello to all, i'm stuck with this situation: Product price: 114,99 Discount reduction: 50% Currency precision: 2 Total amount: 57.49 Prestashop Version: 1.7.8 Now everything is "right", but we have an erp that fetch prestashop orders to create&manage our needs. Where is the problem? The problem is related to the method of round because that's our situation on erp: Product price: 114,99 Discount reduction: 50% Total amount: 114,99 / 2 = 57.495 --> rounded up to 57.5 How we can work on Prestashop to allow a situation like the erp one? I have tried with round configuration but nothing happens cause for sure the precision is the key, but i don't know how to touch it. 2° try Try to figured out with override on variable $precision in Classes/Tools.php to work with 3 decimals but nothing happens. Many thanks, Matteo
  7. Hello to all, i just need to add an extra field on "ps_order_detail" that will be automatically valorized from an external service, but my problem is to include it on Order controlled to use it on "Order detail page". Anyone can help me? Thanks in advance, Matteo
  8. We've find that the problem is related to a cache error cause by smarty cache (ps interna) that sometimes can't generate tpl files. U know why?
  9. You can read more here: 😉 Have a nice day!
  10. Hola, you can try to edit js and add the class "active" on every first element of tab section. Like this $(document).ready(function(){ $( ".product-info-tabs > li:first-of-type" ).addClass( "active" ); $( ".tab-content > h3:first-of-type" ).addClass( "active" ); $( ".tab-content > #product-description-tab-content:first-of-type" ).addClass( "active" ); });
  11. Hola Hasa, have you just tried to set cache on FS and html, css and js?
  12. Hello to all, our clients send to us an img of error that Prestashop (1.6.1.17) print when they surf from updates like coupon, products ecc For non italian: It's says that some server's error occured while loading tables but we can't find nothing on log files. Can u pls help me? Thanks in advance, Matteo
  13. Hola Ndiaga, thanks for the reply, but i already did it. I've clear the cache and activated flag that recompile templates data. Going to read the guide and tell if something change!! Thanks a lot Matteo
  14. Hi, i'm here to find a solutions to my problem. In prestashop i've added manufacturer in the proper way, but in front end i can't see img and everytime print the dafault img of prestashop. That's the line of tmmanufacturerblock.tpl: <img class="img-responsive" src="{$img_manu_dir|escape:'html':'UTF-8'}{$manufacturer.image|escape:'html':'UTF-8'}-{$image_type|escape:'html':'UTF-8'}.jpg" alt="{$manufacturer.image|escape:'html':'UTF-8'}" /> You can find the file in attachments tmmanufacturerblock.tpl
×
×
  • Create New...