{"id":16049944,"url":"https://github.com/codad5/wemall-v2","last_synced_at":"2025-06-11T23:35:39.359Z","repository":{"id":59764085,"uuid":"539025024","full_name":"codad5/wemall-v2","owner":"codad5","description":"A easy to use Ecommerce CMS for frontend/mobile dev  built with php","archived":false,"fork":false,"pushed_at":"2023-10-14T19:44:20.000Z","size":305,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T15:13:01.005Z","etag":null,"topics":["ecommerce","headless-cms","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codad5.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-20T14:14:11.000Z","updated_at":"2023-08-21T02:51:07.000Z","dependencies_parsed_at":"2024-12-18T12:44:05.639Z","dependency_job_id":"0682d927-5d4c-4d26-9edf-d194e650f660","html_url":"https://github.com/codad5/wemall-v2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codad5%2Fwemall-v2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codad5%2Fwemall-v2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codad5%2Fwemall-v2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codad5%2Fwemall-v2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codad5","download_url":"https://codeload.github.com/codad5/wemall-v2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247301222,"owners_count":20916470,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ecommerce","headless-cms","php"],"created_at":"2024-10-09T00:41:16.347Z","updated_at":"2025-04-05T07:21:17.915Z","avatar_url":"https://github.com/codad5.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wemall-v2\n\nThis 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\n\n## ADDING A NEW SHOP/PRODUCT TYPE\n- Go to [src/enums/ShopType.php](/src/enums/ShopType.php) and add your new enum case\n- Right after that go add the sql query case in the `getProductInsertSqlQuery` method in the same file\n- Then add the form validation in the `validateProductFormField` method\n- GO TO [asset/db.sql](/assets/private/db.sql) and add the product table in the following manner \n- - The table name should be the value to the case you added followed by `_products` \n  - So if the value to the case is `car` then the table name `car_products`\n  - The product table must have some column which are :\n  -  - `id` - For indexing purpose\n     - `product_id` - Serve as foreign key to the main `products` table\n  - \u003e Example of how the TABLE CREATION SQL STATEMENT WOULD LOOK LIKE FOR A CAR PRODUCT TYPE\n  ```mysql\n    CREATE TABLE `car_products` (\n     `id` int(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL ,\n     `product_id` varchar(11) NOT NULL ,\n     'brand' varchar(11) NOT NULL ,\n     `color` varchar(8) NOT NULL ,\n     `mile_age` ENUM('male', 'female', 'unisex') NOT NULL,\n     FOREIGN KEY (product_id) REFERENCES products(product_id)\n    );\n    ```\n- After creation of table you would need to add the html form\n- 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`\n- Then add the input field for each field you add with `name attribute` each to the column name in the db\n  - \u003e Example for the car example would look like this \n    ```php\n    \u003c?php\n      // This PHP CODE IS TO SET DEFAULT VALUE FOR EDITING THE PRODUCTS\n      if(empty($values)) $values = null;\n      if(isset($values) \u0026\u0026 is_array($values))\n      {\n        $values = json_encode($values);\n        $values = json_decode($values, false);\n      }\n      ?\u003e\n      \u003c!-- For the brand input --\u003e\n      \u003cdiv class=\"col-md-4\" id=\"product_brand_cnt\"\u003e\n        \u003clabel for=\"car_brand\" class=\"form-label\"\u003eCar Brand\u003c/label\u003e\n        \u003cselect class=\"form-select\" name=\"brand\" id=\"car_brand\" value=\"\u003c?=$values?-\u003ebrand ?? '' ?\u003e\"\u003e\n          \u003coption value=\"Volvo\"\u003eVolvo\u003c/option\u003e\n          \u003coption value=\"Toyota\"\u003eToyota\u003c/option\u003e\n          \u003coption value=\"Mercedes\"\u003eMercedes\u003c/option\u003e\n        \u003c/select\u003e\n      \u003c/div\u003e\n      \u003c!-- For the color input --\u003e\n      \u003cdiv class=\"col-md-4\" id=\"product_brand_cnt\"\u003e\n        \u003clabel for=\"car_color\" class=\"form-label\"\u003eCar color\u003c/label\u003e\n        \u003cinput type=\"color\" class=\"form-control\" name=\"color\" id=\"car_color\" value=\"\u003c?=$values?-\u003ecolor ?? '' ?\u003e\"\u003e\n      \u003c/div\u003e\n      \u003c!-- For the color input --\u003e\n      \u003cdiv class=\"col-md-4\" id=\"product_brand_cnt\"\u003e\n        \u003clabel for=\"car_mile_age\" class=\"form-label\"\u003e Mile Age\u003c/label\u003e\n        \u003cinput type=\"color\" class=\"form-control\" name=\"mile_age\" id=\"car_mile_age\" value=\"\u003c?=$values?-\u003emile_age ?? '' ?\u003e\"\u003e\n      \u003c/div\u003e\n    ```\n- Then You are done.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodad5%2Fwemall-v2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodad5%2Fwemall-v2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodad5%2Fwemall-v2/lists"}