close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Discount on Quantity of an Item

Thread began 1/25/2011 9:43 am by bjgarner241692 | Last modified 1/25/2011 2:03 pm by bjgarner241692 | 2929 views | 13 replies

bjgarner241692

If you insist:

php:
<?php

$param_product 
"-1";
if (isset(
$_GET["ID"])) {
  
$param_product = (get_magic_quotes_gpc()) ? $_GET["ID"] : addslashes($_GET["ID"]);
}
mysql_select_db($database_constring$constring);
$query_product sprintf("SELECT Name,Description,Picture,Extra,prod_pricing.pricelevel,prod_pricing.price, prod_pricing.ID FROM life_prods INNER JOIN prod_pricing ON life_prods.Name = prod_pricing.ProdName WHERE %s = life_prods.ID ORDER BY prod_pricing.Price"GetSQLValueString($param_product"int"));
$product mysql_query($query_product$constring) or die(mysql_error());
$row_product mysql_fetch_assoc($product);
$totalRows_product mysql_num_rows($product);
?>
<?php
// WA eCart AddToCart
if (isset($_POST["eCart1_1_ATC"]) || isset($_POST["eCart1_1_ATC_x"]))     {
  
$ATC_itemID $_POST["eCart1_1_ID_Add"];
  
$ATC_AddIfIn 0;
  
$ATC_RedirectAfter "cart.php";
  
$ATC_RedirectIfIn  "cart.php";
  if (isset(
$totalRows_product) && $totalRows_product 0)     {
    
$row_product WAEC_findRecordMySQL($product"ID"$ATC_itemID);
    if (
$row_product)     {
      
$ATC_itemName "".$row_product['Name']  ."";// column binding
      
$ATC_itemDescription "".$row_product['pricelevel']  ."";// column binding
      
$ATC_itemWeight floatval("0");// column binding
      
$ATC_itemQuantity "".$_POST["eCart1_1_Quantity_Add"]  ."";// column binding
      
$ATC_itemPrice floatval("".$row_product['price']  ."");// column binding
      
mysql_data_seek($product0);
      
$row_product mysql_fetch_assoc($product);
    }
  }
  
$ATC_itemQuantity floatval($ATC_itemQuantity);
  if (
is_numeric($ATC_itemQuantity) && $ATC_itemQuantity != 0)     {
    
$eCart1->AddToCart($ATC_AddIfIn$ATC_RedirectIfIn$ATC_itemID$ATC_itemName$ATC_itemDescription$ATC_itemWeight$ATC_itemQuantity$ATC_itemPrice);
    if (
$ATC_RedirectAfter != "" && $eCart1->redirStr == "")     {
      
$eCart1->redirStr $ATC_RedirectAfter;
    }
    if (isset(
$_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != "")  {
      
$_SESSION['WAEC_ContinueRedirect'] = $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];
    }
    else  {
      
$_SESSION['WAEC_ContinueRedirect'] = $_SERVER['PHP_SELF'];
    }
  }
}
?>



php:
<form name="eCart1_1_ATC_<?php echo $row_product["ID"]; ?>" method="POST"  action="<?php echo $_SERVER["PHP_SELF"]; ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "")?"?".$_SERVER["QUERY_STRING"]:""?>">

                        <input type="hidden" name="eCart1_1_ID_Add" value="<?php echo $row_product["ID"]; ?>" />
                        <input type="text" name="eCart1_1_Quantity_Add" value="1" size="4" >
                        <input type="submit" class="eC_FormButton" value="Add to Cart" name="eCart1_1_ATC">
                        </form>

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...