An open API service indexing awesome lists of open source software.

https://github.com/codad5/wemall-v2

A easy to use Ecommerce CMS for frontend/mobile dev built with php
https://github.com/codad5/wemall-v2

ecommerce headless-cms php

Last synced: about 1 year ago
JSON representation

A easy to use Ecommerce CMS for frontend/mobile dev built with php

Awesome Lists containing this project

README

          

# wemall-v2

This is an open sources CMS to make full stack ecommerce development very easy with the api of allowing frontend devs created e-commerce app by consuming our api

## ADDING A NEW SHOP/PRODUCT TYPE
- Go to [src/enums/ShopType.php](/src/enums/ShopType.php) and add your new enum case
- Right after that go add the sql query case in the `getProductInsertSqlQuery` method in the same file
- Then add the form validation in the `validateProductFormField` method
- GO TO [asset/db.sql](/assets/private/db.sql) and add the product table in the following manner
- - The table name should be the value to the case you added followed by `_products`
- So if the value to the case is `car` then the table name `car_products`
- The product table must have some column which are :
- - `id` - For indexing purpose
- `product_id` - Serve as foreign key to the main `products` table
- > Example of how the TABLE CREATION SQL STATEMENT WOULD LOOK LIKE FOR A CAR PRODUCT TYPE
```mysql
CREATE TABLE `car_products` (
`id` int(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL ,
`product_id` varchar(11) NOT NULL ,
'brand' varchar(11) NOT NULL ,
`color` varchar(8) NOT NULL ,
`mile_age` ENUM('male', 'female', 'unisex') NOT NULL,
FOREIGN KEY (product_id) REFERENCES products(product_id)
);
```
- After creation of table you would need to add the html form
- You would do this by creating a new file in [src/view/html/productForms.php](src/view/html/productForms.php) name by the product type , example for a car product would be `car.php`
- Then add the input field for each field you add with `name attribute` each to the column name in the db
- > Example for the car example would look like this
```php



Car Brand

Volvo
Toyota
Mercedes




Car color




Mile Age


```
- Then You are done.