def getStartupDirectoryForCategories(self): """ """ shop = IShopManagement(self).getShop() shop_path = "/".join(shop.getPhysicalPath()) return shop_path
def getAllProducts(self, **kargs): """ """ shop = IShopManagement(self.context).getShop() catalog = getToolByName(self.context, "portal_catalog") brains = catalog.searchResults(path="/".join(shop.getPhysicalPath()), portal_type="Product", sort_on="sortable_title") # TODO: This is ugly! result = [] for brain in brains: result.append(brain.getObject()) return result
def _getGroupsAsDL(self): """Returns all Categories as DisplayList """ shop = IShopManagement(self).getShop() dl = DisplayList() catalog = getToolByName(self, "portal_catalog") brains = catalog.searchResults(path="/".join(shop.getPhysicalPath()), portal_type="ProductGroup") for brain in brains: dl.add(brain.id, brain.Title) return dl
def _getGroupsAsDL(self): """Returns all Categories as DisplayList """ shop = IShopManagement(self).getShop() dl = DisplayList() catalog = getToolByName(self, "portal_catalog") brains = catalog.searchResults( path = "/".join(shop.getPhysicalPath()), portal_type="ProductGroup") for brain in brains: dl.add(brain.id, brain.Title) return dl
def getStartupDirectoryForGroups(self): """ """ shop = IShopManagement(self).getShop() shop_path = "/".join(shop.getPhysicalPath()) catalog = getToolByName(self, "portal_catalog") brains = catalog.searchResults( path=shop_path, object_provides="easyshop.core.interfaces.groups.IGroupsContainer") if len(brains) > 0: products_folder = brains[0] return products_folder.getPath() else: return shop_path
def getAllProducts(self, **kargs): """ """ shop = IShopManagement(self.context).getShop() catalog = getToolByName(self.context, "portal_catalog") brains = catalog.searchResults( path = "/".join(shop.getPhysicalPath()), portal_type = "Product", sort_on = "sortable_title" ) # TODO: This is ugly! result = [] for brain in brains: result.append(brain.getObject()) return result
def getCategoriesAsDL(self): """Returns all Categories as DisplayList """ shop = IShopManagement(self).getShop() dl = DisplayList() catalog = getToolByName(self, "portal_catalog") brains = catalog.searchResults( path = "/".join(shop.getPhysicalPath()), portal_type="Category", ) for brain in brains: dl.add(brain.getPath(), "%s (%s)" % (brain.Title, brain.getPath())) return dl
def getStartupDirectoryForGroups(self): """ """ shop = IShopManagement(self).getShop() shop_path = "/".join(shop.getPhysicalPath()) catalog = getToolByName(self, "portal_catalog") brains = catalog.searchResults( path = shop_path, object_provides = "easyshop.core.interfaces.groups.IGroupsContainer" ) if len(brains) > 0: products_folder = brains[0] return products_folder.getPath() else: return shop_path
def getStartupDirectoryForProducts(self): """ """ shop = IShopManagement(self).getShop() shop_path = "/".join(shop.getPhysicalPath()) site_url = getToolByName(self, "portal_url") portal_path = site_url.getPortalPath() catalog = getToolByName(self, "portal_catalog") brains = catalog.searchResults( path=shop_path, object_provides= "easyshop.core.interfaces.catalog.IProductsContainer") if len(brains) > 0: products_folder = brains[0] return products_folder.getPath().replace(portal_path, '') else: return shop_path.replace(portal_path, '')
def getStartupDirectoryForProducts(self): """ """ shop = IShopManagement(self).getShop() shop_path = "/".join(shop.getPhysicalPath()) site_url = getToolByName(self, "portal_url") portal_path = site_url.getPortalPath() catalog = getToolByName(self, "portal_catalog") brains = catalog.searchResults( path = shop_path, object_provides = "easyshop.core.interfaces.catalog.IProductsContainer" ) if len(brains) > 0: products_folder = brains[0] return products_folder.getPath().replace(portal_path,'') else: return shop_path.replace(portal_path,'')
def getStartupDirectoryForObject(self): """ """ shop = IShopManagement(self).getShop() return "/".join(shop.getPhysicalPath())
def getStartupDirectory(self): """ """ shop = IShopManagement(self).getShop() return "/".join(shop.getPhysicalPath())