Error When Attempting To Repay Order

I can’t reproduce this on the demo but I also cannot install the Step by Step Checkout add on in the demo which I am assuming this has something to do with. Or maybe something to do with payment method which is PayPal standard.

When a customer has an order in their account that they want to pay for, when they select the order, the page opens (dispatch=orders.details&order_id=XXXX) and the following error is given and the customer cannot continue to pay for the order.

[09-Jan-2023 13:49:18 America/Chicago] PHP Warning:  Creating default object from empty value in /home/user/public_html/var/cache/templates/responsive/82a1ee3c0c78c83a11edf091e50bd50869709f15_2.tygh.final_section.tpl.php on line 117
[09-Jan-2023 13:49:18 America/Chicago] TypeError: Argument 1 passed to fn_get_checkout_settings() must be of the type array, null given, called in /home/user/public_html/app/functions/fn.cart.php on line 7428 and defined in /home/user/public_html/app/functions/fn.cart.php:11644
Stack trace:
#0 /home/user/public_html/app/functions/fn.cart.php(7428): fn_get_checkout_settings(NULL)
#1 /home/user/public_html/var/cache/templates/responsive/82a1ee3c0c78c83a11edf091e50bd50869709f15_2.tygh.final_section.tpl.php(117): fn_allow_place_order(NULL, Array)
#2 /home/user/public_html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_63962bc931b332_28172474(Object(Smarty_Internal_Template))
#3 /home/user/public_html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template))
#4 /home/user/public_html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template))
#5 /home/user/public_html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(385): Smarty_Internal_Template->render()
#6 /home/user/public_html/var/cache/templates/responsive/4d0d2dfc21bc54daf0a394b607d86e83416088b3_2.tygh.payment_methods.tpl.php(367): Smarty_Internal_Template->_subTemplateRender('tygh:views/chec...', NULL, NULL, 0, 3600, Array, 0, true)
#7 /home/user/public_html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_63962bc92e01d8_39514191(Object(Smarty_Internal_Template))
#8 /home/user/public_html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template))
#9 /home/user/public_html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template))
#10 /home/user/public_html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(385): Smarty_Internal_Template->render()
#11 /home/user/public_html/var/cache/templates/responsive/8dd91c205261f527018188141f57a90d93c85c25_2.tygh.order_repay.tpl.php(80): Smarty_Internal_Template->_subTemplateRender('tygh:views/chec...', NULL, NULL, 0, 3600, Array, 0, true)
#12 /home/user/public_html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_639919312e9286_84998164(Object(Smarty_Internal_Template))
#13 /home/user/public_html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template))
#14 /home/user/public_html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template))
#15 /home/user/public_html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(385): Smarty_Internal_Template->render()
#16 /home/user/public_html/var/cache/templates/responsive/fab4fa0d706818e570e5f2f52c447f461a427f33_2.tygh.details.tpl.php(1199): Smarty_Internal_Template->_subTemplateRender('tygh:views/orde...', NULL, NULL, 0, 3600, Array, 0, true)
#17 /home/user/public_html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_639919311b5eb2_15585167(Object(Smarty_Internal_Template))
#18 /home/user/public_html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template))
#19 /home/user/public_html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template))
#20 /home/user/public_html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(238): Smarty_Internal_Template->render(false, 0)
#21 /home/user/public_html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(116): Smarty_Internal_TemplateBase->_execute(Object(Smarty_Internal_Template), NULL, NULL, NULL, 0)
#22 /home/user/public_html/app/Tygh/SmartyEngine/Core.php(81): Smarty_Internal_TemplateBase->fetch('views/orders/de...', NULL, NULL, NULL, false, true, false)
#23 /home/user/public_html/app/Tygh/BlockManager/RenderManager.php(785): Tygh\SmartyEngine\Core->fetch('views/orders/de...')
#24 /home/user/public_html/app/Tygh/BlockManager/RenderManager.php(639): Tygh\BlockManager\RenderManager::_renderMainContent()
#25 /home/user/public_html/app/Tygh/BlockManager/RenderManager.php(493): Tygh\BlockManager\RenderManager::renderBlockContent(Array, Array)
#26 /home/user/public_html/app/Tygh/BlockManager/RenderManager.php(415): Tygh\BlockManager\RenderManager::renderBlock(Array, Array, 'C')
#27 /home/user/public_html/app/Tygh/BlockManager/RenderManager.php(373): Tygh\BlockManager\RenderManager->renderBlocks(Array)
#28 /home/user/public_html/app/Tygh/BlockManager/RenderManager.php(230): Tygh\BlockManager\RenderManager->renderGrid(Array)
#29 /home/user/public_html/app/Tygh/BlockManager/RenderManager.php(200): Tygh\BlockManager\RenderManager->renderGrids(Array)
#30 /home/user/public_html/app/Tygh/BlockManager/RenderManager.php(164): Tygh\BlockManager\RenderManager->_renderContainer(Array)
#31 /home/user/public_html/app/functions/smarty_plugins/function.render_location.php(52): Tygh\BlockManager\RenderManager->render()
#32 /home/user/public_html/var/cache/templates/responsive/dcfb076307aed7b96ec688de0a7d71f8f110ab88_2.tygh.index.tpl.php(156): smarty_function_render_location(Array, Object(Smarty_Internal_Template))
#33 /home/user/public_html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_639617473d06a3_97235882(Object(Smarty_Internal_Template))
#34 /home/user/public_html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template))
#35 /home/user/public_html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template))
#36 /home/user/public_html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(238): Smarty_Internal_Template->render(false, 0)
#37 /home/user/public_html/app/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(116): Smarty_Internal_TemplateBase->_execute(Object(Smarty_Internal_Template), NULL, NULL, NULL, 0)
#38 /home/user/public_html/app/Tygh/SmartyEngine/Core.php(81): Smarty_Internal_TemplateBase->fetch('index.tpl', NULL, NULL, NULL, false, true, false)
#39 /home/user/public_html/app/functions/fn.control.php(632): Tygh\SmartyEngine\Core->fetch('index.tpl')
#40 /home/user/public_html/index.php(25): fn_dispatch()
#41 {main}

