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

Save For Later Support Thread

Views: 64,707

Results 41 to 60 of 226
1 Sep 2009, 3:34 PM
#41
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Save For Later Support Thread

globalmemory:

Please can you post the modified code for that layout here.

You can move any of the code blocks to appear where ever you want on the page, so you can move the Paypal Express Checkout button to somwhere else, or any other button, etc. As long as the buttons appear before the </form> tag you are fine, although the Paypal Express Checkout button doesn't need to be within the form tag to still work.

<?php
/**
 * Page Template
 *
 * Loaded automatically by index.php?main_page=shopping_cart.<br />
 * Displays shopping-cart contents
 *
 * @package templateSystem
 * @copyright Copyright 2003-2007 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_shopping_cart_default.php 5554 2007-01-07 02:45:29Z drbyte $
 */
?>
<div class="centerColumn" id="shoppingCartDefault">
<?php
  // save for later setup 
  if (isset($_SESSION['customer_id']) && $_SESSION['customer_id'] != '') {
      $sfl_productArray = get_sfl_contents(); 
      if (sizeof($sfl_productArray) > 0) {
            $flagHasSavedContents = 1;
      }    
  }

  if ($flagHasCartContents || $flagHasSavedContents) {
?>
<div class="forward"><?php echo TEXT_VISITORS_CART; ?></div>

<!--  // end save for later setup  -->

<h1 id="cartDefaultHeading"><?php echo HEADING_TITLE; ?></h1>

<?php if ($messageStack->size('shopping_cart') > 0) echo $messageStack->output('shopping_cart'); ?>

<?php echo zen_draw_form('cart_quantity', zen_href_link(FILENAME_SHOPPING_CART, 'action=update_product')); ?>
<div id="cartInstructionsDisplay" class="content"><?php echo TEXT_INFORMATION; ?></div>

<?php if (!empty($totalsDisplay)) { ?>
  <div class="cartTotalsDisplay important"><?php echo $totalsDisplay; ?></div>
  <br class="clearBoth" />
<?php } ?>

<?php  if ($flagAnyOutOfStock) { ?>

<?php    if (STOCK_ALLOW_CHECKOUT == 'true') {  ?>

<div class="messageStackError"><?php echo OUT_OF_STOCK_CAN_CHECKOUT; ?></div>

<?php    } else { ?>
<div class="messageStackError"><?php echo OUT_OF_STOCK_CANT_CHECKOUT; ?></div>

<?php    } //endif STOCK_ALLOW_CHECKOUT ?>
<?php  } //endif flagAnyOutOfStock ?>

<table  border="0" width="100%" cellspacing="0" cellpadding="0" id="cartContentsDisplay">
     <tr class="tableHeading">
        <th scope="col" id="scSFLHeading"><?php echo " "; ?></th>
        <th scope="col" id="scQuantityHeading"><?php echo TABLE_HEADING_QUANTITY; ?></th>
        <th scope="col" id="scUpdateQuantity"> </th>
        <th scope="col" id="scProductsHeading"><?php echo TABLE_HEADING_PRODUCTS; ?></th>
        <th scope="col" id="scUnitHeading"><?php echo TABLE_HEADING_PRICE; ?></th>
        <th scope="col" id="scTotalHeading"><?php echo TABLE_HEADING_TOTAL; ?></th>
        <th scope="col" id="scRemoveHeading"> </th>
     </tr>
         <!-- Loop through all products /-->
<?php
  if (is_array($productArray)) {
  foreach ($productArray as $product) {
?>
     <tr class="<?php echo $product['rowClass']; ?>">
       <td class="cartQuantityUpdate">
          <a href="<?php echo zen_href_link('saveforlater', 'action=sfl_save_for_later&product_id=' . $product['id']); ?>"><?php echo zen_image_button(BUTTON_IMAGE_SAVE_FOR_LATER, BUTTON_SAVE_FOR_LATER_ALT) . '</a>'; ?>
       </td>
       <td class="cartQuantity">
<?php
  if ($product['flagShowFixedQuantity']) {
    echo $product['showFixedQuantityAmount'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
  } else {
    echo $product['quantityField'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
  }
?>
       </td>
       <td class="cartQuantityUpdate">
<?php
  if ($product['buttonUpdate'] == '') {
    echo '' ;
  } else {
    echo $product['buttonUpdate'];
  }
?>
       </td>
       <td class="cartProductDisplay">
<a href="<?php echo $product['linkProductsName']; ?>"><span id="cartImage" class="back"><?php echo $product['productsImage']; ?></span><span id="cartProdTitle"><?php echo $product['productsName'] . '<span class="alert bold">' . $product['flagStockCheck'] . '</span>'; ?></span></a>
<br class="clearBoth" />


<?php
  echo $product['attributeHiddenField'];
  if (isset($product['attributes']) && is_array($product['attributes'])) {
  echo '<div class="cartAttribsList">';
  echo '<ul>';
    reset($product['attributes']);
    foreach ($product['attributes'] as $option => $value) {
?>

<li><?php echo $value['products_options_name'] . TEXT_OPTION_DIVIDER . nl2br($value['products_options_values_name']); ?></li>

<?php
    }
  echo '</ul>';
  echo '</div>';
  }
?>
       </td>
       <td class="cartUnitDisplay"><?php echo $product['productsPriceEach']; ?></td>
       <td class="cartTotalDisplay"><?php echo $product['productsPrice']; ?></td>
       <td class="cartRemoveItemDisplay">
<?php
  if ($product['buttonDelete']) {
?>
           <a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, 'action=remove_product&product_id=' . $product['id']); ?>"><?php echo zen_image($template->get_template_dir(ICON_IMAGE_TRASH, DIR_WS_TEMPLATE, $current_page_base,'images/icons'). '/' . ICON_IMAGE_TRASH, ICON_TRASH_ALT); ?></a>
<?php
  }
  if ($product['checkBoxDelete'] ) {
    echo zen_draw_checkbox_field('cart_delete[]', $product['id']);
  }
?>
</td>
     </tr>
<?php
  } // end foreach ($productArray as $product)
  }
?>
       <!-- Finished loop through all products /-->
      </table>

<div id="cartSubTotal"><?php echo SUB_TITLE_SUB_TOTAL; ?> <?php echo $cartShowTotal; ?></div>
<br class="clearBoth" />

<!--bof shopping cart buttons-->
<div class="buttonRow forward"><?php echo '<a href="' . zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CHECKOUT, BUTTON_CHECKOUT_ALT) . '</a>'; ?></div>
<div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_CONTINUE_SHOPPING, BUTTON_CONTINUE_SHOPPING_ALT) . '</a>'; ?></div>
<!-- ** BEGIN PAYPAL EXPRESS CHECKOUT ** -->
<?php  // the tpl_ec_button template only displays EC option if cart contents >0 and value >0
if (defined('MODULE_PAYMENT_PAYPALWPP_STATUS') && MODULE_PAYMENT_PAYPALWPP_STATUS == 'True') {
  include(DIR_FS_CATALOG . DIR_WS_MODULES . 'payment/paypal/tpl_ec_button.php');
}
?>
<!-- ** END PAYPAL EXPRESS CHECKOUT ** -->
<?php
// show update cart button
  if (SHOW_SHOPPING_CART_UPDATE == 2 or SHOW_SHOPPING_CART_UPDATE == 3) {
?>
<div class="buttonRow back"><?php echo zen_image_submit(ICON_IMAGE_UPDATE, ICON_UPDATE_ALT); ?></div>
<?php
  } else { // don't show update button below cart
?>
<?php
  } // show update button
