Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

1 link to add multiple items to cart


SpankyAndy

Recommended Posts

Hi all -

 

I'm wanting to email a single link to people which when clicked will add X, Y and Z products to their session basket and take them directly to shopping_cart.php.

 

X, Y and Z need to be variable so that I can email different combinations of products to different people. Is this possible using the standard osC functions or do I need to find/adapt an addon to do this instead?

 

Cheers

 

Andy

Link to comment
Share on other sites

Yes its possible...

 

just you have to change some logic from application_top.php file.

 

There is switch case to add to cart

 

What you need to do is, just pass varibles X,Y and Z in url like..

 

http://www.yourdomainname.com/anyfilename.php?moreProducts=30,31,32

 

get all variable

 

make it array from string (you can use explode() function) and put it in to loop

 

like this

 

for($i = 0 ; $i < sizeof($getvariables_array) ; $i++){

add to cart function(); //given in application_top.php, you can use the same function just you need to pass product_id like... $getvariables_array[$i]

}

 

Try this...

 

I am not 100% sure but may be it will help you..

 

Caution : take back up of application_top.php before apply any changes suggested by me.. :-)

 

 

Please take backup of your files before do changes suggested by me

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...