Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Price from a js form to cart


tazwales

Recommended Posts

Hi, I've been a web designer and programmer for years but I've never been tasked with developing a eCommerce shop before - and I didn't seem to start with an easy one.

 

I am creating a shop to sell foam cut-to-size (for chairs, cushions and sofas) and to sell other sundry items (sundry items done - simple with oscommerce) but here's my problem:

 

I have tried to add a product called foam cut-to-size and had attributes for the thickness, length and width selectable from drop down menus - but they don't add up properly since I'm multiplying the Length by Width by Thickness and then multiplying that by the price per cm² (or ³ whatever it is) so I don't get the proper price because the attributes have their own per-attribute price which gets added onto the price.

 

So, I thought I'd write a simple javascript calculator with the formula LxWxTx(type of foam)x(cost per cm²) and thought adding a submit button to that form would make it transfer into the oscommerce cart... It doesn't.

 

The question I have is how do I make my simple calculator's end result with the customers input of the dimensions add to the cart and checkout through oscommerce and paypal?

 

I hope someone here can help because I've spent so many hours on this it's starting to become irritating.

 

If anyone wishes to see what I've managed so far (second attempt at the shop, so it's got the default products installed) go to www.foamltd.co.uk

 

Thank you. And I'm sure if it's a lot of work I will be happy (not happy, but willing :P) to pay for the right solution.

 

Taz

Link to comment
Share on other sites

I wouldn't submit a form I'd send an ajax query with the necessary variables via _GET (including the osCsid to retain session state) to a new php page (application_top.php would need to be called at the top and application_bottom at the bottom) which adds the necessary costs etc to the cart object. On success of the ajax query header redirect the customer to the cart.

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