{"id":15145479,"url":"https://github.com/prestashop/prestashop-shop-creator","last_synced_at":"2025-10-30T11:12:25.711Z","repository":{"id":45425976,"uuid":"113153777","full_name":"PrestaShop/prestashop-shop-creator","owner":"PrestaShop","description":"Generate random demo data to test your PrestaShop shop.","archived":false,"fork":false,"pushed_at":"2024-06-12T09:54:10.000Z","size":243,"stargazers_count":24,"open_issues_count":9,"forks_count":12,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-01-29T21:22:29.215Z","etag":null,"topics":["data","fixture-generator","generator","hacktoberfest","prestashop","random","shop"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PrestaShop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-12-05T08:23:02.000Z","updated_at":"2024-06-12T09:54:14.000Z","dependencies_parsed_at":"2024-06-12T12:11:50.287Z","dependency_job_id":"3e4fe235-fdaf-4c2b-b18d-b6379cc3f34d","html_url":"https://github.com/PrestaShop/prestashop-shop-creator","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/PrestaShop%2Fprestashop-shop-creator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrestaShop%2Fprestashop-shop-creator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrestaShop%2Fprestashop-shop-creator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrestaShop%2Fprestashop-shop-creator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PrestaShop","download_url":"https://codeload.github.com/PrestaShop/prestashop-shop-creator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237163335,"owners_count":19265256,"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":["data","fixture-generator","generator","hacktoberfest","prestashop","random","shop"],"created_at":"2024-09-26T11:25:44.238Z","updated_at":"2025-10-19T16:31:44.892Z","avatar_url":"https://github.com/PrestaShop.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"About PrestaShop Shop Generator\n--------\n\nThe shop generator generates a list of folders \u0026 xml files into 'generated_data' dir which should be copied in the \n/install/fixtures/fashion directory of PrestaShop, to generate at the installation a shop initialized with the specified \nnumber of entities.\n\n\u003e [!NOTE]\n\u003e In 2023, we attempted to fix multiple issues regarding this tool. Sadly, we found out its design (using XML files as output) made it very hard to output a controlled format.\n\u003e Another way to load heavy loads of data into a shop is being tried on this repository: [PrestaShop/ps_fixturescreator](https://github.com/PrestaShop/ps_fixturescreator)\n\nInstallation \u0026 configuration\n--------\n\nTo setup the configuration of the module, just run\n```\ncomposer install\n```\nThis will generates a configuration file in app/config/config.yml\n\nHow to run the script\n--------\n```\nphp app/console.php\n```\nMake sure to have enough memory allocated to php, as it could eat a lot of memory depending on the number of entities\nyou want to generate\n\n\nEntity Model syntax\n--------\nEach entity model is described in the src/Model directory.\n\nIf you want to add a new Model, create of file with the same name the class it's related to, and an entry in the \napp/config/config.yml.dist file (the name should be the pluralized \u0026 tablized version of the model name).\n\n\nThe model file is in yml format, and contains three main section:\n\n1. \u003cb\u003eThe fields section (required)\u003c/b\u003e\n\n    This section describes the list of fields of an entity (not language related).\n    \n    Available options in this section:\n    \n    1. \u003ci\u003e\u003cb\u003ecolumns (required) \u003c/b\u003e\u003c/i\u003e\n\n        Describe each field of the entity we want to generate.\n        \n        Syntax:\n        ```yaml\n        columns:\n            id:\n              type: increment        \n            id_state:\n              relation: State\n            exclusive_fields:\n              id_customer:\n                relation: Customer\n              id_manufacturer:\n                relation: Manufacturer\n              id_supplier:\n                relation: Supplier\n            id_warehouse:\n              value: 0\n            alias:\n              type: words\n              args:\n                - 10 #nb words\n            id_customer:\n              relation: Customer\n              conditions: \n               id_guest: 1\n            name:\n              type: word\n              args:\n                - 10 #nb chars\n              hidden: true   \n            price:\n              type: numberBetween\n              args:\n                - 1 #start\n                - 1000 #stop\n            wholesale_price:\n              value: '{price}/100'              \n        ```\n        1. \u003cu\u003ethe 'type' property\u003c/u\u003e\n            \n            * 'increment' is a simple autoincrement.\n            \n            * 'conditionalValue' allow to generate value depending on a condition.\n            Example:\n                ```yaml\n                default_on:\n                  type: conditionalValue\n                  args:\n                    - isNewValue({id_product}) # condition\n                    - 1 # value if condition is true\n                    - null # value if condition is false\n                ```\n             The isNewValue is a special function which checks if the value related to the field {id_product} \n             has changed since the last time we have generated an entity.   \n            \n            * other properly value allows to generate random value. , another types\n            available are described from the faker module: https://github.com/FakerPHP/Faker \n            \n            If you need to pass an argument to a faker function, just add the 'args:' tag like in the above example.\n            \n            If you want to generate a field, but hide it from the final result, add the \"hidden: true\" property\n            (only useful if the field in question is referenced as an \"id\", but only present in the field_lang)\n            \n        2. \u003cu\u003ethe 'relation' property\u003c/u\u003e\n        \n            The 'relation' property indicates it should generates the value from an another entity (it will use a value\n            from the 'id' of the other entity).\n            \n            If the 'generate_all' property is used in conjunction with a relation type, it means we should use\n            all the existing relations instead of just choosing a random one. It's especially usefull if we want for\n            example generate combinations for every product in the database:\n            \n            ```yaml\n            fields:\n                class: 'Combination'\n                columns:\n                    id:\n                      type: increment\n                    id_product:\n                      relation: Product\n                      generate_all: true\n            ```\n            \n            If the 'conditions' property is used in conjunction with a relation type, it means all the fields specified \n            should have the specified value in the related entity:\n            \n            ```yaml\n            fields:\n                class: 'Guest'\n                columns:\n                    id:\n                      type: increment\n                id_customer:\n                  relation: Customer\n                  conditions:\n                    is_guest: 1\n            ```\n            \n        3. \u003cu\u003ethe 'value' property\u003c/u\u003e\n                         \n            The 'value' property sets a specific value for the column. It could also be a reference to another\n            column, or a mathematical expression, like the \"wholesale_price\" in the example above.\n            \n        4. \u003cu\u003ethe 'exclusive_fields' property\u003c/u\u003e\n                 \n            Some columns should have a value only if other column are not set.\n            That's the purpose of this property. In the example above only one randomly chosen field \n            among id_customer/id_manufacturer/id_supplier will be set.\n    \n    2. \u003ci\u003e\u003cb\u003eclass (optional) \u003c/b\u003e\u003c/i\u003e\n    \n        The name of the class related to the entity.\n        \n        Example: \n            \n        ```yaml\n        class: 'Carrier'\n        ```\n    3. \u003ci\u003e\u003cb\u003esql (optional)\u003c/b\u003e\u003c/i\u003e\n        \n        Sql argument when want to add to help debugging\n        \n        Example:\n        ```yaml\n        sql: 'a.id_carrier \u003e 1'\n        ```\n    \n    4. \u003ci\u003e\u003cb\u003eid\u003c/b\u003e\u003c/i\u003e\n    \n        The 'id' tag sets which field inside the 'columns' property should be considered as a the reference unique field \n        for relation resolution.\n        \n        Example:\n        ```yaml\n        id: 'name'\n        ```\n     \n    5. \u003ci\u003e\u003cb\u003eprimary\u003c/b\u003e\u003c/i\u003e\n    \n        When the primary tag is used, the script iterate over all the existing values, excepted if there's a \n        'generate_all: true' tag present (the fields in the 'primary' tag should be described as relations to other \n        entities)\n        \n        Example:\n        ```yaml\n        primary: 'id_carrier, id_group'\n        columns:\n            id_carrier:\n              relation: Carrier\n            id_group:\n              relation: Group\n       ```      \n     \n    6. \u003ci\u003e\u003cb\u003eimage (optional)\u003c/b\u003e\u003c/i\u003e\n        \n        Generate random images in the given relative path of the generated_data/img/ directory for each entity.\n        It's used in conjonction with image_width, image_height and image_category.\n        \n        Example:\n        ```yaml\n       image: 'c'\n       image_width: 141\n       image_height: 180\n       image_category: abstract\n        ```\n           \n        Possible image_category are:\n        ```  \n        abstract\n        animals\n        business\n        cats\n        city\n        food\n        night\n        life\n        fashion\n        people\n        nature\n        sports\n        technics \n        transport\n        ```                                        \n\n2. \u003cb\u003eThe fields_lang section (optional)\u003c/b\u003e\n\n    This section describes the list of fields present in the language related part of the entity (if any).\n    \n    You can set an optional 'id_shop' tag and a 'columns' property which support the type same 'value' and 'type' than the \n    'fields' section.\n    \n    Example:\n    ```yaml\n    fields_lang:\n        id_shop: 1\n        columns:\n            name:\n              type: words\n              args:\n                - 6\n            description:\n              type: sentence\n            description_short:\n              type: sentence\n              args:\n                - 4\n            link_rewrite:\n              type: slug\n            available_now:\n              value: In stock\n    ```  \n\n3. \u003cb\u003eThe entities section (optional)\u003c/b\u003e\n\n    This section describes any custom entities we want to create (no random generation for those one).\n    \n    The key of each entry used will be used as the 'id' of the entity\n\n    Example:\n    ```yaml\n    entities:\n        My_carrier:\n            fields:\n                id_reference: 2\n                active: 1\n                shipping_handling: 1\n                range_behaviour: 0\n                is_free: 0\n                shipping_external: 0\n                need_range: 0\n                shipping_method: 0\n                max_width: 0\n                max_height: 0\n                max_depth: 0\n                max_weight: 0\n                grade: 0\n                name: My carrier\n                url: ~\n            fields_lang:\n                delay: Delivery next day!\n    ```\n\n\nDefault xml data\n--------\nIf you want to use a default xml file instead of generating one using the entity model, just put it in the default_data \ndirectory.\n\nIt will be automatically parsed by the script and will be taken into account for the existing entity relations.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprestashop%2Fprestashop-shop-creator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprestashop%2Fprestashop-shop-creator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprestashop%2Fprestashop-shop-creator/lists"}