SessionService and CURRENT_CATALOG_VERSION from session and get the product by catalog version and code

 final SessionService sessionService = (SessionService) Registry.getApplicationContext().getBean("sessionService");
    final Session session = sessionService.getCurrentSession();
    final CatalogVersionModel currentCatalogVersion = session.getAttribute(SstcoreConstants.StageMode.CURRENT_CATALOG_VERSION);
        ProductModel product = this.getProductService().getProductForCode(currentCatalogVersion,productCode);

Comments

Popular Posts