Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Set own price?


jbutton

Recommended Posts

Just new to OSComerce and so far so good.

 

I work for a local non-profit and figure there must be an easy way to set up a variable amount donation where folks could fill in their own desired amount of donation ... but I could not find it on these forums.

 

Heck - it was didfficult figuring our what to use as a search phrase..?!

 

Anyway - any help would be appreciated.

Link to comment
Share on other sites

  • 3 weeks later...
Just new to OSComerce and so far so good.

 

I work for a local non-profit and figure there must be an easy way to set up a variable amount donation where folks could fill in their own desired amount of donation ... but I could not find it on these forums.

 

Heck - it was didfficult figuring our what to use as a search phrase..?!

 

Anyway - any help would be appreciated.

 

I too am looking for the same. Experts please help..

Jvedula

Link to comment
Share on other sites

  • 1 year later...
Just new to OSComerce and so far so good.

 

I work for a local non-profit and figure there must be an easy way to set up a variable amount donation where folks could fill in their own desired amount of donation ... but I could not find it on these forums.

 

Heck - it was didfficult figuring our what to use as a search phrase..?!

 

Anyway - any help would be appreciated.

 

If you are interested you might try this

 

Contributors could fill in their own desired amount of donation. This is a way I found to let customers fill in their own amount. Set their own price works well for sites that want to take donations and still be able to sell products. Like my page

 

https://df06.dot5hosting.com/~bereanho/osCo...talog/index.php

 

First add a product using the descriptions that you want. You may set the price to whatever. Be sure to find the product_id number. If you do not have a mysql tool you can find the product ID by temporary adding a attribute to the product through the administration panel. Then remove the attribute.

 

Then place this php file named product_info1.php

in the catalog directory. Be sure to the changes in the code in the <!-- add your own html code here //--> and /* this section changes the price in the data base, and redirects to the regular product page where it can be added to the shopping cart. Remember to change the WHERE products_id='30' line to your product id number. Keeping this part in the php code prevents tampering with other product prices.

*/ sections.

 

 

 

 

<?php

/*

$Id: product_info.php,v 1.97 2003/07/01 14:34:54 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

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

 

$product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

$product_check = tep_db_fetch_array($product_check_query);

?>

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

<title><?php echo TITLE; ?></title>

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

<link rel="stylesheet" type="text/css" href="stylesheet.css">

<script language="javascript"><!--

function popupWindow(url) {

window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res

izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le

ft=150')

}

//--></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">

<!-- start update price //-->

 

 

 

<!-- add your own html code here //-->

/* ----------------------------------------------------------------------------------------------------------------------------------------------------------------- */

One of the ways you can help a child  is through a financial donation. No matter how small or large your contribution is, your generosity can make a difference in a child's life.  Your support can provide a loving Christian envirnoment. Just fill the amount you would like to give to the Home. All Donations Are Tax Deductible. The Berean Children's Home  is a 501©3 Charitable Organization<br>

 

<!—this is just a straight from html code //-->

 

<form action="product_info1.php" method="post"> <div style="text-align: center;">Fill in amount: <input name="update_price" align="center" type="text"><br> <input value="This Amount Please" align="center" type="submit"></div> </form>

 

/* -----------------------------------------------------------------------------------------------------------------------------------------------------------

 

this section changes the price in the data base, and redirects to the regular product page where it can be added to the shopping cart. Remember to change the WHERE products_id='30' line to your product id number. Keeping this part in the php code prevents tampering with other produts prices.

*/

 

 

<?

if ($update_price > 0)

 

{

$update_price=$_POST['update_price'];

 

$query="UPDATE products SET products_price='$update_price' WHERE products_id='30'";

mysql_query($query);

 

if ($update_price > 0)

 

header("Location: https://df06.dot5hosting.com/~bereanho/osCo...s_id=30");

echo "hello";

exit;

}

 

 

?>

 

 

 

<!-- end update price //-->

 

<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'); ?>

 

Finally add some html code to you front index page in catalog/includes/languages/english or to one of your information boxes on the right or left like this to get the process started.

 

<a href="http your domain.com /osCommerce/catalog/product_info1.php"><img style="width: 315px; height: 110px;" alt="kids" src="your domain/osCommerce/catalog/images/your image.gif"> </a>

Link to comment
Share on other sites

I would use the attributes for products to do this.

 

You start with a small price then add a higher dollar amount as the Products Attributes.

 

Example would be instead of red as the attribute you would say "Contribution of + $5.00" and increase as much as you would like in the drop down.

 

 

 

Just new to OSComerce and so far so good.

 

I work for a local non-profit and figure there must be an easy way to set up a variable amount donation where folks could fill in their own desired amount of donation ... but I could not find it on these forums.

 

Heck - it was didfficult figuring our what to use as a search phrase..?!

 

Anyway - any help would be appreciated.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...