?>
<!--eof shopping cart buttons-->
</form>
<!-- bof save for later -->
<br class="clearBoth" />
<?php
  if (isset($_SESSION['customer_id']) && $_SESSION['customer_id'] != '' && (is_array($sfl_productArray)) && (sizeof($sfl_productArray) > 0)) {
?>
<h1><?php echo SFL_HEADING_TITLE; ?></h1>
<table  border="0" width="100%" cellspacing="0" cellpadding="0" id="cartContentsDisplay">
     <tr class="tableHeading">
        <th scope="col" id="sfl_scMoveToCart"> </th>
        <th scope="col" id="sfl_scProductsHeading"><?php echo TABLE_HEADING_PRODUCTS; ?></th>
        <th scope="col" id="sfl_scUnitHeading"><?php echo TABLE_HEADING_PRICE; ?></th>
        <th scope="col" id="sfl_scRemoveHeading"> </th>
        <th scope="col" id="sfl_scUpdateQuantity"> </th>
     </tr>
         <!-- Loop through all products /-->
<?php
  foreach ($sfl_productArray as $product) {
?>
     <tr class="<?php echo $product['rowClass']; ?>">
       <td class="cartQuantityUpdate">
          <a href="<?php echo zen_href_link('saveforlater', 'action=sfl_move_to_cart&product_id=' . $product['id']); ?>"><?php echo zen_image_button(BUTTON_IMAGE_MOVE_TO_CART, BUTTON_MOVE_TO_CART_ALT) . '</a>'; ?>
       </td>
       <td class="cartProductDisplay">
<a href="<?php echo $product['linkProductsName']; ?>"><span id="cartImage" class="back"><?php echo $product['productsImage']; ?></span><span id="cartProdTitle"><?php echo $product['productsName'] . '<span class="alert bold">' . $product['flagStockCheck'] . '</span>'; ?></span></a>
<br class="clearBoth" />


<?php
  echo $product['attributeHiddenField'];
  if (isset($product['attributes']) && is_array($product['attributes'])) {
  echo '<div class="cartAttribsList">';
  echo '<ul>';
    reset($product['attributes']);
    foreach ($product['attributes'] as $option => $value) {
?>

<li><?php echo $value['products_options_name'] . TEXT_OPTION_DIVIDER . nl2br($value['products_options_values_name']); ?></li>

<?php
    }
  echo '</ul>';
  echo '</div>';
  }
?>
       </td>
       <td class="cartUnitDisplay"><?php echo $product['productsPriceEach']; ?></td>
       <td class="cartRemoveItemDisplay">
<?php
  if ($product['buttonDelete']) {
?>
           <a href="<?php echo zen_href_link('saveforlater', 'action=sfl_remove_product&product_id=' . $product['id']); ?>"><?php echo zen_image($template->get_template_dir(ICON_IMAGE_TRASH, DIR_WS_TEMPLATE, $current_page_base,'images/icons'). '/' . ICON_IMAGE_TRASH, BUTTON_SFL_TRASH_ALT); ?></a>
<?php
  }
  if ($product['checkBoxDelete'] ) {
    echo zen_draw_checkbox_field('sfl_delete[]', $product['id']);
  }
?>
        </td>
     </tr>
<?php
  } // end foreach ($productArray as $product)
?>
       <!-- Finished loop through all products /-->
      </table>

<?php
  }  // if show sfl
