Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

I need help with creating a script / mod to allow a customer of our store (both logged in and not) to be able to add a top level product turned off to a custom product to their cart with the different options:

 

1: a selection of 1-4 for a paper types - ie (4 different layouts) couse be a number 1, 2,3, 4

2: different fields ( name1, name2, name3, date(day/month/year), state)

 

these would need to be store either in osc or out of the standard product attributes.

 

for a completed working script i will gladly pay the author $75 via paypal. ( i am not sure if offering to pay is a voilation of tos - but at this point i am desperate and appoligize in advance)

 

if you can help me out send pm or post reply to this post.

 

my thoughts are to create a new window, using JavaScript and perhaps a script similar to this

 

 function CustomProduct($products_id, $qty = '', $attributes = '') {
  global $new_products_id_in_cart, $customer_id;
  if ($this->in_cart($products_id)) {
		$this->update_quantity($products_id, $qty, $attributes);
  } else {
	if ($qty == '') $qty = '1'; // if no quantity is supplied, then add '1' to the customers basket
	$this->contents[] = array($products_id);
	$this->contents[$products_id] = array('qty' => $qty);
// insert into database
	if ($customer_id) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . tep_db_input($qty) . "', '" . date('Ymd') . "')");

	$new_products_id_in_cart = $products_id;
	tep_session_register('new_products_id_in_cart');
  }
  $this->cleanup();
}

 

call it from the new window with

	$cart->CustomProduct('id from products_dba', 'qty','Name1:John Doe,Name2:Jane Doe,Name3:Kurt Doe,Date(mm/dd/yy), state:Ohio');

 

i am just not sure of how to store it in the db and keep within the convention of osc.

thanks

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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