Jump to content

Getting Shop ID


Recommended Posts

Having trouble getting the cart ID for the current user in a module I'm creating.  Currently, I'm getting the product being viewed by
 

$productID = (int)Tools::getValue('id_product');

However, Im trying the following code and not getting anything.  All variables are empty.

$context = Context::getContext();
$cartID = Context::getContext()->cart->id_cart;
$cartID2 = Tools::getValue('id_cart');
$cartID3 = $this->context->cart->id_cart;
$cartID4 = (int)$context->cookie->id_cart;
$shopID5 = Shop::getContextShopID();
 
Any suggestion?
Edited by wstar (see edit history)
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...