banan_44 Posted Saturday at 06:33 PM Share Posted Saturday at 06:33 PM 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. Link to comment Share on other sites More sharing options...
PMShop Posted Saturday at 09:07 PM Share Posted Saturday at 09:07 PM Please go to Modules and Look for Super Checkout Module & Make Reset the module Link to comment Share on other sites More sharing options...
banan_44 Posted Sunday at 10:54 PM Author Share Posted Sunday at 10:54 PM On 12/21/2024 at 10:07 PM, PMShop said: Please go to Modules and Look for Super Checkout Module & Make Reset the module 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...
PMShop Posted yesterday at 07:36 AM Share Posted yesterday at 07:36 AM (edited) 8 hours ago, banan_44 said: 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. go to issue file and change line 223 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'])) { ?> <?php echo $_smarty_tpl->tpl_vars['subtotals']->value['tax']['label']; ?> <?php } ?> and test it & let me know please Edited yesterday at 07:36 AM by PMShop (see edit history) Link to comment Share on other sites More sharing options...
ST-THEMES Posted yesterday at 09:31 AM Share Posted yesterday at 09:31 AM 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...
banan_44 Posted yesterday at 04:15 PM Author Share Posted yesterday at 04:15 PM @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 16 hours ago Share Posted 16 hours ago 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...
banan_44 Posted 4 hours ago Author Share Posted 4 hours ago @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...
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