?>

<?php
if ($flagHasCartContents) {
?>

<!-- eof save for later -->
<br class="clearBoth" />
<?php
    if (SHOW_SHIPPING_ESTIMATOR_BUTTON == '1') {
?>

<div class="buttonRow back"><?php echo '<a href="javascript:popupWindow(\'' . zen_href_link(FILENAME_POPUP_SHIPPING_ESTIMATOR) . '\')">' .
 zen_image_button(BUTTON_IMAGE_SHIPPING_ESTIMATOR, BUTTON_SHIPPING_ESTIMATOR_ALT) . '</a>'; ?></div>
<?php
    }
?>



<?php
      if (SHOW_SHIPPING_ESTIMATOR_BUTTON == '2') {
/**
 * load the shipping estimator code if needed
 */
?>
      <?php require(DIR_WS_MODULES . zen_get_module_directory('shipping_estimator.php')); ?>

<?php
      }
?>
<?php
   }  // if flagHasCartContents
  } else {
?>

<h2 id="cartEmptyText"><?php echo TEXT_CART_EMPTY; ?></h2>

<?php
$show_display_shopping_cart_empty = $db->Execute(SQL_SHOW_SHOPPING_CART_EMPTY);

while (!$show_display_shopping_cart_empty->EOF) {
?>

<?php
  if ($show_display_shopping_cart_empty->fields['configuration_key'] == 'SHOW_SHOPPING_CART_EMPTY_FEATURED_PRODUCTS') { ?>
<?php
/**
 * display the Featured Products Center Box
 */
?>
<?php require($template->get_template_dir('tpl_modules_featured_products.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_featured_products.php'); ?>
<?php } ?>

<?php
  if ($show_display_shopping_cart_empty->fields['configuration_key'] == 'SHOW_SHOPPING_CART_EMPTY_SPECIALS_PRODUCTS') { ?>
<?php
/**
 * display the Special Products Center Box
 */
?>
<?php require($template->get_template_dir('tpl_modules_specials_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_specials_default.php'); ?>
<?php } ?>

<?php
  if ($show_display_shopping_cart_empty->fields['configuration_key'] == 'SHOW_SHOPPING_CART_EMPTY_NEW_PRODUCTS') { ?>
<?php
/**
 * display the New Products Center Box
 */
?>
<?php require($template->get_template_dir('tpl_modules_whats_new.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_whats_new.php'); ?>
<?php } ?>

<?php
  if ($show_display_shopping_cart_empty->fields['configuration_key'] == 'SHOW_SHOPPING_CART_EMPTY_UPCOMING') {
    include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS));
  }
?>
<?php
  $show_display_shopping_cart_empty->MoveNext();
} // !EOF
?>
<?php
  }
?>
</div>
1 Sep 2009, 11:25 PM
#42
globalmemory avatar

globalmemory

New Zenner

Join Date:
Sep 2008
Posts:
64
Plugin Contributions:
0

Re: Save For Later Support Thread

Thanks alot for your help to all who contributed to this fix. Problem solved.:bigups::bigups:

8 Oct 2009, 10:40 PM
#43
globalmemory avatar

globalmemory

New Zenner

Join Date:
Sep 2008
Posts:
64
Plugin Contributions:
0

Re: Save For Later Support Thread

Sorry but i'm back. I think there is a bug with this mod. I have text field attributes on all my products. When products with these attributes are saved for later, they are then unable to be moved back to the cart and stays stuck in the saved later table. The only thing you can do is delete the product?:unsure:

9 Oct 2009, 12:12 AM
#44
swguy avatar

swguy

Administrator

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

Re: Save For Later Support Thread

Response by email.

10 Oct 2009, 12:33 AM
#45
swguy avatar

swguy

Administrator

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

Re: Save For Later Support Thread

Can't dup the problem with your database and a default install + my mod. You have installed an incompatible mod that is breaking Save for Later.

6 Nov 2009, 2:51 AM
#46
sckatlyns avatar

sckatlyns

New Zenner

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

Re: Save For Later Support Thread

I just installed the newest version. I have only one problem that I cannot figure out.

Scenario: Product in cart and in Save for later. It works fine until I delete all products from the shopping cart. Then part of the right column shoots over to the left and is in the center column. This leaves a double column on the right side as the rest of the column is then moved up.

If I delete product from the Save and still have product in the cart, that still works fine.

So obviously it is the shopping cart.

I cannot figure out where the problem is. I do not want the right column turned off.

Can you please help?
Thanks,
Kat

6 Nov 2009, 2:54 AM
#47
swguy avatar

swguy

Administrator

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

Re: Save For Later Support Thread

What I suggest is to leave off the right column on the shopping cart page only. This just give you more room for layout. I think it's too crowded once you add the save for later information with the right column on.

For the specific problem you're having, try running it through an html validator to see if the template has left off a closing div; sometimes that soft of things causes the problem you're seeing.

6 Nov 2009, 4:59 AM
#48
sckatlyns avatar

sckatlyns

New Zenner

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

Re: Save For Later Support Thread

Thanks for replying.

I didn't want to remove the column, but I can't find where the problem is.

Now that I turned off the column per your instructions in the the tpl_main_page, I see one more problem.

When I remove all products from the cart and from the Save for Later, the page refreshes and shows New Products, Featured Products etc, but the right column did not come back. If I go to the home page, it comes back.

Any ideas?

Kat

6 Nov 2009, 12:15 PM
#49
swguy avatar

swguy

Administrator

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

Re: Save For Later Support Thread

Some of the markup is unbalanced; I will post fixes shortly.

13 Nov 2009, 1:01 AM
#50
swguy avatar

swguy

Administrator

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

Re: Save For Later Support Thread

Version 1.1 of this mod is now available in the Free Software Add Ons section of this site. It fixes some HTML markup errors which caused display problems for certain templates.

25 Dec 2009, 1:29 AM
#51
mojavelampworkbeads avatar

mojavelampworkbeads

New Zenner

Join Date:
Nov 2009
Posts:
13
Plugin Contributions:
0

Re: Save For Later Support Thread

I'm using template Premium 7A and Zen Cart 1.3.8a - My web address is https://www.mojavelampwork.net

I'm having problems understanding the upload process of SFL.

Once I've unzipped the folder do I upload the entire folder inside of the unzipped folder to the root directory of my site, or the contents inside of the folder? Am I supposed to overwrite the includes folder in my root directory, with the includes folder from SFL?

I appologize for the lame questions, I'm just a bit confused by the instructions for SFL :blush:

Thank you for your help.

Susan

25 Dec 2009, 1:35 AM
#52
swguy avatar

swguy

Administrator

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

Re: Save For Later Support Thread

Save for Later is a tricky mod to install, but the general directions are the same as for any other mod.

Here's my "beginner's guide:"
http://www.thatsoftwareguy.com/zencart_install_mod.html

With SFL, I recommend starting with my template files, then back porting your changes. This way you can be sure that the feature works.

If you have trouble, you can get someone on the Commercial Help Wanted forum to walk you through the install or do it for you.

25 Jan 2010, 5:37 PM
#53
wendyshirai avatar

wendyshirai

New Zenner

Join Date:
Sep 2008
Posts:
12
Plugin Contributions:
0

Re: Save For Later Support Thread

SWGuy, you are a total genius! I always know if I see your name on something, that it will work with very few issues. Have you ever considered creating a shopping list or wish list mod? Ikea's site has a cool feature that allows you to email the shopping list to any address. I've been waiting for 2 years for someone to create a wishlist that doesn't link to a 3rd party service... but being able to email your shopping list is almost as good. would this be difficult to impliment?

25 Jan 2010, 6:18 PM
#54
swguy avatar

swguy

Administrator

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

Re: Save For Later Support Thread

LOL very kind of you. Actually, a guided e-commerce application has been on my drawing board for some time.

6 Jun 2011, 3:27 AM
#55
luvstoxstitch avatar

luvstoxstitch

New Zenner

Join Date:
Jun 2010
Location:
Ohio
Posts:
36
Plugin Contributions:
0

Re: Save For Later Support Thread

I had the Save for Later add on installed and loved it:clap: but when I installed the Free Gift - Dangling Carrot add on the Save for Later went away :cry:

I looked through the files for both addons and the Free Gift add on modified the includes/templates/freetemplate2/templates/tpl_shopping_cart_default.php file (which got rid of the Save for latter modified version). I'm really php illiterate (but I can copy and paste) I've been trying to combine the 2 tpl_shopping_cart_default.php files but with no luck. Could someone help me with this?:wacko:

2 Oct 2011, 9:52 PM
#56
kamelion0927 avatar

kamelion0927

Zen Follower

Join Date:
Dec 2009
Posts:
208
Plugin Contributions:
1

Re: Save For Later Support Thread

Thanks for such a fabulous mod!

If anyone has a sec, I have a non-important issue I'm hoping to get help with. (Sorry - I'm still trying to wrap my head around how the functions work.)

