I need to get the Customer ID primary in Home Page, but not have a Session Interface to give this information.
I tried theses:
MagentoBackendModelSession
MagentoCatalogModelSession
MagentoCheckoutModelSession
MagentoCustomerModelSession
MagentoNewsletterModelSession
Exists one interface to give Customer ID on every page?
2
Answers
There are methods available in magento2 to get customer id, one of the method is using Object Manager as below code.
namespace VendorModuleBlock;
class Form extends MagentoFrameworkViewElementTemplate