{"id":15984976,"url":"https://github.com/divineomega/exiguous-ecommerce","last_synced_at":"2025-03-18T01:30:29.266Z","repository":{"id":56969638,"uuid":"42943155","full_name":"DivineOmega/exiguous-ecommerce","owner":"DivineOmega","description":"🛒 A super simple ecommerce library, that uses flat files and takes a very minimalistic approach.","archived":false,"fork":false,"pushed_at":"2018-04-17T08:30:43.000Z","size":72,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-28T06:04:37.207Z","etag":null,"topics":["basket","cart","ecommerce","flat-file","php-library"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DivineOmega.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-22T15:35:50.000Z","updated_at":"2023-11-04T08:34:36.000Z","dependencies_parsed_at":"2022-08-21T06:40:24.131Z","dependency_job_id":null,"html_url":"https://github.com/DivineOmega/exiguous-ecommerce","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2Fexiguous-ecommerce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2Fexiguous-ecommerce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2Fexiguous-ecommerce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2Fexiguous-ecommerce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DivineOmega","download_url":"https://codeload.github.com/DivineOmega/exiguous-ecommerce/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243893855,"owners_count":20364918,"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":["basket","cart","ecommerce","flat-file","php-library"],"created_at":"2024-10-08T02:11:47.538Z","updated_at":"2025-03-18T01:30:28.979Z","avatar_url":"https://github.com/DivineOmega.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🛒 Exiguous Ecommerce\n\nExiguous Ecommerce is a super simple ecommerce library, that uses flat files and takes a very minimalistic approach.\n\n## Installation\n\nJust run the following Composer command to download/install Exiguous Ecommerce and create relevant autoload files.\n\n```\ncomposer require divineomega/exiguous-ecommerce\n```\n\nIf your framework does not already do so, you must add `require_once \"vendor/autoload.php\"` to any files in which you wish to use Exiguous Ecommerce.\n\n## Configuration\n\nExiguous Ecommerce stores all of its data within a `data` directory. An example `data` directory is provided in this package.\n\nBefore use, you should then copy the `data` directory to another location and then specify this location your project's environment.\nIf you are using Laravel, this can be done by setting an `EXIGUOUS_ECOMMERCE_DATA_DIRECTORY` variable in your `.env` file, as follows.\n\n```\nEXIGUOUS_ECOMMERCE_DATA_DIRECTORY=/var/www/ecommerce-site/path-to-data-directory/\n```\n\nIf you are not using a framework that supports this, you can use the standard PHP function `putenv` to set this environment variable.\nAlternatively, you could use [dotenv-loader](https://github.com/DivineOmega/dotenv-loader) to add `.env` file support to your project.\n\nPlease note that it is important the `EXIGUOUS_ECOMMERCE_DATA_DIRECTORY` variable is set with a trailing slash present.\n\nFor security reasons, you should place the `data` directory in a location which is not web-accessible. In case the data directory is placed in\na web accessible location by accident, a `.htaccess` file is provided that should deny web users access to the directory's content in most\ncommon web server configurations.\n\n## Quick Start Examples\n\nGetting products and categories:\n\n```php\n$category = \\DivineOmega\\ExiguousEcommerce\\Category::findBySlug(\"fluffy-things\");\n$products = $category-\u003eproducts();\n\nforeach($products as $product) {\n    echo $product-\u003edata-\u003ename;\n}\n```\n\n```php\n$product = \\DivineOmega\\ExiguousEcommerce\\Product::findBySlug(\"teddy-bear\");\n$categories = $product-\u003ecategories();\n\n$mainCategoryName = $categories[0]-\u003edata-\u003ename;\n```\n\nGetting the current user's basket and adding a product to it:\n\n```php\n$product = \\DivineOmega\\ExiguousEcommerce\\Product::findBySlug(\"teddy-bear\");\n\n$basket = \\DivineOmega\\ExiguousEcommerce\\Basket::findCurrent();\n\n$basket-\u003eaddProduct($product); // Add one Teddy Bear\n\n$basket-\u003eaddProduct($product, 2); // Add another two Teddy Bears!\n\nvar_dump($basket-\u003eitems); // Outputs an array of, you guessed it, basket items! ^_^\n\n// ^ This would show 1 basket item with a quantity of 3 teddy bears.\n\n```\n\nRemoving a product from a basket:\n\n```php\n$product = \\DivineOmega\\ExiguousEcommerce\\Product::findBySlug(\"teddy-bear\");\n\n$basket = \\DivineOmega\\ExiguousEcommerce\\Basket::findCurrent();\n\n$basket-\u003eremoveProduct($product); // Removes all teddy bears from the basket\n```\n\nSetting/Offsetting the quantity of a product in the basket:\n\n```php\n$product = \\DivineOmega\\ExiguousEcommerce\\Product::findBySlug(\"teddy-bear\");\n\n$basket = \\DivineOmega\\ExiguousEcommerce\\Basket::findCurrent();\n\n$basket-\u003eaddProduct($product); // Add one Teddy Bear\n\n$basket-\u003esetProductQuantity($product, 10); // Set the number of Teddy Bears in the basket to ten\n\n$basket-\u003eoffsetProductQuantity($product, 10); // Add ten more Teddy Bears\n\n$basket-\u003eoffsetProductQuantity($product, -5); // Remove five of those Teddy Bears\n```\n\nMigrating the basket to an order:\n\n```php\n$basket = \\DivineOmega\\ExiguousEcommerce\\Basket::findCurrent();\n\n$basket-\u003econvertToOrder();\n```\n\nGetting and using settings:\n\n```php\n\n// Retrieves settings from the core.json file within the .settings directory\n$coreSettings = \\DivineOmega\\ExiguousEcommerce\\Settings::find('core');\n\necho $coreSettings-\u003edata-\u003eprimaryCurrency; // Output the ecommerce's primary currency setting\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivineomega%2Fexiguous-ecommerce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdivineomega%2Fexiguous-ecommerce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivineomega%2Fexiguous-ecommerce/lists"}