What's the deference between product catalog and category in Ofbiz? - categories

What's the deference between product catalog and category in Ofbiz ?
I think all of them is a group or set of product that have one or more common characteristics. But in Ofbiz's using one Catalog have many Category ?
Thanks!

They are similar, but catalog contains a list of categories with different purposes: home page categories, search categories, etc.
http://ofbiz.135035.n4.nabble.com/Product-Category-and-Catalog-td4636208.html

Related

E-Commerce REST API for categories

In my e-commerce project, I am building a set of REST APIs to list the categories and products from the catalog management system. A category can have sub-categories and a product can belong to a category or stand by itself.
- root_category
- sub_category
- product1
- product2
- product3
Here in this example, root_category contains sub_category & product2. The subcategory contains product1. product3 doesn't belong to any category.
Here are the possible use cases:
List all the products in the system.
/products
Get product details by id.
/products/{id}
Search for products by id, name or description (need to query by one of these criteria)
/products?searchTem={searchTerm}&q=[byId|byName|byDescription]
List all categories in the system.
/categories
5(a). List sub categories belonging to a particular category.
/categories/{id}/categories
5(b). List root level categories. (eg. root_category).
/categories/#root/categories
6(a). List products belonging to a category.
/categories/{id}/products
6(b). List products that don't belong to any category. ie., root level products (eg. product3).
/categories/#root/products
Please let me know your comments and suggest improvements for these REST URIs listed above. I am a little concerned about 5(b) and 6(b).Can those URIs be designed in a better way.
I think that looks reasonable, the only issue I have is the use of category id.
I would prefer to see a category name used, which is more user-friendly.
Category name has to be unique obviously.

Magento hide out of stock products

I have System->Configuration->Catalog->Inventory->Display Out of Stock Products option set to No.
But this out-of-stock products still exist in category list. Is this config option works with product collection? How can i hide out-of-stock products from category product collections?
To make this work you should go to System->Configuration->Catalog->Catalog and set Use Flat Catalog Product to Yes. After that just launch Product Flat Index

Mongo Schema Design

I'm pretty new to Mongo. Just started a project using Mongodb as the database.
I'm not sure how should i design the following use-case to a document base database.
User-Case
1. Vendor/Distributor has a list of product on our system.
2. There's a standard price list of each product for any customers.
3. Vendor/Distributor also has customize price list of each of the product for each customer.
eg. CustA have a productA at different pricing from the standard and it's only available to him.
4. Some of the Product are only available through customize price, and I match those product with attribute public = false.
How should i work this out in document base database?
Current design i have is.
1. [Product Document] with embedded document of standard price list.
2. [Product_Price Document] with oneToMany link [Product Document] and oneToMany to [Customer Document]
3. [Customer Document].
With this Model, I'm facing problem with querying by paging.
Example I query the first 30 Product sorted by name. Then query [Product_Price Document] with the 30 ProductId that match, so that I have those customize price for that customer who login.
The problems come where by I couldn't query item that are customize to the user that is not available for everyone.
Is there a better way or design the schema or what should i do with the query?
I'm using PHP, Doctrine2, Symfony2
When you query the Product_Price_Document query it using both ProductID and current CustomerID. Or am I missing something?
Here's how I would structure it.
Have two collections:
- Products
- Vendors
Your products table would have the list of all your products and their standard price. Your vendors page would have an array of product ID's along with an override price in the case that they have a different price for that particular product.
If you are also tracking customers then you could make that a collection too and have a belongs to relationship almost to the vendors.
so in short:
collection.vendor:
{"name":'foo',"products":[{"_id":mongoId,"priceOveride":15.50},..]}
collection.products:
{"name":"bar","price":15.40}
Excellent resource for reading a bit more into the relationships which you can use:
Learn Mongo Interactively

CoreData Guidance

So I have this problem I am trying to solve - I wonder if anyone can comment on/help me with the approach. The thing is, I have it partly solved, but with the rest I'm not quite sure.
Here's the deal:
I have a fairly large DB online which I want to load on first start of the App. After that I am only going to load it if new versions exist.
I use an xml parser to parse the data and enter all the data to my data model. The database consists of thousands of products, all described by various attributes.
Anyway, it's easy for me to save thousands of products in a database, then retrieving the data on demand.
I have a problem of how to categorize them and how to save the category data. There is a main category i.e. Hi-Fi which has several subcategories- let's say 'stereo', 'tuner', 'phone' and so on....
How to best save this info, that category a has 15 subcategories and each of these categories in turn has 30 products while securing performance and keeping process-time at a minimum. I don't want to check all 2000 Products whether I need to show them in a certain table view each time I open a new table view.
Any hints on the apporach are appreciated.
You'll need two entities: Product and Category.
Category has a to-many relationship called subcategories with a target entity of Category. The inverse relationship can be called parentCategory. Category also has a to-many relationship called products. Product would have an inverse relationship called category (or categories if a product can belong to multiple categories)
Now, you can get all the products for a given category by checking its products property. If you want to include all the products in the subcategories, you can do a fetch request with a predicate like this:
[NSPredicate predicateWithFormat:#"category == %# OR category IN %#", category, category.subcategories];
I think you can solve it by having a Core Data modal consisting of three entities: Product, Category and SubCategory.
Product has a relationship category with destination Category and a relationship subcategory with destination SubCategory.
Category has a to-many relationship products with destination Product and a to-many relationship subcategories with destination SubCategory.
SubCategory has a to-many relationship products with destination Product and a relationship category with destination Category.
When defining these relationships remember to assign the Inverse relationships as well.
Now you get a list of all products belonging to a specific category by just loading the Category in question and accessing the products property. It should also be possible to use NSFetchRequest for Product with a predicate specifying which category you want. Which is best regarding performance and memory requirements I can't say so you just have to test which approach works best.

ASP.NET Dynamic Data : How to Specify Sort Order of Items in Dropdown List

I am using ASP.NET dynamic data for the data adminstration tasks for a Silverlight app that I built. It saved a ton of time not having to write all of the admin screens you typically have to create for end users to manage the data.
One thing I cannot figure out how to sort the items in the drop downs that appear on the screens - either the filter dropdowns on the list views or on the data entry screens.
Do I specify that somewhere in the EDM partial classes or in the ASP.NET DD field templates? or somewhere else?
All I need to do is sort alphabetically by the display value- they appear to be in random order.
thanks
Michael
Use the DisplayColumn Attribute in the System.ComponentModel.DataAnnotations Namespace.
http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.displaycolumnattribute.aspx
ex:
[DisplayColumn("LastName", "LastName")]
public partial class Employee
{
}
The answer to your question can be found here, about halfway down the page:
http://csharpbits.notaclue.net/2008/08/dynamic-data-and-field-templates-second.html
In the Cascase.ascx.cd FilterControl and Cascade_Edit.ascx.cs FieldTemplate you will find a method GetChildListFilteredByParent. This returns the values for the filtered DropDownList, but as you will see this list is an unordered list. To add sorting to this list we need to add a Linq OrderBy clause.