Jump to content
thirty bees forum

musicmaster

Members
  • Posts

    675
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by musicmaster

  1. For me that will be another code customization.
  2. In a recently updated shop I don't see the "add a product" button below the product list of an order. What could cause this? The other button ("add a discount") is present.
  3. Did you read my post from 10 days ago? I have a shop now running under 8.1 without problems and wrote some of my experiences down. I may have forgotten some issues but it should be a start. If anyone has additions they are welcome.
  4. The Panda theme produces quite a lot of warnings for the error log. Usually they are harmless. In this post I will list the warnings and the fixes. As the Panda theme hasn't been upgraded for some time this will enable you to do it yourself. Make sure to update your modules and Thirty Bees to the last version. Make also sure that you have the latest version of Panda: older versions are quite different and with them the line numbers won't match. I haven't enabled all modules and tested them in all corners. So there may still be hidden problems. If you encounter a problem and find a solution, please report it here so that I can add it to the list. If you aren't able to solve it I will be happy to help you. SunnyToo has promised that they will release a new version. blockcart-json.tpl Warning: Creating default object from empty value in /home/public/sites/www.shop.com/cache/smarty/compile/11/2b/10.file.blockcart-json.tpl.php on line 218 /themes/panda/modules/blockcart-json.tpl The offending line is line 81. It looks so: "free_ship": {(!$shipping_cost_float && !count($cart->getDeliveryAddressesWithoutCarriers(true, $errors_back)))|json_encode}, To fix it it should be changed to by deleting the $errors_back argument "free_ship": {(!$shipping_cost_float && !count($cart->getDeliveryAddressesWithoutCarriers(true)))|json_encode}, If you have another template that overrides the blockcart template you are likely to encounter the same issue. A very similar fix was made to the blockcart module. That fix provides also three other fixes that should be implemented. These are in the more remote parts of the code so you won't see the errors often: /themes/panda/modules/blockcart/includes/dropdown.tpl line 113 change: {assign var='free_ship' value=count($cart->getDeliveryAddressesWithoutCarriers(true, $errors))} to: {assign var='free_ship' value=count($cart->getDeliveryAddressesWithoutCarriers(true))} /themes/panda/order-carrier-advanced.tpl line 264 and /themes/panda/order-carrier-opc-advanced.tpl line 250 change: {assign var='errors' value=' '|explode:''} to: {assign var='errors' value=[]} blockviewed There is a fix for the TB version of this module that you can also apply to your blockviewed_mod. It is discussed here and you can find the code here. As it concerns quite a lot of code I haven't copied it here. Note that this concerns a possible problem and it doesn't produce error messages - except for the browser console when the rare problem really happens. blockwishlist [] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/public/sites/www.webshop.com/cache/smarty/compile/ba/cb/c4/bacbc7.file.blockwishlist-extra.tpl.php on line 25 /themes/panda/modules/blockwishlist/blockwishlist-extra.tpl Line 28 looks like this: {if isset($wishlists) && count($wishlists) > 1} This should be changed to {if isset($wishlists) && is_array($wishlists) && count($wishlists) > 1} breadcrumb.tpl [] PHP Warning: Creating default object from empty value in /home/public/sites/www.webshop.com/cache/smarty/compile/fe/8c/6b/fe1_0.file.breadcrumb.tpl.php on line 32 The offending line is: {$matchCount = preg_match_all('/<a.+?href="(.+?)"[^>]*>([^<]*)<\/a>/', $path, $matches)} The problem is that $matches is not defined. So you need to add a line before this line: {$matches = []} guest.php [] PHP Notice: Trying to access array offset on value of type bool in /home/public/sites/www.webshop.com/classes/Guest.php on line 207 This error can happen in older shops. It happens because some entries are lacking in the ps_operating_systems entries for more recent OS's are missing. If you scroll a bit up from line 207 you will see which OS's are defined in the software. paypal.php and stnewsletter Array and string offset access syntax with curly braces is no longer supported in file /home/public/www.website.com/modules/paypal/paypal.php at line 2729 This type of error is quite common and happens also with other modules. It has to with the syntax for arrays. Normally you write something like "$myarray[8]". However, there is an old type of syntax that uses curly brackets instead of the square brackets. In that case the same declaration looks like "$myarray{8}". In PHP 8 the latter syntax is no longer allowed. So you need to replace the curly brackets with square brackets. So if ((int) $num1{$i} > (int) $num2{$i}) will be replaced by if ((int) $num1[$i] > (int) $num2[$i]) stnewsletter has a similar problem on line 122. stgadwordsconversion.php [] PHP Warning: Undefined array key "total" in /home/public/sites/www.webshop.com/cache/smarty/compile/53/63/eb/5363eb.file.front.tpl.php on line 32 [] PHP Warning: Undefined array key "iso_code" in /home/public/sites/www.webshop.com/cache/smarty/compile/53/63/eb/5363e.file.front.tpl.php on line 34 [] PHP Warning: Undefined array key "total" in /home/public/sites/www.webshop.com/cache/smarty/compile/53/63/eb/5363.file.front.tpl.php on line 32 [] PHP Warning: Undefined array key "iso_code" in /home/public/sites/www..webshop.com/cache/smarty/compile/53/63/eb/5363.file.front.tpl.php on line 34 /modules/stgadwordsconversion/stgadwordsconversion.php This error always comes in fourfold when an order is made. Two times before the payment is made and two times in the callback from the payment provider. This is a module that used to be provided by SunnyToo. However, it is no longer supported and for me that was a reason to stop using it. stmegamenu.php [] PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/public/sites/www.webshop.com/modules/stmegamenu/stmegamenu.php on line 3724 [] PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/public/sites/www.webshop.com/modules/stmegamenu/stmegamenu.php on line 3739 /modules/stmegamenu/stmegamenu.php As "continue" is the old version and it works so I have replaced "continue" here with "break". stnewsletter Error message in the browser console from php-debug.js Deprecation: Array and string offset access syntax with curly braces is deprecated in modules/stnewsletter/stnewsletter.php at line 123 php-debug.js:53:39 Change in /modules/stnewsletter/stnewsletter.php on line 123 if ($this->_cookie_path{0} != '/') into if ($this->_cookie_path[0] != '/') stthemeeditor Symptom: when in the backoffice you want to configure this module it your modules page the call keeps hanging until you get some kind of timeout (for example a 504 error). When you look in the browser console under Network you see that the status of the call is "pending". When you look under Timing you see "call is not finished yet". This happens when some SunnyToo webpage is down. Just waiting will solve the problem. But if you want to access your theme-editor immediately here is a fix. The problem is in the function getVerInfo in the file /modules/stthemeeditor/ThemeLicense.php public function getVerInfo() { if (!isset($_SESSION['st_version_info']) || !$_SESSION['st_version_info']) { $api_url = 'http://biz236.inmotionhosting.com/~sunnyt7/version.php'; $theme = $this->getTheme(); $param = array( 'theme' => $theme, 'ver_only' => false, ); if ($data = $this->makeCall($param, $api_url)) { $_SESSION['st_version_info'] = $data; } else { $_SESSION['st_version_info'] = ''; } } return $_SESSION['st_version_info']; } The link to inmotionhosting no longer works. Unfortunately that makes the function makeCall hang rather than return false. So a solution is to replace if ($data = $this->makeCall($param, $api_url)) { $_SESSION['st_version_info'] = $data; } else { $_SESSION['st_version_info'] = ''; } with just the line $_SESSION['st_version_info'] = ''; Possibly this is a temporary problem and SunnyToo will fix it. The themeconfigurator module After I had upgraded PHP to version 8.1 I found that I couldn't access my backoffice. It had an error in the themeconfigurator module. This module was not active. Yet it was somewhere accessed by the theme. The problem here is that Thirty Bees doesn't upgrade modules that are not active. So in this shop - a migrated Prestashop - I still had the old Prestashop version. The solution was to delete this old version and copy a new version of this module from a recent Thirty Bees installation. Here an update file that fixes some of the issues. yotpo.php The Yotpo module produced the following warning: Warning: count(): Parameter must be an array or an object that implements Countable in /home/public/sites/www.webshop.com/modules/yotpo/yotpo.php on line 268 The relevant code was: $id_image = Product::getCover($id_product); if (count($id_image) > 0) Obviously this was a programming error on the side of Yotpo. $id_image is just a variable, not an array. So the corrected code became: $id_image = Product::getCover($id_product); if ($id_image > 0) The backoffice Modules page Under PHP 8.1 you will see in the backoffice Modules page warnings like the following: Deprecated: Optional parameter $type declared before required parameter $id_lang is implicitly treated as a required parameter in StMultiLinkGroup.php on line 127 The offending code in this case is: public static function getLinkGroup($identify,$type=1,$id_lang) You can solve this by stripping "=1" from the "$type=1" part. The same applies to other function declarations with the same problem. Optional parameter $nbr declared before required parameter You will see a lot of these warnings when you open the Modules page in the backoffice. Guilty are function declarations like this public static function getByCustomer($id_customer, $p = 1, $n = 0, $id_lang, $id_shop, $get_total = false) The problem are those definitions like "$p = 1". You can leave the values out. So the above function would become: public static function getByCustomer($id_customer, $p, $n, $id_lang, $id_shop, $get_total = false) As these are harmless I haven't changed them myself.
  5. The code I added was borrowed [with a twist] from the latest Prestashop 1.7. I haven't checked it but i wouldn't be surprised if for some PS versions this was what worked.
  6. I have made a provisional fix by adding in Link.php if (!is_array($params)) { $params = []; }
  7. UPDATED After an upgrade to the latest bleeding edge I got the attached error. The error happens on the orders page in the backoffice and is obviously caused by the Whatsapp module. What puzzles me is that these function declarations and calls were the same under the old version where they didn't give a problem. The error message seems correct. Yet under the old version I didn't get an error. After some search I found that the GetAdminLink function in Link.php had been changed. The old version was: public function getAdminLink($controller, $withToken = true) { $idLang = Context::getContext()->language->id; $params = $withToken ? ['token' => Tools::getAdminTokenLite($controller)] : []; return Dispatcher::getInstance()->createUrl($controller, $idLang, $params, false); } The new version is: public function getAdminLink($controller, $withToken = true, $params = []) { $idLang = Context::getContext()->language->id; if ($withToken) { $params['token'] = Tools::getAdminTokenLite($controller); } return Dispatcher::getInstance()->createUrl($controller, $idLang, $params, false); } The puzzling thing is that the whatsappchat module calls it thus: $this->context->smarty->assign(array( 'action' => $this->l('WhatsApp'), 'action_whatsappchat' => $this->l('WhatsApp with this customer'), 'admin_base_dir' => $this->currentPageURL(), 'this_path_bo' => $this->_path, 'iso_code' => $this->context->language->iso_code, 'whatsappchat_admincontroller' => $this->context->link->getAdminLink('AdminWhatsappChat', true, $this->context->language->id), 'url' => false, 'show_button' => true, 'token' => Tools::getValue('token') )); So here the third argument is an integer.
  8. After the project had been floating around for some time last year it was taken over (bought) by @Smile who employed @datakick - who already was the biggest contributor - as programmer/developer. I don't see the schism between the forum and Github. The forum is for general discussion and problems. Github is about bug reports and development. Usually a problem first appears on the forum. You are supposed to only make a bug report when you are rather sure that it is caused by the Thirty Bees software and not something that is specific to your shop - like a buggy module or a database inconsistency. Of course wishes for new features can be found at both locations.
  9. Did you try profiling? https://dh42.com/blog/prestashop-debug-profiling/
  10. Solved. I discovered that clicking the one line that is shown wil result in the showing of the other lines.
  11. When I enable profiling in a PS 1.6.0.9 shop I get information like the following: However, when I do the same on my TB shop I get reduced information with the path part (enclosed with red lines in the picture) left out. Is there reduced functionality in Thirty Bees (or already in PS 1.6.1)? Or am I missing some setting?
  12. Look also in your browser console for javascript errors
  13. The reason why the page was almost empty was the lack of hooks. Most themes do that straight away. For example displayNav in header.tpl <nav>{hook h="displayNav"}</nav> or {hook h='displayNav'} In Panda the relevant section looks like this: {if (isset($HOOK_NAV_LEFT) && $HOOK_NAV_LEFT|trim) || (isset($HOOK_NAV_RIGHT) && $HOOK_NAV_RIGHT|trim)} <div id="top_bar" class="nav {Configuration::get('STSN_HEADER_TOPBAR_SEP_TYPE')|default:'vertical-s'} {if !$sttheme.sticky_topbar} hide_when_sticky {/if}" > <div class="wide_container"> <div class="container"> <div id="top_bar_row" class="flex_container"> <nav id="nav_left" class="flex_float_left">{$HOOK_NAV_LEFT}</nav> <nav id="nav_right" class="flex_float_right">{$HOOK_NAV_RIGHT}</nav> </div> </div> </div> </div> {/if} By default neither $HOOK_NAV_LEFT nor $HOOK_NAV_RIGHT is defined. So there will be no displayNav hook and thus the content linked to that hook is not displayed. The override FrontController.php contains the following text that inserts the hook: $this->context->smarty->assign(array( 'HOOK_NAV_LEFT' => Hook::exec('displayNavLeft'), 'HOOK_NAV_RIGHT' => Hook::exec('displayNav'), )); For some other hooks the same thing applies. As my FrontController override hadn't been installed my page stayed empty.
  14. @Theo I found that the main file is already 1.5.5. The update directory is only for updating existing installations. I found that the error message was misleading: The problem is that this CategoryController override was not the only override that was "not installed properly". Panda tries to install 8 overrides. But after this initial failure it just stopped. It didn't even try to install the other seven - even though in many cases there was no conflicting override.
  15. The algorithm works at the moment on order level. So when all products in an order have the same VAT rate things work. But when you have a mixed order there is a problem. It is somewhere on the things-to-do list.
  16. Sounds like you got either a timeout or a bad record. Check the error log: it may contain relevant information. And look at the newest product to see whether it is one of the uploaded.
  17. What is this patch? Is it a file? With what name? I am busy with other things so I won't be able to react for some time
  18. Here is the config.xml Config.xml
  19. When I use the module compare function of Prestools to compare the hooks I see this for the Stmegamenu module. I compared the shop I am working on with a shop I migrated a long time ago to TB. They use quite different hooks (all hooks that are not on the other side are highlighted). For many other modules there is a similar picture. Specially the Header/displayheader and displayMainMenu/displayMainmenu differences puzzle me.
  20. I am trying to install Panda on a migrated shop that worked ok under Prestashop.
  21. This is the latest version of the Panda theme - the only third party theme for Thirty Bees that is still supported. That should work. It evades me why you claim that it shouldn't.
  22. Yes. I am afraid that it is something like that. I checked my migrated shop and I saw that it has 63 modules with Prestashop as author and only 2 modules with Thirty Bees as author. I haven't checked yet but I am afraid the situation is similar with hooks. That would mean that many of the hooks that Panda assumes essential in Thirty Bees just aren't present. But that would imply that the migration module is not doing what it is supposed to do.
  23. If this table had 2.5 million records quite likely some other statistics tables were too big too. Look at ps_connections, ps_connections_source and ps_pagenotfound. Prestools has a cleanup page with the most common operations. With tables this big you might also consider truncating them when they aren't used. It will be much quicker. As Datakick mentioned these are statistics. But not everyone uses statistics or they use Google's tracking instead.
  24. It looks like not having the hooks isn't a recipe for succes. This is how my homepage looks after the installation:
×
×
  • Create New...