Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Contribution: Remind customer update cart on change quantity


Paul_w

Recommended Posts

Thanks for the link - here's why I din't use this method for my contribution and probably will not:

 

Picking an amount from a dropdown menu might be ok for some shops, for others it is not, like if you want to change an amount from , say 12753 to 8534, it would be simply silly to use a dd menu, and I want this conrtib to be for all shops.

Contrib 1518 doesn't address the problem for browsers w/o JS, or JS disabled.

And although I'm no lawyer, I still believe that picking the amount from a dd menu and then not confirming this with a button might not be enough to bypass possible legal issues in some places (as the author's of 1518, by the way ;) )- but I'm not sure about this.

Besides I don't think I really want another database query for something as minor as this, so...

 

Anyways, use whatever floats your boat - adding extra delete-buttons is no biggie, if you can't do it yourself, maybe you can find someone to do it for you.

 

Nils

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...

The Change number of products ordered easily contribution only seems to work with MS2.

 

Does any one know if there is a similar one for MS1 or how to modify it to work with MS1?

Link to comment
Share on other sites

  • 1 month later...

Hi Nils

Thanks for posting such a useful contribution, unfortunately I am having a problem installing it, I have downloaded the latest version and have done the entire installation as per your nicely detailed instructions EXCEPT steps 3 and 4 > I cannot find the code referred to in catalog/shopping_cart.php

'text' => tep_draw_checkbox_field('cart_delete[]', $products[$i]['id']));

and

'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']));

Here is all of the code from my file

<?php
/*
 $Id: shopping_cart.php,v 1.2 2003/01/15 20:17:18 wilt Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License
*/

 require("includes/application_top.php");

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHOPPING_CART);

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<?php
// BOF: WebMakers.com Changed: Header Tag Controller v1.0
// Replaced by header_tags.php
if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
 require(DIR_WS_INCLUDES . 'header_tags.php');
} else {
?> 
 <title><?php echo TITLE ?></title>
<?php
}
// EOF: WebMakers.com Changed: Header Tag Controller v1.0
?>
<base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="<? echo THEMA_STYLE;?>">
<script type="text/javascript">
<!--
function advisecustomer() 
{
 warn_string = <?php echo '"<b><span class=\"errorText\">'.TEXT_UPDATE_WARNING.'</span></b>"'; ?>;

 if (document.getElementById && document.getElementById("update_warning")) {
   document.getElementById("update_warning").innerHTML = warn_string;
 } else if (document.all && document.all["update_warning"]) {
   document.all["update_warning"].innerHTML = warn_string;
 }
}
//-->
</script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_cart.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
 if ($cart->count_contents() > 0) {
?>
     <tr>
       <td><form name="cart_quantity" method="post" action="<?php echo tep_href_link(FILENAME_SHOPPING_CART, 'action=update_product', 'NONSSL'); ?>">
       <table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
   $any_out_of_stock = 0;
   $products = $cart->get_products();
   for ($i=0; $i<sizeof($products); $i++) {

// Push all attributes information in an array
     if ($products[$i]['attributes']) {
       while (list($option, $value) = each($products[$i]['attributes'])) {
         echo '<input type="hidden" name="id[' . $products[$i]['id'] . '][' . $option . ']" value="' . $value . '">';
         $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix
                                     from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
                                     where pa.products_id = '" . $products[$i]['id'] . "'
                                      and pa.options_id = '" . $option . "'
                                      and pa.options_id = popt.products_options_id
                                      and pa.options_values_id = '" . $value . "'
                                      and pa.options_values_id = poval.products_options_values_id
                                      and popt.language_id = '" . $languages_id . "'
                                      and poval.language_id = '" . $languages_id . "'");
         $attributes_values = tep_db_fetch_array($attributes);

         $products[$i][$option]['products_options_name'] = $attributes_values['products_options_name'];
         $products[$i][$option]['options_values_id'] = $value;
         $products[$i][$option]['products_options_values_name'] = $attributes_values['products_options_values_name'];
         $products[$i][$option]['options_values_price'] = $attributes_values['options_values_price'];
         $products[$i][$option]['price_prefix'] = $attributes_values['price_prefix'];
       }
     }
   }
   require(DIR_WS_MODULES. 'order_details.php');
?>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <!-- start Customer Update Cart Reminder 2.0 -->
<td class="main">
<table width="100%" cellpadding="1" cellspacing="0" border="0">
<tr>
<td class="main">
<script type="text/javascript">
<!--
if (!(document.getElementById) && !(document.all)) {
document.write("<b><span class=\"errorText\"><?php echo TEXT_UPDATE_WARNING; ?></span>");
}
else {
document.write("<span id=\"update_warning\" class=\"errorText\"> </span>");
}
//-->
</script>
<noscript>
<b><span class="errorText"><?php echo TEXT_UPDATE_WARNING; ?></span></b>
</noscript>
</td>
<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td align="right" class="main" valign="top" nowrap><b><?php echo SUB_TITLE_SUB_TOTAL; ?> <?php echo $currencies->format($cart->show_total()); ?></b></td>
</tr>
</table>
</td>
<!-- end Customer Update Cart Reminder 2.0 -->
     </tr>
<?php
   if ($any_out_of_stock) {
     if (STOCK_ALLOW_CHECKOUT == 'true') {
?>
     <tr>
       <td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CAN_CHECKOUT; ?></td>
     </tr>
<?php
     } else {
?>
     <tr>
       <td class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CANT_CHECKOUT; ?></td>
     </tr>
<?php
     }
   }
?>
     <tr>
       <td><br><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main"><?php echo tep_image_submit('button_update_cart.gif', IMAGE_BUTTON_UPDATE_CART); ?></td>
<?php
   if ($navigation->path[sizeof($navigation->path)-2]) {
?>
           <td class="main"><?php echo '<a href="' . tep_href_link($navigation->path[sizeof($navigation->path)-2]['page'], tep_array_to_string($navigation->path[sizeof($navigation->path)-2]['get'], array('action')), $navigation->path[sizeof($navigation->path)-2]['mode']) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?></td>
<?php
   }
?>
           <td align="right" class="main"><a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT); ?></a></td>
         </tr>
       </table></form></td>
     </tr>
