Zen Cart Logo
Forums / All Other Contributions/Addons / Save For Later Support Thread

Save For Later Support Thread

Views: 64,707

Results 201 to 220 of 226
17 Oct 2023, 4:16 PM
#201
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,690
Plugin Contributions:
56

Save For Later Support Thread

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

19 Oct 2023, 2:27 AM
#202
gothstone avatar

gothstone

Zen Follower

Join Date:
Jun 2005
Posts:
330
Plugin Contributions:
0

Re: Save For Later Support Thread

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) {

19 Oct 2023, 10:36 AM
#203
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,690
Plugin Contributions:
56

Re: Save For Later Support Thread

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.

20 Oct 2023, 1:56 PM
#204
gothstone avatar

gothstone

Zen Follower

Join Date:
Jun 2005
Posts:
330
Plugin Contributions:
0

Re: Save For Later Support Thread

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

else {
      $flagHasSavedContents = 0;
  }

seems to fix it, but doesn't exactly seem right.

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.

22 Oct 2023, 2:56 PM
#205
gothstone avatar

gothstone

Zen Follower

Join Date:
Jun 2005
Posts:
330
Plugin Contributions:
0

Re: Save For Later Support Thread

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 .

22 Oct 2023, 3:09 PM
#206
gothstone avatar

gothstone

Zen Follower

Join Date:
Jun 2005
Posts:
330
Plugin Contributions:
0

Re: Save For Later Support Thread

Ok, I figured out the delete button.
/includes/functions/extra_functions/sfl_functions.php
line 434 reads

    if (empty($_SESSION['customer_id'])) {

and should be

    if (!empty($_SESSION['customer_id'])) {
29 Oct 2023, 2:16 PM
#207
gothstone avatar

gothstone

Zen Follower

Join Date:
Jun 2005
Posts:
330
Plugin Contributions:
0

Re: Save For Later Support Thread

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:

// 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 
30 Oct 2023, 9:21 PM
#208
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,690
Plugin Contributions:
56

Re: Save For Later Support Thread

Submitted a new copy which I believe resolves the PHP 8 issues you have reported.

11 Mar 2024, 2:16 AM
#209
oj_simon avatar

oj_simon

Zen Follower

Join Date:
Nov 2023
Location:
Hounslow
Posts:
129
Plugin Contributions:
0

Re: Save For Later Support Thread

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?

11 Mar 2024, 2:50 AM
#210
oj_simon avatar

oj_simon

Zen Follower

Join Date:
Nov 2023
Location:
Hounslow
Posts:
129
Plugin Contributions:
0

Re: Save For Later Support Thread

OJ_SIMON:

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?
please ignore my this

21 Apr 2024, 11:48 PM
#211
oj_simon avatar

oj_simon

Zen Follower

Join Date:
Nov 2023
Location:
Hounslow
Posts:
129
Plugin Contributions:
0

Re: Save For Later Support Thread

Hi swguy,

First off thank you very much for this excellent Plugin.

Now for my question,
I would like to offer a subscription product of which I can make a payment plugin for that so that's not a issue.
what i would like to run by you is if you would allow me to duplicate this plugin (as i have it installed and working as it is meant for a client facing plugin )
i would like to turn it in to a internal method to automatically separate subscription products from standard products so that standard products can go through the checkout normally then once the payment has had a success response back,
then the customer will be redirected back to the checkout (not cart) to complete the subscription payment and setup and having the subscription payment methods auto selected and payment details auto filled out from the first payment response which would of been saved on file at the payment gateway so they will only have to submit the order unless they wish to add a new payment method of which the payment gateway allows for this.
so this plugin would just be as it is but without displaying it to the page anywhere so the customer never see it or is able to amend it and I add them to the checkout in the background.
this way it is all setup currently otherwise the only way i can see it working is the first subscription payment goes through the checkout as a normal product and on payment success I create the subscription in the background but that will be hard if the subscription has a free trial.

could you let me know if you would allow me to do this?

22 Apr 2024, 10:14 AM
#212
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,690
Plugin Contributions:
56

Re: Save For Later Support Thread

Knock yourself out! Glad it's working for you.

24 Oct 2024, 2:53 PM
#213
ideasgirl avatar

ideasgirl

Totally Zenned

Join Date:
Aug 2005
Location:
Trujillo Alto, Puerto Rico
Posts:
1,437
Plugin Contributions:
3

Re: Save For Later Support Thread

Hi, will the latest version be compatible with v2.0+?

24 Oct 2024, 4:07 PM
#214
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,690
Plugin Contributions:
56

Re: Save For Later Support Thread

I believe so.

19 Nov 2024, 2:11 PM
#215
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Re: Save For Later Support Thread

Thanks for a great plugin I have used for years swguy!

I have one error its throwing in Debug Logs that I am hoping you could help with. I have upgraded to PHP8 in preparation for upgrading to Zen Cart 2.0.1 and it throws the error in my current v.1.5.8a cart with PHP8. (Did not have the error in PHP 7.4):

Undefined variable $flagHasSavedContents in includes/templates/custom/templates/tpl_shopping_cart_default.php on line 28.

Would you be able to suggest the needed code edit?

Thank you!

19 Nov 2024, 6:04 PM
#216
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,690
Plugin Contributions:
56

Re: Save For Later Support Thread

Just updated the plugins library with a version that should fix this.

19 Nov 2024, 7:18 PM
#217
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Re: Save For Later Support Thread

Super...Thanks very much...appreciated!

31 Jan 2025, 5:15 PM
#218
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Re: Save For Later Support Thread

Hi swguy...

I have just completed my development site adding in the addons ,etc. and just had the demo data in my database.

When I dropped in my current live site database (v.1.5.8) and was testing the site for errors, I received this one....

PHP Warning: Undefined variable $flagStockCheck in C:\wamp64\www\new2121\includes\functions\extra_functions\sfl_functions.php on line 98.

Would you be able to suggest what I would need to do to mitigate this?

The operation of the plugin still worked fine on the site....no problems moving it back and forth between the Save and Cart.

Thanks!

31 Jan 2025, 5:18 PM
#219
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,690
Plugin Contributions:
56

Re: Save For Later Support Thread

In /includes/functions/extra_functions/sfl_functions.php

Right above the line
if (STOCK_CHECK == 'true') {

Add
$flagStockCheck = false;

31 Jan 2025, 5:26 PM
#220
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Re: Save For Later Support Thread

Thanks so much for this code change.....I applied it, tested and works perfectly without error!

Thanks very much swguy!