Jump to content
thirty bees forum
  • 0

Question

Posted

Hi, we would like to make the Cart ID (which can be seen in the backend under Customers > Shopping Carts) displayed on the frontend when looking at the shopping cart. Is this possible? Can anyone help share some guidance on how this can be done? Thank you!

2 answers to this question

Recommended Posts

  • 0
Posted

Hi, many thirty-bees/PrestaShop themes provide the variable `$cart` in the shopping cart template.

Then, in the template, you can simply add:

smarty
{* show Cart ID *}
div class="cart-id">
Cart ID: {$cart->id}
</div>

If it's not already available, you'll need to pass the Cart ID to Smarty via a controller.

The correct controller for the shopping cart is `CartController` (controllers/front/CartController.php)  (or for one-page checkout: `OrderController`, I think, you'll need to check that).

If you have to retrieve it via a controller, I would create an override for it so that it persists after an update.

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...