read me update
This commit is contained in:
parent
a471be8ff9
commit
c8e44f3705
33
README.md
33
README.md
|
|
@ -4,12 +4,24 @@
|
||||||
|
|
||||||
You can install this plugin into your CakePHP application using [composer](https://getcomposer.org).
|
You can install this plugin into your CakePHP application using [composer](https://getcomposer.org).
|
||||||
|
|
||||||
The recommended way to install composer packages is:
|
The recommended way to install is:
|
||||||
|
|
||||||
```
|
```
|
||||||
composer require hi-powered-dev/cake-products
|
composer require hi-powered-dev/cake-products
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Be sure to run the DB migrations:
|
||||||
|
```
|
||||||
|
bin/cake migrations migrate -p CakeProducts
|
||||||
|
```
|
||||||
|
|
||||||
|
And the DB seed(s):
|
||||||
|
```
|
||||||
|
bin/cake migrations seed -p CakeProducts
|
||||||
|
```
|
||||||
|
|
||||||
|
You can either load the plugin with routes enabled to use default controller actions, or just use/extend the database structure and use your own controllers
|
||||||
|
|
||||||
## Database Structure
|
## Database Structure
|
||||||
|
|
||||||
Products belong to ProductCategories, ProductCategories is hierarchical and belongs to ProductCatalogs.
|
Products belong to ProductCategories, ProductCategories is hierarchical and belongs to ProductCatalogs.
|
||||||
|
|
@ -18,4 +30,21 @@ ProductCategoryAttributes belongs to ProductCategories and attributes are inheri
|
||||||
|
|
||||||
ProductCategoryAttributes can have many ProductCategoryAttributeOptions (constrained attributes)
|
ProductCategoryAttributes can have many ProductCategoryAttributeOptions (constrained attributes)
|
||||||
|
|
||||||
You can either load the plugin with routes enabled to use default controller actions, or just use/extend the database structure and use your own controllers
|
ProductCategoryVariants are templates/common starting points for variants - when adding a new product in that category it is easy to toggle on that category variant so the product uses the variant
|
||||||
|
|
||||||
|
ProductCategoryVariantOptions are the various options for each category variant
|
||||||
|
|
||||||
|
ProductVariants are the assigning of category variants to a product. A product can have as many variants as it's category has category variants. A variant must exist at the category level in order to be assigned to a product.
|
||||||
|
|
||||||
|
Products can have many ProductSkus. A ProductSku is a specific combination of variant options - using a T-Shirt with a size and a color variant for example,
|
||||||
|
the ProductSku would be a Red XL T-Shirt. Not all variant combinations need be used.
|
||||||
|
|
||||||
|
ProductSkuVariantValues is where the variant values of each SKU are stored.
|
||||||
|
|
||||||
|
|
||||||
|
## Suggested Plugins
|
||||||
|
Use the CakeCarts plugin to quickly enable shopping cart functionality with your products [CakeCarts](https://packagist.org/packages/hi-powered-dev/cake-carts)
|
||||||
|
|
||||||
|
```
|
||||||
|
composer require hi-powered-dev/cake-carts
|
||||||
|
```
|
||||||
|
|
@ -21,7 +21,6 @@ if ($productCategoryVariant->is_system_variant) {
|
||||||
'disabled' => true,
|
'disabled' => true,
|
||||||
'readonly' => true,
|
'readonly' => true,
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
echo $this->Form->control('name', $nameOptions);
|
echo $this->Form->control('name', $nameOptions);
|
||||||
echo $this->Form->control('product_category_id', $categoryOptions);
|
echo $this->Form->control('product_category_id', $categoryOptions);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue