Jump to content

Obtain products information from order confirmation page.


ph0enix993

Recommended Posts

Hi,

 

I'm making a JS script which will pull product data after the customer bought products and display a pop up.  (on the order confirmation page) 

 

 

I'm still new to Prestashop and I don't know if there's any easy way to pull product data after order is complete. So far I was using SQL queries on my custom PHP pages but I'm sure there's a better way. 

 

The data I'm looking for is :

  • order ID
    • product IDs 
    • product name
    • price
    • quantity

 

Link to comment
Share on other sites

Thank you for the help. I used your 

$id_order=(int)Tools::getValue('id_order');

and I also used this tutorial to create order confirmation resume. 

http://nemops.com/prestashop-order-confirmation-resume/#.V_en1SiLSUl

 

the end JS code looks something like this:

 var obj = {
 Key: 'xx',
 Type: 'order',
 OrderId: '{(int)Tools::getValue('id_order')}'
 };
 var products = [];
 {foreach from=$order_products item=product}
 products.push({
 IdProduct: '{$product.product_id}',
 Name: encodeURIComponent('{$product.product_name}'),
 Price: '{$product.total_price_tax_incl}',
 Quantity: '{$product.product_quantity}'
 });
 {/foreach}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...