Check your copy of the file
includes/templates/YOURTEMPLATE/templates/tpl_shopping_cart_default.php
In the one I provide, this flag is set on line 21
Check your copy of the file
includes/templates/YOURTEMPLATE/templates/tpl_shopping_cart_default.php
In the one I provide, this flag is set on line 21
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
Just double-checked, mine is a dead cut and paste from yours. Right after the first div, just before if ($_SESSION['cart']->count_contents() > 0) {
Your line numbers are different, so there must be some difference. Just use my file (installing it in your template folder), then merge back your customizations after testing.
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
This morning I switched my dev site template to responsive, re-uploaded ALL the files from a clean download, and double checked the tpl_shopping_cart_default.php file was your copy. I retested and still get the error below.
I'm running ZC 1.5.8, PHP 8.1.24, and have admin and store logs set to yes.
adding
seems to fix it, but doesn't exactly seem right.Code:else { $flagHasSavedContents = 0; }
The ver 1.9 copy I downloaded has $flagHasSavedContents = 1; on line 24, not line 21, so I'm wondering if we are looking at different versions?
I've also realized that while a logged-in user can move items from cart to SFL and from SFL to cart, the delete button in SFL isn't working. I have tested this both with my copy and with yours while switched to the responsive template. No error is thrown, the page just reloads and nothing changes.
[20-Oct-2023 08:29:00 America/Chicago] Request URI: /shopping_cart, IP address: 73.67.37.4, Language id 1
#0 /includes/templates/responsive_classic/templates/tpl_shopping_cart_default.php(28): zen_debug_error_handler()
#1 /includes/templates/responsive_classic/common/tpl_main_page.php(178): require('/i...')
#2 /index.php(94): require('/i...')
--> PHP Warning: Undefined variable $flagHasSavedContents in /includes/templates/responsive_classic/templates/tpl_shopping_cart_default.php on line 28.
Went ALL the way back to basics on this. Built a clean dev site with zc 1.5.8a, loaded demo products, set logs to on, and installed a freshly downloaded copy of SFL 1.9. you can look at https://dev.pezcollectors.com/blank/
Deleting last product in cart still throws --> PHP Warning: Undefined variable $flagHasSavedContents in /includes/templates/responsive_classic/templates/tpl_shopping_cart_default.php on line 28.
Delete button in the save for later section still doesn't do anything.
Additionally discovered by accident since some demo products have attributes:
[22-Oct-2023 14:31:14 UTC] Request URI: /blank/index.php?main_page=shopping_cart, IP address: 73.67.37.4, Language id 1
#0 /includes/functions/extra_functions/sfl_functions.php(68): zen_debug_error_handler()
#1 /includes/templates/responsive_classic/templates/tpl_shopping_cart_default.php(22): get_sfl_contents()
#2 /includes/templates/responsive_classic/common/tpl_main_page.php(178): require('/home/pcs/dev/b...')
#3 /index.php(94): require('/home/pcs/dev/b...')
--> PHP Deprecated: Automatic conversion of false to array is deprecated in /includes/functions/extra_functions/sfl_functions.php on line 68.
I even tried dropping PHP down from 8.1 to 7.4, same results on delete button and $flagHasSavedContents .
Ok, I figured out the delete button.
/includes/functions/extra_functions/sfl_functions.php
line 434 reads
and should beCode:if (empty($_SESSION['customer_id'])) {
Code:if (!empty($_SESSION['customer_id'])) {
for the PHP Warning: Undefined variable $flagHasSavedContents
my else statement didn't work in some cases. This is what I've come up with that seems to work in all cases so far:
Code:// save for later setup $flagHasSavedContents = 0; if (isset($_SESSION['customer_id']) && $_SESSION['customer_id'] != '') { $sfl_productArray = get_sfl_contents(); if (sizeof($sfl_productArray) > 0) { $flagHasSavedContents = 1; } } if ($flagHasCartContents || $flagHasSavedContents = 1 ) { // end save for later setup
Submitted a new copy which I believe resolves the PHP 8 issues you have reported.
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
ZC 1.5.8,
OPC 2.4.6 (2023-08-19),
SFL 1.9a
Hi,
Has anyone got this addon working with One-Page Checkout (https://www.zen-cart.com/downloads.php?do=file&id=2095) and if so can you supply the changes to the cart page for me?
Bookmarks