Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need a tip


Get-Wireless 2

Recommended Posts

I would like to add a memory configurator to my Osc store.

A link is placed on my website to Kingstons memory configurator.

The customer will go through the configurator to find which memory module they need.

The customer will then click on a link that sends the customer back to my site and adds that particular memory module to their shopping basket.

Or just put them on the correct product page.

What I need to know is how does Osc add items to the cart.

 

My rep at kingston said he just needs a url which would be like:

www.your_web_shop.com/add_to_basket.php?PartNumber=[PART HERE]

 

Is this going to be possible to implement?

 

Here is a link to the configurator:

http://www.ec.kingston.com/ecom/config/def...sp?referid=1080

Link to comment
Share on other sites

if you read the following topic you will understand how checkout is working:

http://www.oscommerce.com/forums/index.php?showtopic=265779

 

that you need only to post products_id & id

Please read this line: Do you want to find all the answers to your questions? click here. As for contribution database it's located here!

8 people out of 10 don't bother to read installation manuals. I can recommend: if you can't read the installation manual, don't bother to install any contribution yourself.

Before installing contribution or editing/updating/deleting any files, do the full backup, it will save to you & everyone here on the forum time to fix your issues.

Any issues with oscommerce, I am here to help you.

Link to comment
Share on other sites

Hi, thanks for that,

 

However as I am not coder I still dont full understand whats happending :(

 

Can you please just tell me what the link would be?

 

IE www.somewebshop.co.uk/catalog <--What goes next please?

 

Thanks

Link to comment
Share on other sites

www.your_web_shop.com/add_to_basket.php?PartNumber=[PART HERE]

to accept any data from URL, you will need to modify the osc code to:

 

$cart->add_cart($_GET['products_id'], $cart->get_quantity(tep_get_uprid($_GET['products_id'], $_GET['id'])), $_GET['id']);

Please read this line: Do you want to find all the answers to your questions? click here. As for contribution database it's located here!

8 people out of 10 don't bother to read installation manuals. I can recommend: if you can't read the installation manual, don't bother to install any contribution yourself.

Before installing contribution or editing/updating/deleting any files, do the full backup, it will save to you & everyone here on the forum time to fix your issues.

Any issues with oscommerce, I am here to help you.

Link to comment
Share on other sites

However as I am not coder I still dont full understand whats happending :(

 

Can you please just tell me what the link would be?

 

IE www.somewebshop.co.uk/catalog <--What goes next please?

Every time a page is loaded, the file includes/application_top.php gets loaded as one of the first things.

 

If a url contains the get parameter action followed by something like add_product the shopping cart code starts working.

For example:

	  // customer adds a product from the products page
  case 'add_product' :	if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
							$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);
						  }
						  tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
						  break;

In your case it might work if you use a url like www.somewebshop.co.uk/catalog/index.php?action=addtobasket&products_model=###

 

Then you would add a:

	  // customer adds a product from external site
  case 'addtobasket' :	if (isset($HTTP_POST_VARS['products_model']) && is_numeric($HTTP_POST_VARS['products_model'])) {
........code to sanitize the products_model paramater, then a query using products_model to find a products_id and then the cart->add_cart stuff with the variables the query produced..........

							$cart->add_cart($from_query['products_id'], ....modified code....);
						  }
						  tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
						  break;

Of course there might issues with the sessions, where customer lose their carts when switching back and forth with the external site.

Link to comment
Share on other sites

Thanks Jan,

 

I guess that code needs finishing off?

 

Would it be possible to use the Osc search function to get the result instead?

 

if you look at this site http://www.memorybits.co.uk/computer_memory.php

and just put a7n8x in the model and click on one of the results you will see that site uses the search function to get the result, although it doesnt add the product to the cart and its ran in a frame so may avoid the session issue you pointed out.

 

although I could add a full ssl and force cookies (Thanks Vger for that info) to get round that also

Link to comment
Share on other sites

I guess that code needs finishing off?

Yes, that needs a few lines of code.

 

Would it be possible to use the Osc search function to get the result instead?

Possibly, haven't looked at that. That was not your question though, you wanted it to go straight into the cart.

I would use that as fall-back in case the search for the model brings up no results or more than 1 result anyway.

 

if you look at this site www.memorybits.co.uk/computer_memory.php and just put a7n8x in the model and click on one of the results you will see that site uses the search function to get the result, although it doesnt add the product to the cart and its ran in a frame so may avoid the session issue you pointed out.

Didn't work for me, it said my link wasn't right.

Link to comment
Share on other sites

Possibly, haven't looked at that. That was not your question though, you wanted it to go straight into the cart.

I would use that as fall-back in case the search for the model brings up no results or more than 1 result anyway.

 

If I use Kingstons Part number as the Products Model it should only return one result I would of thought.

 

Didn't work for me, it said my link wasn't right.

Which part didnt work? was the link to the website or searching for a7n8x?

 

Thanks

Shaun

Link to comment
Share on other sites

If I use Kingstons Part number as the Products Model it should only return one result I would of thought.

If there is a direct one to one relation it should, but nothing is certain in this world ;)

Which part didnt work? was the link to the website or searching for a7n8x?

It says (with no input fields to search anything):

We're sorry

 

It appears that your configurator session has expired.

Please go back to the site from which you linked to the configurator to reconnect.

Link to comment
Share on other sites

It says (with no input fields to search anything):

just try and got to http:// www.memorybits.co.uk and on the left under memory category is a link to memory selector.

Link to comment
Share on other sites

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...