After some investigating, it appears that I am missing some settings in checkout so this may not be a bug but an incomplete update instead.

Settings that are missing:
Zero price action:
Minimum quantity to buy per product:
Maximum quantity to buy per product:
Quantity step:
Number of available quantities:

Admins, feel free to move this to Issues and Troubleshooting.

If anyone has any idea where to look for this issue, please let me know. Currently I am missing settings in General, Appearance and Checkout. I am not seeing anything in the files nor settings in the database. Maybe I am looking in the wrong place?

Hello!

Try adding the following line of the code:

    'allow_global_individual_settings' => true, // Allow global individual settings (Track inventory, Options type, Zero price action etc.)

into the existing $config['tweaks'] array:

$config['tweaks'] = array (
...
    'allow_global_individual_settings' => true, // Allow global individual settings (Track inventory, Options type, Zero price action etc.)
);

in the config.local.php file inside your installation. This should do the trick with adding back the missing settings at the ** Settings > Checkout** page of the admin panel.

Hello,

Thanks for the reply.

I had already checked config.local.php and that tweak was already set.

In debug mode, I can see the specific settings being queried. However, looking at the page source, the file/script /js/tygh/backend/components/global_individual.js isn’t showing. I have checked the file and even replaced it but still no luck.

Since the settings are being queried, even though they are not displaying in the settings page, would this even be the cause of my original issue?

Hello!

In this case I can recommend you to contact us directly via Help Desk, this issue requires detailed examination in your installation.

Thanks.

Thanks but I gave up using Help Desk years ago.

I think I am dealing with 2 different issues but I am trying to concentrate on the settings not being viewable. The settings are viewable on mobile (responsive) but not on desktop. I don’t think it’s related to browser because I can view the settings on the demo site. Any ideas? Maybe something not installed on server?

It’s you in vain, of course, but I can’t force you to use our services :slight_smile:

The described case is very strange indeed. Could you please send me the saved page (html file will be enough) of the Settings > Checkout page of your admin panel via the direct message, so I can at least try to check what’s going on.

I ended up contacting help desk with this issue and the Step-by-Step Checkout was causing the issue.

The problem was related to the Step-by-Step Checkout [Deprecated] add-on. This add-on is not supported by our team anymore, so we do not recommend using it in the new versions in order to avoid unexpected issues.

As a workaround, I have replaced the following line:

{include file="views/checkout/components/final_section.tpl" is_payment_step=true suffix=$tab_id}

with this code:

{if !$order_id} {include file="views/checkout/components/final_section.tpl" is_payment_step=true suffix=$tab_id} {/if}

in the design/themes/responsive/templates/addons/step_by_step_checkout/overrides/views/checkout/components/payments/payment_methods.tpl file of your installation.

I am still not sure why I can’t see the global settings but support could so I am not that concerned.

2 Likes