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

Save For Later Support Thread

Views: 64,707

Results 21 to 40 of 226
28 Jun 2009, 8:55 PM
#21
anoop avatar

anoop

New Zenner

Join Date:
Oct 2008
Posts:
15
Plugin Contributions:
0

Save For Later Support Thread

Nope. Installed a fresh copy of ZCv1.38a and SFL on the server. the same issue again :( It seems the problem is with the server setup. I really miss feature, it worked on my local machine. Is there any PHP4 specific setting i missed to configure.

Also the phpMyAdmin shows an warning 'mbstring PHP extension was not found and without the mbstring extension phpMyAdmin is unable to split strings correctly and it may result in unexpected results'. Is the error due to this?

30 Jun 2009, 1:59 PM
#22
anoop avatar

anoop

New Zenner

Join Date:
Oct 2008
Posts:
15
Plugin Contributions:
0

Re: Save For Later Support Thread

Issue Solved

In /includes/functions/extra_functions/sfl_functions.php

Changed line 568
```
$cart->add_cart($_POST['products_id'], $cart->get_quantity(zen_get_uprid($_POST['products_id'], $real_ids))+($new_qty), $real_ids);


to

$_SESSION['cart']->add_cart($_POST['products_id'], $_SESSION['cart']->get_quantity(zen_get_uprid($_POST['products_id'], $real_ids))+($new_qty), $real_ids);


Also changed line 658

$cart->remove($_GET['product_id']);

to 

$_SESSION['cart']->remove($_GET['product_id']);


Thanks for your support,
Anoop
30 Jun 2009, 4:32 PM
#23
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 suspect this change will cause problems if the person's session times out and they press the shopping cart page button - no?
The real fix for this problem is to upgrade to PHP5.

1 Jul 2009, 7:27 AM
#24
anoop avatar

anoop

New Zenner

Join Date:
Oct 2008
Posts:
15
Plugin Contributions:
0

Re: Save For Later Support Thread

Checked for session time out, no errors were noticed. As long as this works, the issue is fixed for me. I will be using PHP5 for my next project.
Thanks,
Anoop

26 Aug 2009, 1:36 AM
#25
globalmemory avatar

globalmemory

New Zenner

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

Re: Save For Later Support Thread

I have a problem with this. I've installed it and it's working fine but when all items are saved in the SFL section and there are no items in the shopping cart section then my right column is being distorted. If there is an item in both the shopping cart and saved cart then the column is undistorted? A solution is much appreciated. See attached picture. :unsure:

26 Aug 2009, 2:15 AM
#26
lankeeyankee avatar

lankeeyankee

Totally Zenned

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

Re: Save For Later Support Thread

globalmemory:

I have a problem with this. I've installed it and it's working fine but when all items are saved in the SFL section and there are no items in the shopping cart section then my right column is being distorted. If there is an item in both the shopping cart and saved cart then the column is undistorted? A solution is much appreciated. See attached picture. :unsure:

Looks like a </div>(or one of the table tags) goes missing somewhere in between states of cart with products and only save for later, this is template specific because it hasn't happened on the sites that I implemented this on. Did you merge the tpl_shopping_cart_default.php file? If so then I think you might have missed a closing tag somewhere. So, look at the source on the shopping cart page to see if you can trace where there is a missing </div> or </tr> or </table> etc tag.

26 Aug 2009, 1:59 PM
#27
globalmemory avatar

globalmemory

New Zenner

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

Re: Save For Later Support Thread

Thanks for your response. I've copied the files exactly as they are? can i send you the file so you can have a look at it?

26 Aug 2009, 3:25 PM
#28
lankeeyankee avatar

lankeeyankee

Totally Zenned

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

Re: Save For Later Support Thread

A careful comparison between your original file and the modified file should show the difference. Did the template you are using come with an includes/templates/YOUR_TEMPLATE/templates/tpl_shopping_cart_default.php file? If so, that means there were changes made to the default file which is why it's in your overrides directory and by just dropping in the file that came with save for later you lost the customizing that your template's file has.

If you don't have a comparison tool yet, I would suggest winmerge, it's free and easy to use. You need to merge only those parts that have to do with save for later, sometimes there are other differences to do with using different version core files or other changes that have been made for other mods or templates.

26 Aug 2009, 6:19 PM
#29
globalmemory avatar

globalmemory

New Zenner

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

Re: Save For Later Support Thread

I first of all used winmerge to merge the files and then noticed this problem. I then copied the file as is and the problem still persists?

26 Aug 2009, 9:52 PM
#30
swguy avatar

swguy

Administrator

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

Re: Save For Later Support Thread

Then the problem is a latent bug in your template that this change uncovered. Use an xhtml validator to track down the problem.

28 Aug 2009, 9:53 PM
#31
globalmemory avatar

globalmemory

New Zenner

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

Re: Save For Later Support Thread

this turned out to be a IE8 browser problem but still don't understand why?:unsure:

29 Aug 2009, 12:52 AM
#32
swguy avatar

swguy

Administrator

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

Re: Save For Later Support Thread

Hmm.... just tried with IE8 and it worked ok for me - but one thing is that part of the design intent of this mod was that you turn off the right sidebox on the shopping cart page. Otherwise things do look squeezed - IE 8 or not. See FAQ question 3.

http://www.thatsoftwareguy.com/zencart_saveforlater.html#faq

29 Aug 2009, 2:09 AM
#33
lankeeyankee avatar

lankeeyankee

Totally Zenned

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

Re: Save For Later Support Thread

I use this on a 3 column site layout without problems, see attached pictures. I think this is either a missing closing tag or a simple formatting issue that might need some adjustment to the stylesheet or sfl table/cell properties. Post your tpl_shopping_cart_default.php code here and I'll have a quick look at it. Do you have a link to your live site so I can check it out?

30 Aug 2009, 10:15 PM
#34
globalmemory avatar

globalmemory

New Zenner

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

Re: Save For Later Support Thread

lankeeyankee:

I use this on a 3 column site layout without problems, see attached pictures. I think this is either a missing closing tag or a simple formatting issue that might need some adjustment to the stylesheet or sfl table/cell properties. Post your tpl_shopping_cart_default.php code here and I'll have a quick look at it. Do you have a link to your live site so I can check it out?

<?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 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 -->

<!--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>
<?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>

<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
    }
?>

<!-- ** 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
      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>
30 Aug 2009, 11:44 PM
#35
lankeeyankee avatar

lankeeyankee

Totally Zenned

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

Re: Save For Later Support Thread

Isn't that the copy from the mod? I compared them and they are identical. Doesn't your template already have a customized tpl_shopping_cart_default.php file?

31 Aug 2009, 6:05 PM
#36
globalmemory avatar

globalmemory

New Zenner

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

Re: Save For Later Support Thread

my shopping cart hasn't been modified. Is it possible that it's my computer's browser's cache problem as other IE8 users browsers don't display any distortion?:unsure:

1 Sep 2009, 1:11 AM
#37
lankeeyankee avatar

lankeeyankee

Totally Zenned

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

Re: Save For Later Support Thread

globalmemory:

my shopping cart hasn't been modified. Is it possible that it's my computer's browser's cache problem as other IE8 users browsers don't display any distortion?:unsure:

I just rechecked my site in ie8 and realized that it was on Comaptability View, when compatibility view is turned off it breaks my cart, too!:blush::shocking::cry:

I just checked this in a clean zc install and it does the same thing, so it's not our specific templates, but having 3 columns for some reason breaks it.

I fixed it by moving the </form> tag to right before the save for later code block. I don't know if it will have any unintended effects by taking the sfl out of the form, but I can move to cart and back to save for later and then go to checkout so it seems to work ok. Perhaps swguy could verify that this is ok?

1 Sep 2009, 1:29 AM
#38
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 suspect what you have done will break update cart.

My recommendation remains: turn off the right sidebar on the shopping cart page.

1 Sep 2009, 2:02 AM
#39
lankeeyankee avatar

lankeeyankee

Totally Zenned

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

Re: Save For Later Support Thread

swguy:

I suspect what you have done will break update cart.

My recommendation remains: turn off the right sidebar on the shopping cart page.

Ah, yes... I forgot to mention that on my cart I have the buttons all above the sfl block, so moving the </form> tag doesn't break the update, checkout, paypal checkout or continue shopping buttons. Thanks for pointing that out.

So for those folks that are wed to a 3 column cart page, it looks like you will need to move the sfl block below the cart buttons and </form> tag for it to work correctly in ie8 with Compatibility Mode off.

And thanks again for your great contributions, we use a lot of them!

1 Sep 2009, 1:33 PM
#40
globalmemory avatar

globalmemory

New Zenner

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

Re: Save For Later Support Thread

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