nestor44 Posted December 21, 2024 Share Posted December 21, 2024 (edited) Hi, I have upgraded PS from 8.17 to 8.2 yesterday. Upgrade went without any problems. While I was testing the shop in Debug mode before turning it on I have noticed that in the checkout I have a following error: "Warning: Trying to access array offset on value of type null in /var/cache/dev/smarty/compile/16/c0/d8/16c0d8e416c0532a397d973c9b7320f765b61789_2.file.order-confirmation-table.tpl.php on line 223" The line in this file is <?php if ($_smarty_tpl->tpl_vars['subtotals']->value['tax']['label'] !== null) {?> <?php if ($_smarty_tpl->tpl_vars['subtotals']->value['tax']['label'] !== null) {?> I have cleared cache in the Performance section and also manually on the server but this message does not disappear. It is not shown when I turn off Debug mode. My website works with no problems. Customers place orders and make payments without errors. I am using SuperCheckout 9.0.2 by Knowband. When the SuperCheckout is activated I have "TECHNICAL ERROR- Request Failed" in the shopping cart area even when the Debug mode is turned off, and there is no item displayed is the SuperCheckout's cart. Before upgrade I did not have such problems. The first screenshot is from original checkout. The second screenshot from the SuperCheckout. Edited January 9 by nestor44 problem solved (see edit history) Link to comment Share on other sites More sharing options...
nestor44 Posted December 22, 2024 Author Share Posted December 22, 2024 On 12/21/2024 at 9:07 PM, PMShop said: Please go to Modules and Look for Super Checkout Module & Make Reset the module Expand Unfortunately, this did not help. I still have "Warning: Trying to access array offset on value of type null" on the original checkout. On the SuperCheckout now shopping cart is visible but Technical Error is present in the sections with Shipping Methods and Payment Methods. Cache have been cleared after Reset. I have also tried unistalling the SuperCheckout but the problem in the original checkout is still present while activating the Debug Mode. Link to comment Share on other sites More sharing options...
ST-THEMES Posted December 23, 2024 Share Posted December 23, 2024 Hi, Try to modify the \themes\classic\templates\checkout\_partials\order-confirmation-table.tpl file, change $subtotals.tax !== null To !empty($subtotals.tax) Best regards. Link to comment Share on other sites More sharing options...
nestor44 Posted December 23, 2024 Author Share Posted December 23, 2024 @PMShop, my original line is <?php if ($_smarty_tpl->tpl_vars['subtotals']->value['tax']['label'] !== null) {?> I have changed it to <?php if (isset($_smarty_tpl->tpl_vars['subtotals']->value['tax']) && $_smarty_tpl->tpl_vars['subtotals']->value['tax'] !== null && isset($_smarty_tpl->tpl_vars['subtotals']->value['tax']['label'])) { ?> Now the error is gone on the original checkout but I assume that it will return after I clean cache in the future or something like that. Unfortanately I still have 'TECHNICAL ERROR- Request Failed' errors in the SuperCheckout even with Debug being turned off. Do you know what might cause that problem? During upgrade I have also updated the original theme. @ST-THEMES, I have checked your solution first but I still had the problem on the original checkout after clearing cache. The solution I have mentioned above worked but the change was made in the var/cache file so I assume that the problem will return after clearing the cache in the future. Link to comment Share on other sites More sharing options...
ST-THEMES Posted December 24, 2024 Share Posted December 24, 2024 Hi, Did you use another theme? if yes, you need to change the \themes\your-theme-name\templates\checkout\_partials\order-confirmation-table.tpl file, and set the "Template compilation" as my screenshot. Best regards. Link to comment Share on other sites More sharing options...
nestor44 Posted December 24, 2024 Author Share Posted December 24, 2024 @ST-THEMES, yes, I use another theme. I have the setting that you mentioned. But to be honest, I am not sure what exactly I need to change in the theme I am using bcause it is a bit different than what you showed me in the previous message. Here's the code of my tpl file with the code that indicates subtotal and tax. I do not know why this problem appeared now and did not appear in the previous PS versions. <table> {foreach $subtotals as $subtotal} {if $subtotal !== null && $subtotal.type !== 'tax' && $subtotal.label !== null} <tr> <td>{$subtotal.label}</td> <td>{$subtotal.value}</td> </tr> {/if} {/foreach} {if $subtotals.tax.label !== null} <tr class="sub"> <td>{$subtotals.tax.label}</td> <td>{$subtotals.tax.value}</td> </tr> {/if} {if $smarty.const._PS_VERSION_ >= '1.7.7.0'} {if !$configuration.display_prices_tax_incl && $configuration.taxes_enabled} <tr><td></td><td></td></tr> <tr> <td><span class="text-uppercase">{$totals.total.label} {$labels.tax_short}</span></td> <td>{$totals.total.value}</td> </tr> <tr><td></td><td></td></tr> <tr class="total-value font-weight-bold"> <td><span class="text-uppercase">{$totals.total_including_tax.label}</span></td> <td>{$totals.total_including_tax.value}</td> </tr> {else} <tr><td></td><td></td></tr> <tr class="total-value font-weight-bold"> <td><span class="text-uppercase">{$totals.total.label} {if $configuration.taxes_enabled}{$labels.tax_short}{/if}</span></td> <td>{$totals.total.value}</td> </tr> {/if} {else} <tr><td></td><td></td></tr> <tr class="font-weight-bold"> <td><span class="text-uppercase">{$totals.total.label}</span> <span class="price_tax_label">{$labels.tax_short}</span></td> <td>{$totals.total.value}</td> </tr> {/if} </table> Link to comment Share on other sites More sharing options...
ST-THEMES Posted December 25, 2024 Share Posted December 25, 2024 Hi, Try to change the line {if $subtotals.tax.label !== null} To {if !empty($subtotals.tax) && !empty($subtotals.tax.label)} Best regards. 1 Link to comment Share on other sites More sharing options...
nestor44 Posted December 25, 2024 Author Share Posted December 25, 2024 @ST-THEMES, thank you. This helped and I no longer have the problem on the original checkout and SuperCheckout. But now when I make a test order I have 500 error with following description. What is wrong with PS 8.2? I did not have any problems with previous version. [PrestaShopException] Invalid new order status at line 365 in file classes/order/OrderHistory.php 360. 361. $this->id_order_state = (int) $new_order_state; 362. 363. // changes invoice number of order ? 364. if (!Validate::isLoadedObject($new_os) || !Validate::isLoadedObject($order)) { 365. throw new PrestaShopException($this->trans('Invalid new order status', [], 'Admin.Orderscustomers.Notification')); 366. } 367. 368. // the order is valid if and only if the invoice is available and the order is not cancelled 369. $order->current_state = $this->id_order_state; 370. $order->valid = $new_os->logable; OrderHistoryCore->changeIdOrderState - [line 1742 - classes/order/Order.php] - [3 Arguments] OrderCore->setCurrentState - [line 67 - modules/stripe_official/controllers/front/orderFailure.php] - [1 Arguments] stripe_officialOrderFailureModuleFrontController->initContent - [line 319 - classes/controller/Controller.php] ControllerCore->run - [line 510 - classes/Dispatcher.php] DispatcherCore->dispatch - [line 28 - index.php] Link to comment Share on other sites More sharing options...
ST-THEMES Posted December 26, 2024 Share Posted December 26, 2024 Hi, You can check your order status whether it persits or is translated properly, and to check all orders from your current whether are fine. Best regards. Link to comment Share on other sites More sharing options...
nestor44 Posted December 27, 2024 Author Share Posted December 27, 2024 @ST-THEMES, I have checked that and everything is ok. I did some tests and I have noticed that the problem occurs only if I select Stripe as a payment method and use different delivery address and invoice address. If both addresses are the same then there is no problem and order is placed with no errors. I have also noticed that when I select bank wire transfer as a payment method there is a different behaviour. When there is a different address for invoice and delivery then I do not have error. Instead the page refreshes when I try to place the order and the addresses are removed. When I re-tried to insert different address and place the order again then the same situation happens, the page refreshes and the addresses are removed. It is impossible to place the order with different addresses. When the addresess are the same then the order is placed with no problem. I have not idea why this happens. It's like the recent update broke my Prestashop or something. Link to comment Share on other sites More sharing options...
cosmoll Posted January 7 Share Posted January 7 (edited) Hi, Supercheckout was working fine and then it happened 🫣😞 and the products are not displayed in the cart After Reset the module /modules/supercheckout/controllers/front/SupercheckoutCore.php line 124 $this->supercheckout_settings['html_value']['header'] /classes/controller/Controller.php line 287 $this->init(); if ($this->checkAccess()) { // setMedia MUST be called before postProcess if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) { $this->setMedia(); } // postProcess handles ajaxProcess $this->postProcess(); if (!empty($this->redirect_after)) { $this->redirect(); } if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) { $this->initHeader(); } if ($this->viewAccess()) { $this->initContent(); } else { $this->errors[] = $this->trans('Access denied.', [], 'Admin.Notifications.Error'); } if (!$this->content_only && ($this->display_footer || (isset($this->className) && $this->className))) { $this->initFooter(); } // Default behavior for ajax process is to use $_POST[action] or $_GET[action] // then using displayAjax[action] if ($this->ajax) { $action = Tools::toCamelCase(Tools::getValue('action'), true); if (!empty($action) && method_exists($this, 'displayAjax' . $action)) { $this->{'displayAjax' . $action}(); } elseif (method_exists($this, 'displayAjax')) { $this->displayAjax(); } } else { $this->display(); } } else { $this->initCursedPage(); $this->smartyOutputContent($this->layout); } /classes/Dispatcher.php line 525 $controller->run(); // Execute hook dispatcher after if (isset($params_hook_action_dispatcher)) { Hook::exec('actionDispatcherAfter', $params_hook_action_dispatcher); } /public_html/index.php line 31 Dispatcher::getInstance()->dispatch(); //cleantalk-usp/bottom_code/start if(ob_get_contents()){ ob_end_flush(); } if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'){ die(); } //cleantalk-usp/bottom_code/end Edited January 7 by cosmoll (see edit history) Link to comment Share on other sites More sharing options...
Nickz Posted January 7 Share Posted January 7 check if your theme, your modules are capable to work with PHP 8.2. I wasn't aware that PS already can work with 8.2, most modules certainly won't Link to comment Share on other sites More sharing options...
cosmoll Posted January 7 Share Posted January 7 On 1/7/2025 at 1:13 PM, Nickz said: check if your theme, your modules are capable to work with PHP 8.2. I wasn't aware that PS already can work with 8.2, most modules certainly won't Expand Prestashop 1.7.8.11 does not work with php > 7.4🫠 Link to comment Share on other sites More sharing options...
Nickz Posted January 7 Share Posted January 7 On 1/7/2025 at 1:38 PM, cosmoll said: Prestashop 1.7.8.11 does not work with php > 7.4 Expand but it works with 8 and maybe even with 8.1. Link to comment Share on other sites More sharing options...
nestor44 Posted January 9 Author Share Posted January 9 (edited) @cosmoll, deactivate SuperCheckout and check if you have problems with the original checkout as well. After upgrade I also had problems with SuperCheckout. After turning it off I also had problems with the original checkout as I mentioned in my first post. The fix from ST-THEMES helped solve the problem with the original checkout but I still had TECHNICAL ERROR in the Supercheckout. Here's what I did to remove it. 1. I perform Reset of the module and then I unistalled it. 2. Using PRESTOOLS I went to 'Tools & Stats -> Integrity Checks' and fixed bunch of problems that occured after upgrade. Backup your database before you do anything. 3. Using Prestools again I went to 'Tools & Stats -> Cleanup' and I procced with following options: Empty cache, Delete old connections, Cleanup deleted product info. 4. I also use CloudFlare so I cleared cache in CF as well. 5. After installing SuperCheckout again I have no problem now. I hope this helps you. Take care Edited January 9 by nestor44 (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now