Jump to content

Read Order Total from a module.


JustAnotherMe
 Share

Recommended Posts

global $cookie;
$sql = 'SELECT total_products_wt
          FROM '._DB_PREFIX_.'orders                                     
           WHERE id_customer = "'.$cookie->id_customer.'"
           ORDER BY date_add DESC 
           LIMIT 1';

$amount = Db::getInstance()->getValue($sql);



thats the code i got so far (not working), my sql is correct so i got some of the presta stuff wrong ...

Share this post


Link to post
Share on other sites

When the order is finished, the cart is empty.

a database query is NOT the way to do it, but I need to know if which page you are trying to get this info, so I can tell you how to get the order object, which can then easily retrieve the order total.

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More