Can you create default product attributes - templates

I am trying to create a store of products with WooCommerce and would like, if possible, to simplify the process of adding new products by having a default set of attributes.
For example, all of my products share certain attributes including: volts, watts, colour temperature etc. I have created these attributes and can select them when I add a new product but it would be really useful, for consistency and speed, if every time I added a product of a certain category the Add Product page automatically added a given set of attributes, rather than me having to add each attribute one by one for every product I add.
Does anyone know if this is possible?

Related

Basic List on Entity Form

In Dynamics CRM online, I can add a list of entities to another entity, for example a list of products to an opportunity.
Is there any way I can have a list that is not picked from pre-populated items, e.g. just a simple list of {number, date, text} that you type in each time you want to add to the list, not picking items from a pre-defined list.
I am just using the web interface to customise at the moment, but I am open to any suggestions.
EDIT:
So far i have;
Created two entities, proposal and proposal version
Added a 1:N relationship between proposal and proposal version
Added a sub-grid to the proposal form, tried to make it editable but it refuses to work
This lets me add new rows by opening up the proposal version form and adding a new one or picking from already created ones for other proposals but that is rather clunky for a simple list.
I don't want it to offer to search for previous entries, just let me add to the list by typing stuff in, surely this should be fairly simple?
If you want a pre-defined list of items that are simple (number, date, text..) then you can create an option set field in CRM. These lists are fixed and can only be extended by customising the system. An example option set field might be Organisation Type:
Prospect
Site
Head Office
...
If you want a pre-defined list that can be extended, you need to create a new entity. Following from the previous example, you would create a custom entity called Organisation Type and then create a record for each type you wanted, populating only the name field with the type: Prospect, Site etc.
Then you would add a lookup field pointing to the Organisation Type entity on any other entity that used the field, such as Organisation (Account).
You see how the custom entity still appears as simple data because you're only populating the name field, which can be text, a number etc. You can also apply security roles to this entity, limiting which users can create and delete options from your list.
Edit: to only allow the creation of new records in a subgrid, make sure the lookup attribute to the parent entity on the child entity is business required.

How to Manage Parent Child Relation Of Options In opencart

i want to add sub option with description depends On parent Option Like
eye wear frame power type(single vision,zero power)
sub options for single vision and and zero power
You can add a new field to the database, or utilize an existing one that you don't currently use.
For example:
EAN
If you don't use EAN, you can simply change the name in the language files:
your_directory/admin/language/en-gb/catalog/product.php
Change:
$_['entry_ean'] = 'EAN';
to
$_['entry_ean'] = 'Single Vision';
and similarly for catalog.
Tags are also used in similar fashion, for items to link/group similar products. (If you want all 'single vision' items to be linkable/grouped together, tags would be the easiest way to go.)

DB Structure for a shopping cart

I like to develop a shopping cart website with multiple products.
(ex.: mobile phone, furniture etc.,)
here mobile phone specification will cover
size of display
memory
operating system
camera etc.,
but for furniture - its specification is entirely different from above electronic product.
type of wood
color
weight
shape
glass or mat finish etc.,
My question is: how to handle a common database-table for product specification ?
each & every category of product & its spec will be differ - so how to have a common
table ProductSpecificationTable ?
I searched many site including google.. but cant able to get the perfect soultion.
Please help me to move to next step.
Ask yourself the question: How can I accomplish this kind of database? First of all you need products.. Every product has to be in some kind of category and every category has to have his own properties. So, you've to create a product table with unique id and every product needs a category id. At this moment it is time to link from your property table to your category table(by id) and to set the values you need a 'property_value' table.
**table:** **id**
product --> category id
property --> category_id
property_value --> property_id
I hope you will understand my explanation otherwise just ask :)
You can add 1 more table to accomplish that. Table that contains cat_id, product_id and the property. That is a many to many relationship. I believe this way you can accomplish thst.
You can achieve this with a single table within a database but that will complicate the CRUD operations over the table. So I will recommend you to create one database like ‘Inventory’ which can have multiple tables (one table for each of the Product Type).
First Table could be list of Product Types you have (mobile phones, accessories, furniture):
You can use this table to populate your list of items available. Here the column _table_name will contain the actual name of the Tables.
Then for each of the product you can have different tables with different number of columns:
Table for Product Type Mobile Phones:
Table for Product Type Furniture:
I hope this will help.

How to filter items that display in a Sitecore Treelist?

I have the following content structure in Sitecore:
Home
Products
A-E
A Sample Product A
B Sample Product B
F-J
K-O
L Sample Product L
P-T
U-Z
In addition each Product has a checkbox field called "Active". I would like to have a Treelist that lets the user select one or more products - but they should only be allowed to select Products where the Active checkbox is checked. Is this possible?
It sounds like you can achieve what you need using Sitecore query. Check out the documentation for exact syntax rules.
Not all field types support Sitecore query though, so you will need to use a field type that does (Multilist). Or you could implement a custom TreeList field type that works with query.
You can also use the properties IncludeTemplatesForDisplay or IncludeTemplatesForSelection to keep your TreeList fields clean.
IncludeTemplatesForDisplay makes certain only those templates will show up in the TreeList.
IncludeTemplatesForSelection allows you to define which templates you can actually select in the TreeList field.
In your case, you could set IncludeTemplatesForDisplay the template of your Products item, then the A-E etc. items, and also the actual Products template. If you then select IncludeTemplatesForSelection you can make sure the content editors can still only select the actual product item.
Other parameters are ExcludeTemplatesForSelection, DatabaseName, ExcludeTemplatesForDisplay, IncludeItemsForDisplay, ExcludeItemsForDisplay and AllowMultipleSelection.
Do keep in mind that won't allow selections where a checkbox is ticked, but you could consider creating a custom field based on a TreeList field, which has the additional property which checks whether the Active field is set.
I'm not sure that there is a way out of the box to set the datasource of a treelist (or any list based field, for that matter) to a set of Items and filter by the value of their fields.
How about thinking about it differently.
What if you had a mirror of the products section of the tree somewhere else in your tree but, instead of having all products in this mirrored section, you'd have only the products that are active. The items in this mirrored section would have a drop-link field that maps to the original product in the original section of the tree. To keep this list up-to-date, you could use a custom action when the original product is saved. When a product is saved, if the Active checkbox is checked, create an item of type Mirrored Product (for example) in the Mirrored Products section of the tree and set the drop-link to the original product. When a product is saved, if the Active checkbox is not checked, find the Mirrored Product that maps to this product being saved and delete it.
Finally, the datasource for your treelist would be the root of these Mirror Products section of the tree, not the original products themselves. This way, the options for your treelist would always only ever items that map to products whose Active checkbox was checked.
One thing to keep in mind: when you delete a Mirrored Product, if it's referenced by a treelist, that reference will remain; you'll need to have your code check for null before trying to use a treelist item.

Model objects versions in Django

I'm building an e-commerce website.
I have a Product and Order models.
It's possible that a customer order a product and then the admin change its price
or other fields before the customer actually get it.
A possible solution is to add a 'version' field to the Product model.
When the admin update a product field I'll add a timestamp and create a new object
instead of updating the old one.
An Order will have a reference to a specific product version.
Does this make sense?
Will overriding the Product Save method be sufficient to make it work?
Thanks
I do it this way:
Make a duplicate of the relevant product columns in the order table.
When you add a product to the order, copy everything from Product to Order (include a FK too if you want). That way the admin can do whatever they want (change product name/price/category/etc.), but the product price / name / etc. will always remain the same.
You could do a version column in product as you suggested, but that's a lot more complicated.