Jump to content
thirty bees forum

musicmaster

Members
  • Posts

    675
  • Joined

  • Last visited

  • Days Won

    43

Posts posted by musicmaster

  1. 22 hours ago, wakabayashi said:

    It's not shipped, but when the delivery-slip was generated. I personally don't like this much. Shipped would be more logical imo. But we learnt to live with it ^^

    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. 26 minutes ago, AndyC said:

    Is anyone having issues with Panda when upgrading ... breadcrumb.tpl is causing everything to be 500 server error.. I may download a fresh copy of it on teh weekend and try again

    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.

     

    • Like 1
  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.

    • Like 5
  5. 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.

    coreupdate.jpg.thumb.jpg.b62f981a6987112237ebe4bc400e348a.jpg

     

  6. On 10/5/2022 at 12:22 PM, coconutswan said:

    Hello everyone! I'm new to the group, but I'm very enthusiastic about this endeavor. I own a web hosting firm and would want to contribute monetarily and ultimately with development time to this project. Who is presently receiving contributions, and what are they used for? There seems to be a schism between this site and github.five nights at freddy's

    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.

    • Like 1
  7. When I enable profiling in a PS 1.6.0.9 shop I get information like the following:

    profil.thumb.jpg.ed42e28090be39f94635e7a62af0744b.jpg

    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?

  8. 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.

  9. @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:

    panda_installation2.jpg.b44f4cb8576a1334e40ffeef74fb07fd.jpg

    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.

  10. 5 hours ago, 30knees said:

    I'd like to use the EU Order Tax feature to comply with the One Stop Shop VAT requirements. However, the One Stop Shop requires the sums per tax rate, so eg for Belgium 100 Euro for reduced 6%, 20 Euro for reduced 12%, and 40 Euro for standard 21%.

    Is there a way to do this?

    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.

  11. 4 hours ago, Theo said:

    From what I recall the Panda patch could've fixed something with the config file and hooks. It was a while back when dk made some changes to the way the themes read that xml or something then Sunny had to patch Panda. The installation folder contains the patch. Unzip the installation and copy the patch into it, then use this new folder for the theme install. 

    Let us know if you came right please. I'm curious to see what the problem was and how it was fixed and if the patch helped. 

    Also if it works on a fresh TB with patched Panda, then you know it's likely something to do with the old site migrate and not the theme. 

    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

  12. 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.

    hooks.thumb.jpg.9a0666a8d39fab448d966c79aa443121.jpg

  13. 6 minutes ago, Theo said:

    Not knowing the exact details of what you are trying to do here makes this a bit difficult. 

    But maybe try a fresh TB install, patch Panda then install Panda first before you do the migration...?

    I am trying to install Panda on a migrated shop that worked ok under Prestashop.

  14. 18 hours ago, datakick said:

    The reason why your theme looks 'weird' after installation is that it did not provide valid set of displayable hooks that should be hooked/unhooked via its xml file. Thirty bees did not know what to do, and therefore did nothing.

    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.

  15. 11 hours ago, datakick said:

    These warnings exists to inform user that the theme tries to hook / unhook nondisplayable hook. 

    Take hook actionFeatureSave from module blocklayered as an example. This module use this hook to react on a situation when feature is saved to database in order to rebuild its cache. Why should installation of a new theme disable or enable this functionality, which has absolutely nothing to do with theme?

    The reason why your theme looks 'weird' after installation is that it did not provide valid set of displayable hooks that should be hooked/unhooked via its xml file. Thirty bees did not know what to do, and therefore did nothing.

    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.

  16. 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. 

×
×
  • Create New...