I added SFL to the "my account" page but am having trouble modifying the redirect to suit my situation.

In includes/functions/extra-functions/sfl_functions.php, I tried adding an if statement to the redirect of the actionRemoveProduct function so it now reads:

// from actionRemoveProduct in shopping cart class
  function actionRemoveProduct($parameters) {
    if (!$_SESSION['customer_id']) {
      $_SESSION['navigation']->set_snapshot();
      zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
    }
    if (isset($_GET['product_id']) && zen_not_null($_GET['product_id'])) 
        remove($_GET['product_id']);
   if ($_GET['main_page'] == 'shopping_cart') {
     zen_redirect(zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'));
}else{
zen_redirect(zen_href_link(FILENAME_ACCOUNT, '', 'SSL'));
  }
}

but it redirects to the account page regardless of where the item is deleted from. And if I switch the if statement, it always redirects back to the shopping cart.

I'm (slowly) learning php and would appreciate any assistance (with an explanation as to why it's ignoring the first part of the if statement if possible). Thanks in advance!

12 Nov 2011, 11:18 AM
#57
swguy avatar

swguy

Administrator

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

Re: Save For Later Support Thread

Save For Later has been upgraded to work with Zen Cart 1.5.0. No other functional changes were added in update 1.2.

11 Jan 2012, 4:18 PM
#58
stxmona avatar

stxmona

Zen Follower

Join Date:
Aug 2008
Posts:
103
Plugin Contributions:
0

Re: Save For Later Support Thread

Just curious - has anyone used this mod with COWOA?

I have a few customers complaining about items not staying in their cart, I believe it is that they end up with a "sessions time out" and think that maybe SFL would be a great solution.

Thanks for the response!
Mona

11 Jan 2012, 4:19 PM
#59
swguy avatar

swguy

Administrator

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

Re: Save For Later Support Thread

Bear in mind that you need an account (and need to be logged in) to use Save for Later.

11 Jan 2012, 4:32 PM
#60
stxmona avatar

stxmona

Zen Follower

Join Date:
Aug 2008
Posts:
103
Plugin Contributions:
0

Re: Save For Later Support Thread

Yep - knew that the person needed an account and about 75% of the customers have them...but have those fly by customers that don't want to go through the trouble of registering so that is why COWOA is installed.

I just wanted to know if anyone had COWOA installed and uses SFL before installing the mod.

Thanks
Mona