Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by DanielaPetkova

  1. I could not manage to add SQL_BIG_SELECT before the query no matter what i tried so i went the other way. Try to find what is not ok with the query. It turns out that part [ {table_prefix} is replaced with my DB prefix. ] ... COALESCE(i.id_image, 0) AS combination_cover_id, .... LEFT JOIN ps4e_image i ON ( i.id_product = p.id_product AND COALESCE(FIND_IN_SET(i.id_image, images_per_combination.image_ids), 0) > 0 ) If i comment out that part is working ok. I need to investigate more why is that. It was working ok before i bet something wrong with the images went.
  2. Yep , but function tryToConnect is not used in dbpdo.php also. There is public function connect() { try { $this->link = $this->getPDO($this->server, $this->user, $this->password, $this->database, 5); } catch (PDOException $e) { throw new PrestaShopException('Link to database cannot be established: '.$e->getMessage()); } $this->link->exec('SET SESSION sql_mode = \'\''); return $this->link; } which is in use but still cannot make SQL_BIG_SELECT work.
  3. Even if i rename the .php file nothing has changed in back office. MysqliConnection.php or DbMySQLi.php. Everything is working normal in the BO even without both files. So they are not in use or there is some cache that i don't know. Continue searchin what is going on. Here is a screenshot of the error i'm fighting with. Usually it happens after i added new product eve thow they are not a lot. After deleting and re-adding is all good but not now.
  4. Hmm....first of all thank you for supporting. Second i did it but it seems there is some cache that i am missing to delete. In var/cache there is nothing , not even folders and i deleted class_index.php from prod and dev folders. Any new ideas ?
  5. Hi there, I need help with the correct syntax and where exactly to add the statement. I'm having issue with Stock management in Ps 1.7.3 and i need to add SQL_BIG_SELEC=1 before the select. It's not possible to change server settings. Below is the function with the query in it. I know i have to add one of those statement but dont know where to insert it. Actually shouldn't be SET SESSION... Too many unknows for me. Db::getInstance()->execute('SET SQL_BIG_SELECTS=1'); Db::getInstance(_PS_USE_SQL_SLAVE_)->execute('SET SQL_BIG_SELECTS=1'); StockRepository.php protected function selectSql( $andWhereClause = '', $having = '', $orderByClause = null ) { if (is_null($orderByClause)) { $orderByClause = $this->orderByProductIds(); } return str_replace( array( '{left_join}', '{and_where}', '{having}', '{order_by}', '{table_prefix}', ), array( $this->joinLimitingCombinationsPerProduct(), $andWhereClause, $having, $orderByClause, $this->tablePrefix, ), 'SELECT SQL_CALC_FOUND_ROWS p.id_product AS product_id, ...... ....... GROUP BY p.id_product, COALESCE(pa.id_product_attribute, 0) HAVING 1 {having} {order_by} '); } check that link for the full code https://github.com/PrestaShop/PrestaShop/blob/develop/src/PrestaShopBundle/Entity/Repository/StockRepository.php
  6. That is very old but i was searching for information about the name of the table for PS 1.7.3 that needs to be changed in the date base. So it is SELECT * FROM `ps4e_shop` the MySql or simply ps4e_shop. There and also config/defines_uri.inc.php the first line _PS_DEFAULT_THEME_NAME_ . After you upload your new theme , change the name to those two places and you are good to go. Also very important is your config.yml in the theme's folder. If there is someting messed up to that file will give you error like " A YAML file cannot contain tabs as indentation at line 69" That was my case and just wanted to share experience for future reference. Cheers.
  7. Hi, When i open an order in BO i want to be able to see the exact amount of the order without the shipping cost. Only the sum of the products ordered plus the discounts applied. So a quick way to do that (bare in mind i spend 3 days till i figure out how) is to go to: admin/themes/default/template/controllers/orders/helpers/view/view.tpl and search for {assign var=order_discount_price value=$order->total_discounts_tax_excl} After that just edit it like that {assign var=order_discount_price value=$order->total_discounts_tax_excl-($order->total_products)} And that is the final result. It should not mess up with anything in your statistic just shows you the amount. And you can see only the discount just above. https://tinyurl.com/ybjbxk9n If you like it "Thumbs up" Ciao.
  8. FINALLY A BRAKE: In LegacyHookSubscriber i had previously added that empty condition for another bug: $hooks = Hook::getHooks(); if (empty(is_array($hooks)))) { foreach ($hooks as $hook) { $name = strtolower($hook['name']); $id = $hook['id_hook']; So i decided to dig deeper in that and found that issue is from having empty hook in ps_hook what exactly i had. https://tinyurl.com/sp3ohq3 Why is that and for solution you have to check here https://github.com/PrestaShop/PrestaShop/pull/8463 Applied the fix and it seems to work. // If hook_name is given, just get list of modules for this hook if (null !== $hook_name) { $retro_hook_name = strtolower(Hook::getRetroHookName($hook_name)); $hook_name = strtolower($hook_name); The only problem left is that i had changed form.html {% if hookcount('displayAdminProductsExtra') >= 0 %} Don't know why displayAdminProductsExtra is not > 0 when everything shows the opposite. But it work so i'm fine for now. Thanks for the support.
  9. Applied that fix from the link adobe to src/PrestashopBundle/Service/HookDispatcher.php /src/Adapter/LegacyHookSubscriber.php Removed the If clause from src\PrestaShopBundle\Resources\views\Admin\Product\form.html. The hook displayAdminProductsExtra still not loading it's content from the database. I'm not dev but still digging for solutions to this. Edit: Why is hidden ?
  10. src\PrestaShopBundle\Resources\views\Admin\Product\form.html. {% if hookcount('displayAdminProductsExtra') > 0 %} {% set hooks = renderhooksarray('displayAdminProductsExtra', { 'id_product': id_product }) %} Doesn't return anything even tho displayAdminProductsExtra has assigned modules to it in the datebase. I'm lost.
  11. Here seems to be the answer and i'm trying to figure out what needs to be changed https://github.com/PrestaShop/PrestaShop/issues/15148 to make it work. EDIT: I can not apply that fix. Don't have HookDispatcher in 1.7.3.
  12. If nothing else can at least anyone tell me what ID hookDisplayAdminProductsExtra is in his database ?
  13. Hi all, I have installed and assigned 3 modules to that hook. I'm seeing in the database all modules are assigned to the hook. The problem is that there is no way i can load the hook in products tab and to show that Modules tab with the options. I'm with v. , PHP 7.3 . So far i tested. - All cache off. BO , the server everything. - Disabled all none PS modules and overrides - Switch PHP versions. - Different hacks in Hook.php - Many other things In debug mode i see only 5 hooks loading in Product. Here is the database query what i use for the check and is all good there - it returns that i have modules attached . SELECT * FROM `ps4e_hook_module` hm INNER join ps4e_hook h on hm.id_hook = h.id_hook WHERE h.name like 'displayAdminProductsExtra'; Here is one of the modules that i use for testing. Any ideas how to continue debugging would be appreciated. belvg_samplemodule.zip
  14. Thank you. This should be fixed at next PS version. For me is a bug. I use to adjust the default combination manually every time one of the combinations are sold out cos it shows all combinations out of stock. Or more precise user can not change other than the default combination if the default is sold out.
  15. Give that man a beer - it works as should be by default. Thank you very much for the module.
  16. I know it is old thread but still is indexed at first places by Google. I had the same question and found maybe a way simpler way. How about just hide that block from the checkout using CSS display:none ? By default the Invoice address is marked as the same as shipping. So if you just hide it everything is still working fine.
  17. Hi there. Did you find a solution? You can post it here. Thank you.
  18. Hi there. I want to describe something that has be bothering me from a months and i found the answer by chance. I think there should be a message or info label after a user made that type of action. The issue. I have products with combinations. Every combination no matter the color has all the images set to it. That means when a user clicks at a certain color nothing changes in the image preview. I decide to upload one more image to that certain product. Everything went ok but i could not make that image to appear in the front office. I see it in the BO but not in the FO. I cleared the cached, stopped it, started searching online what could be the problem - nothing. I left it like this till today i found the answer. The image has not been assigned to any product combination! So , after you upload new image to a product with combinations you should assign it to certain combination or won't show in FO ! Here are some screenshots: After you have uploaded the new image and you see it in BO you go to combinations and click Edit. http://tinyurl.com/y5ucsyy8 At the bottom you will see all the images you have. Some of them have blue border and some don't. The ones with the blue border are shown in the FO. You just click on the image and Save after that. http://tinyurl.com/y2anbach That is all. I really feel very stupid after all of that. The logic behind it is clear but only if you know this feature exist. Hope to be useful to someone. Take care !
  19. So far did you found answer to that problem beside the brute force approach? I'm with 1.7.3 and still exist.
  20. Hello, i just had the same issue and that fixed the problem. I had several entries so had to delete them all by looking for that exact number in search id_address_delivery column. I think the problem is appearing when user had added product to the basket and he had valid address in his/her profile. After that during checkout he decide to delete his address for some reason and did not finish the order. I was recently doing this before the problem appears and the user id is the same as my user. You can try to re-create it. I'm running Prestashop with default theme v.1.7.3, PHP 5.6.40, MySql 5.6.44 Thank you for your solution !
  21. Hi there. I don't know if should make new topic or post in this one. I'm trying to change the checkout steps also. I need the Delivery (step3) to be before Address(step2). I have found in /controllers/front/OrderController.php the code ->addStep(new CheckoutAddressesStep( $this->context, $translator, $this->makeAddressForm() )); and change the place it below the delivery step. So far so good. Step3 goes before Step2 as i wish. But there is some address check which is stopping me to proceed from Delivery to Address if i havent login with valid address at first place (no address entered). I can not find that address validation !=0 at Delivery step and make it always true. Can you help me out ? I can provide with a link of needed. Using Prestashop 1.7.3. EDIT: In Cart.php class tried this but still not working. public function checkAndUpdateAddresses() { return true; } More at this topic How to remove delivery shipping step on prestashop 1.7? EDIT 2: I found a way. In AddressValidator.php class set function validateCartAddresses to return false. This why i skip to address check in the chekout. Any smarter why to rearrange steps2-3 in the checkout ?
  22. Hi there, At it is working. I'm attaching mine OrderHirstory.php file. Basically opened the original file that i had and just inserted the new functionality developed by the author. After that deleted /app/cache/dev/class_index.php and /app/cache/prod/class_index.php , deleted the cache and tested it with shipped.html with many variables like delivery address , produts , etc.... and all are working. Some bugs are possible since i haven't test it much. Right now i'm looking for a solution for order_changed.html to add those variables there. I think is generated from a different place. Thank you all for the great community that we have. D. OrderHistory.php
  23. Hi , and thank you for the answer you have posted. I had maybe the same problem but was easier to fix it. Just changed in BO from using SMTP to use PHP mail() function. Test it and it was ok. Than changed it back to SMTP and it works. It is strange solution but decided to post it. Supporting the community with answers. D
  24. If you want to hook the module but you don't see it available in the drop down here is what you should do. I have a hook called hookDisplayHomeFullWidthSlider and i wanted to hook the module there but obviously not possible. So we neeed to edit a bit the module. So i opened bonslick.php and at the bottom added public function hookDisplayHomeFullWidthSlider() { return $this->hookDisplayHome(); } Be careful with the name of the hook. It matter if it is hookDisplayHomeFullWidthSlider or hookdisplayHomeFullWidthSlider. Double check the name of your hook. Also in the same file you should search for $this->registerHook('') and add a registration there. That is it. Reinstall the module and you should see it added to the hook you wanted. If i helped you can give me Thanks at the bottom right corner of this post. #BonPresta very useful feature that you can add to your paid module is to be able to set expire timer to every slider. After certain time passes the slider is becoming hidden. Let me know what you think you can PM me. All the best and take care.
  • Create New...

Important Information

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