Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Getting the Product ID from the cart...


elogicmedia

Recommended Posts

Hi, I need to get the product id and assign them into an array onto the checkout_confirmation.php page however when I call the id like:

 

$order->products[$i]['id'];

 

sometimes it will work and other products it comes out like:

 

50{5}13

or

30{5}13{6}15

 

where 50 or 30 is the product id.

 

Any ideas how to over come this?

 

Thanks

Link to comment
Share on other sites

OK I got this working buy using the explode function

 

$pieces = explode("{", $order->products[$i]['id']);

$pieces[0] is equal to the id.

 

 

NOW does anyone know how I can put this into an array to use in the script down lower.

 

e.g

 

array

$ids[0] = the first product

$ids[2] = the second product

 

etc etc

?

Link to comment
Share on other sites

OK I got this working buy using the explode function

 

$pieces = explode("{", $order->products[$i]['id']);

$pieces[0] is equal to the id.

NOW does anyone know how I can put this into an array to use in the script down lower.

 

e.g

 

array

$ids[0] = the first product

$ids[2] = the second product

 

etc etc

?

 

Can you not just do

 

$ids[0] = $pieces[0];

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...