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
- Host: GitHub
- URL: https://github.com/codad5/wemall-v2
- Owner: codad5
- License: mit
- Created: 2022-09-20T14:14:11.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-10-14T19:44:20.000Z (over 2 years ago)
- Last Synced: 2025-02-10T15:13:01.005Z (over 1 year ago)
- Topics: ecommerce, headless-cms, php
- Language: PHP
- Homepage:
- Size: 298 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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.