Re: Save For Later Support Thread
Quote:
Originally Posted by
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 Code:
<?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>
Re: Save For Later Support Thread
Thanks alot for your help to all who contributed to this fix. Problem solved.:bigups::bigups:
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:
Re: Save For Later Support Thread
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.
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
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.
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
Re: Save For Later Support Thread
Some of the markup is unbalanced; I will post fixes shortly.
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.