Im on the page showing the products I have avaliable in my Magento store. I want to get the current ID of the order (or the ID of the cart, something unique that I can follow right up until I pay) should I continue on adding the order to my cart and buy it at the end.

Since the order per say does not exist and more than one person can buy at the same time, I would have to calculate the order ID someway while making sure that it does not conflict with another person making another order at the same time.

Another thing is like I mentioned that this is on the product listing page (/../../../../../template/catalog/product/list.phtml) so a “order” per say (I mentioned this before) does not exist.

How can I get the best possible way a order ID (or the cart ID) that is not in usage?

Member Avatar

How to get Magento current order ID/cart ID while on products page?

Just look at the query on the page that SELECT the order ID/cart ID from the table and echo out the column that has the order ID/cart ID.