<?php
 } else {
?>
     <tr>
       <td align="center" class="main"><?php echo TEXT_CART_EMPTY; ?></td>
     </tr>
     <tr>
       <td align="right" class="main"><br><a href="<?php echo tep_href_link(FILENAME_DEFAULT); ?>"><?php echo tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></a></td>
     </tr>
<?php
 }
?>
   </table></td>
<!-- body_text_eof //-->
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
   </table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Any help would be appreciated since I think your contribution is an excellent idea and almost a necessity!

Cheers .... David

Link to comment
Share on other sites

David, please note that this is an update for osC 2.2 Milestone 2. The file version number is

$Id: shopping_cart.php,v 1.73 2003/06/09 23:03:56 hpdl Exp $

Your file:

$Id: shopping_cart.php,v 1.2 2003/01/15 20:17:18 wilt Exp $

...which means, you have an older build than MS2!

 

Sorry ;)

Link to comment
Share on other sites

I love this contribution - it's perfect for those "spacey" customers (like my mother, "ahem") who don't pay much attention to the processes that go on. they just like to click.

 

it definitely covers the store owner's butt when it comes to accidental checkouts; ie "I meant I wanted 4, not 6" and having to issue refunds, etc.

 

great work! :)

Link to comment
Share on other sites

I don't suppose you know of a similar mod for older versions?

Well the original contribution http://www.oscommerce.com/community/contributions,1008 was for MS 1 (entries 02/19/2003 and 02/20/2003). It's basically the same as my version Customer Update Cart Reminder 2.0, but it doesn't have the features I listed (at entry 09/20/2003 )

 

Regards

Nils

Link to comment
Share on other sites

  • 4 months later...
  • 1 year later...

Hi,

 

I've installed this mod and it works perfectly. There's is one small issue though..... I've also installed a mod that apply quantity boxes instead of the "buy now" button. So when I click inside a quantity box your mod immediately displays the error message. And when I click the checkout button I goes to the next page without clicking the "update" button!!

Can you help me on this one?

 

Thanks

 

PS: you can check my site here: http://www.vermoolen.com/catalog/shopping_cart.php. It's dutch...

Edited by meules
Link to comment
Share on other sites

Hi,

 

I've installed this mod and it works perfectly. There's is one small issue though..... I've also installed a mod that apply quantity boxes instead of the "buy now" button. So when I click inside a quantity box your mod immediately displays the error message. And when I click the checkout button I goes to the next page without clicking the "update" button!!

Can you help me on this one?

 

Thanks

 

PS: you can check my site here: http://www.vermoolen.com/catalog/shopping_cart.php. It's dutch...

 

Never mind

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...