I have this platform (that uses Backpack for the Admin Cruds) in which I want to have various types of products (shoes, sweatshirts, pants, shirts...).
I'm encountering a bit of problems coming out with an efficient and simple way to organize the app structure. I want to avoid having all the necessary fields for the various products in one big table using just the ones related to the particular product I'm storing, and also having different tables that repeat the attributes that are in common between the product types (e.g. owner_id, product_model_id...).
What is the best way to do this?
if you ask about e commerce structure , you should look at open source scripts firstly like magento , opencart , bagisto , etc.
you should know how to represent the product with different attribute ( EAV concept ) like product have color and another dont have . you should know feature of the product like dimensions , weight , height and another feature .
you should know about manufactures and taxes related with the product . so i advice you to look at any opensource project database . ( i think opencart database enough to design medium e commerce project ).
Related
I'm working on a classified ads site with 12 categories. E.g. category vehicles has items cars, bikes, Commercial Vehicles and spare parts. The following is a flow diagram for posting an ad:
I need to show the specification in the Form Filled section of the above image to the users in dropdown lists in the form when they are posting an advertisement. The car specification will be its color,engine,fuel type.
The ERD is below :
How should this issue be tackled, what are the best practices and is the current design going along the right lines?
On the whole this looks ok. Here are some observations:
likes.iker_id should point at users.id? Just trying to understand your model to start.
I would probably change the pics table to be one pic per row and then add an ordinal for ordering.
One question here is how you intend to look at your graph model. As it is, you might have a graph that could be traversed easily to a depth, a couple deep. I assume you are doing this to recommend ads. If so, I think this is sufficient. If not it would be good to further discuss which rdbms you are targetting.
Hope this helps:
In a simplified case, you will need some extra tables.
So, you are trying to be able to have different specifications for different items in your categories? Or, in other words, it is like having different attributes for different types of products in an e-commerce website.
If that the problem you are tackling, then you should look into the Entity–Attribute–Value (EAV) model that is how the problem is solved. By the way, one of the most popular open source e-commerce engines uses it as well.
i agree look at EAV models...
for some other tables, you have many normalization issues - for example:
you should have a separate address table (not part of the ad)
you should have a picture table (and link those to the ads with another table)
you should have a person table - and link that to the ad as 'owner'
the idea of 'favorite' should also be in this person->ad relationship table as a role or type column
I am currently working on developing a price comparison site for which I crawl some e-commerce websites and extract some data from their HTML pages like price, title, metadata etc. I am at a point now that I need two identify if two products crawled from different websites are actually the same and assign a common label for both of them.
For example, lets say site 1 has as a title for a product the following string:
"Smartphone Samsung Galaxy S6 4G 32GB"
and site 2 has as a title for the same product this string:
"Samsung Galaxy S6 White"
How can I identify if these two products are actually the same product, which I want to label in my site as "Samsung Galaxy S6"?
I have thought of using some machine learning techniques like classification or clustering. However, classification will probably require a big set of already well formatted products' labels (plus frequently updated) to act as the possible classes e.g. class "Samsung Galaxy S6", is there such a thing? Also with such a huge number of classes it may not be feasible.
I am using Apache Nutch for crawling and Solr for indexing and search. If there is any specific library or tool for those it will be very helpful, but my question is not specifically for those and I will be very happy to read any suggestion.
Thanks
I have done something similar for my project where we tag people names with their IDs, so basically the same person can have their name listed as the full name or initials, or only the first name etc. and we tag it to the same ID.
So for your case this will basically entail building an inverted index for your products and then scanning the title field for the product names and tagging them to a particular product ID. This way all Samsung Galaxy S6s get mapped to the same product.
This does not require any learning to be performed, you just need to have database to pick up all unique products from and keep updating your index as your product database changes.
All of this can be done at index time by writing an update processor for solr.
The implementation is a bit complex to put it all here so I've just outlined the basic idea that could help you out.
Context: I recently started a new job. I found my colleagues were exchanging information (product spec sheets, 3D renderings, etc) via files and email, which creates the infuriating situation where there are multiple versions of files being passed around. I decided to start building a solution using FileMaker to resolve this, mainly because I'm not really a technical person and FileMaker seems pretty easy to understand. I have been learning both database design and FileMaker literally from scratch.
Purpose: The solution will needs to be able to do the following:
Allow central management of data and files
Export a product roadmap for sales people
Export current product catalogue for sales people
Export product spec sheets
This, in my mind, will help everyone by maintaining a single set of accurate data which can be exported in different views.
Question: What is the best way to incorporate different types of files into the database?
For some views, I would like to be able to show related files, including 3D renderings, images, SoC data sheets, user manuals, etc. What would the schema look like?
Regarding files, I have the following tables:
Files (FileID, FileFormatID, FileName, FileTypeID, FileContainer, DateCommited, DateModified, TimeModified, Comment)
FileFormats (FileFormatID, FileFormat), where FileFormat is svg, pdf, Word, png, jpg, etc...
FileTypes (FileTypeID, FileType), where FileType is 3D Rendering, Gerber, Photo, Certification, QIG, etc...
Solution generated by my feeble mind:
ProductFiles (ProductID, FileID), where ProductID is the key in a Products table.
SoC_Files (SoC_ModelNo, FileID), where SoC_ModelNo is the key in an SoC table.
This way I can include in my views a list of files related to a product or SoC, showing only the FileTypes or FileFormats I need.
However, this seems messy. Is there a better way to do this?
Thanks! It's my first question on StackOverflow, so please let me know if the question is unclear or inappropriate in any way.
EDIT: The SoCs are not products themselves, they're used in the products. Some customers want that information. Each file can belong to multiple products or SoCs, and each product or SoC can have more than one file.
I suspect we need more information about what your solution is about. If it's chiefly about documentation, then the differences between the objects being documented are most likely irrelevant.
In any case, you describe a many-to-many relationship between Files and Products - so you should have a join table between these two, where each combination of file-to-product will be stored as an individual record.
If it turns out that you do need a separate SoC table, you could turn the join table into a "star-join" table - meaning it would have fields for:
FileID
ProductID
SoCID
and in each record either the ProductID or the SoCID field would be empty.
Note that in Filemaker you have another option to establish a many-to-many relationship: you could use a checkbox in the Files table to select the products which the file documents. However, in such case, (1) you won't be able to record anything about a specific file-to-product join and (2) it will be more difficult to produce a report of files-by-product or vice versa.
The FileFormats table is redundant and can be replaced by a custom value list: file extensions are unique and unchanging, and you have nothing to record about any of them. I have a feeling the same is true about the FileTypes table.
An exception to the above: if you can have multiple versions of the same file in different formats, you may need to add another table for the physical files.
I am using Ubercart for products on a Drupal site. I want to extend this product to show a wide range if different information on products. One of the bits of info I want to show, is "specifications".
Take this product as an example. It has various categories of specs, e.g:
Attachment and Capacities
General Specifications
Function and Size
But each of those categories, has actual values underneath them. E.g. Under "attachment and capacities" you have:
Citrus press:Yes
Dough tool:Yes
Mini bowl :Yes
Etc
When I create a new product, I want to be able to add infinite amounts of specifications, that fall under a group.
The best way I have found to do this is using Inline Entities. But this is very slow. Is there no better "field type" I could use to demonstrate this relationship? I.e. one where I can infinitely add categories of values to a specific node?
You can use Product Specification module to achieve the same.
This module allows you to attach product specification data to any
entity in Drupal 7. Mostly we can use this module to store product
specifications on product display page.
I am building an e-shop that will have configurable products. The configurable parts will need to have different prices and stocks from the main product.
What database design would be best in this case?
I started with something like this.
Features
id
name
Features Options
id
id_feature
value
Products
id
name
price
Products Features
id
id_product
id_feature
value ( save the value from the feature-options for ease in search )
configurable (yes, no)
The problem is that now I am stuck on how to save the configurable product features.
I was thinking of saving their value as a json. But that will make saving price modification for a certain option difficult.
How would you go about this ?
Thank you.
Two more tables will do the magic (below). Hacks like JSON or parseable text fields can and should always be avoided.
-- one product <id_product> can have multiple
-- product variants <id> with different features enabled
product_variant
id
id_product (one product - many variants)
-- features, enabled for certain <id_product_variant>
product_variant_enabled_feature
id
id_product_variant (one variant - many features)
id_product_feature
unique_constraint(id_product_variant, id_product_feature)