All Projects → PrestaShop → prestashop-shop-creator

PrestaShop / prestashop-shop-creator

Licence: other
Generate random demo data to test your PrestaShop shop.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to prestashop-shop-creator

Yii2 Yml Catalog
Компонент выгрузки каталога товаров в Яндекс.Маркет
Stars: ✭ 16 (-27.27%)
Mutual labels:  generator, shop
Randomdatagenerator
This is a configurable generator to create random data like Lorum Ipsum Text, Words, Text Patterns, First/Last Names, MAC-Addresses, IP-Addresses, Guids and DateTime.
Stars: ✭ 45 (+104.55%)
Mutual labels:  generator, random
Roguesharp
A .NET Standard class library providing map generation, path-finding, and field-of-view utilities frequently used in roguelikes or 2D tile based games. Inspired by libtcod
Stars: ✭ 316 (+1336.36%)
Mutual labels:  generator, random
Spicy Proton
Generate a random English adjective-noun word pair in Ruby
Stars: ✭ 76 (+245.45%)
Mutual labels:  generator, random
Baba Core
Mini-language for creating random text generators.
Stars: ✭ 127 (+477.27%)
Mutual labels:  generator, random
Jnanoid
A unique string ID generator for Java.
Stars: ✭ 147 (+568.18%)
Mutual labels:  generator, random
Randomix
🎲 An open source app to choose randomly between numbers, answers, options and so on.
Stars: ✭ 24 (+9.09%)
Mutual labels:  generator, random
Keygen Php
A fluent PHP random key generator.
Stars: ✭ 93 (+322.73%)
Mutual labels:  generator, random
Rando Php
RandoPhp is a open source library that implements random generators (Integer, Char, Byte, Sequences, Boolean) and take random sample from arrays
Stars: ✭ 107 (+386.36%)
Mutual labels:  generator, random
Gofakeit
Random fake data generator written in go
Stars: ✭ 2,193 (+9868.18%)
Mutual labels:  generator, random
7cart
7cart is a php7 project for building online shops, catalogs or service platforms. 7cart built with simple code and database schema. It is easy to support and fast.
Stars: ✭ 27 (+22.73%)
Mutual labels:  shop, prestashop
quoters
📝 Random quotes generator package. Available on npm and PyPi
Stars: ✭ 17 (-22.73%)
Mutual labels:  random
wolmo-bootstrap-react-native
Bootstrap generator for React Native projects
Stars: ✭ 20 (-9.09%)
Mutual labels:  generator
justgo
Skeleton for jump-starting a Go-powered microservice project with Docker and Go best-practices + easy code hot-reloading (for dev environments)!
Stars: ✭ 29 (+31.82%)
Mutual labels:  generator
Cartkit
Cartkit - The [quick] starter kit!
Stars: ✭ 39 (+77.27%)
Mutual labels:  shop
wodle
Static site generator using next and tachyons
Stars: ✭ 29 (+31.82%)
Mutual labels:  generator
prestashop
Convert your traditional PrestaShop website into a fast, mobile friendly and modern website.
Stars: ✭ 19 (-13.64%)
Mutual labels:  prestashop
unity-plumber
A component to procedurally generate pipe-like meshes in Unity
Stars: ✭ 55 (+150%)
Mutual labels:  generator
micro-svelte-compiler
Micro Svelte compiler (naive clone)
Stars: ✭ 56 (+154.55%)
Mutual labels:  generator
secrets.clj
A library designed to generate cryptographically strong random numbers.
Stars: ✭ 64 (+190.91%)
Mutual labels:  random

About PrestaShop Shop Generator

The shop generator generates a list of folders & xml files into 'generated_data' dir which should be copied in the /install/fixtures/fashion directory of PrestaShop, to generate at the installation a shop initialized with the specified number of entities.

Installation & configuration

To setup the configuration of the module, just run

composer install

This will generates a configuration file in app/config/config.yml

How to run the script

php app/console.php

Make sure to have enough memory allocated to php, as it could eat a lot of memory depending on the number of entities you want to generate

Entity Model syntax

Each entity model is described in the src/Model directory.

If 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 app/config/config.yml.dist file (the name should be the pluralized & tablized version of the model name).

The model file is in yml format, and contains three main section:

  1. The fields section (required)

    This section describes the list of fields of an entity (not language related).

    Available options in this section:

    1. columns (required)

      Describe each field of the entity we want to generate.

      Syntax:

      columns:
          id:
            type: increment        
          id_state:
            relation: State
          exclusive_fields:
            id_customer:
              relation: Customer
            id_manufacturer:
              relation: Manufacturer
            id_supplier:
              relation: Supplier
          id_warehouse:
            value: 0
          alias:
            type: words
            args:
              - 10 #nb words
          id_customer:
            relation: Customer
            conditions: 
             id_guest: 1
          name:
            type: word
            args:
              - 10 #nb chars
            hidden: true   
          price:
            type: numberBetween
            args:
              - 1 #start
              - 1000 #stop
          wholesale_price:
            value: '{price}/100'              
      1. the 'type' property

        • 'increment' is a simple autoincrement.

        • 'conditionalValue' allow to generate value depending on a condition. Example:

          default_on:
            type: conditionalValue
            args:
              - isNewValue({id_product}) # condition
              - 1 # value if condition is true
              - null # value if condition is false

        The isNewValue is a special function which checks if the value related to the field {id_product} has changed since the last time we have generated an entity.

        If you need to pass an argument to a faker function, just add the 'args:' tag like in the above example.

        If you want to generate a field, but hide it from the final result, add the "hidden: true" property (only useful if the field in question is referenced as an "id", but only present in the field_lang)

      2. the 'relation' property

        The 'relation' property indicates it should generates the value from an another entity (it will use a value from the 'id' of the other entity).

        If the 'generate_all' property is used in conjunction with a relation type, it means we should use all the existing relations instead of just choosing a random one. It's especially usefull if we want for example generate combinations for every product in the database:

        fields:
            class: 'Combination'
            columns:
                id:
                  type: increment
                id_product:
                  relation: Product
                  generate_all: true

        If the 'conditions' property is used in conjunction with a relation type, it means all the fields specified should have the specified value in the related entity:

        fields:
            class: 'Guest'
            columns:
                id:
                  type: increment
            id_customer:
              relation: Customer
              conditions:
                is_guest: 1
      3. the 'value' property

        The 'value' property sets a specific value for the column. It could also be a reference to another column, or a mathematical expression, like the "wholesale_price" in the example above.

      4. the 'exclusive_fields' property

        Some columns should have a value only if other column are not set. That's the purpose of this property. In the example above only one randomly chosen field among id_customer/id_manufacturer/id_supplier will be set.

    2. class (optional)

      The name of the class related to the entity.

      Example:

      class: 'Carrier'
    3. sql (optional)

      Sql argument when want to add to help debugging

      Example:

      sql: 'a.id_carrier > 1'
    4. id

      The 'id' tag sets which field inside the 'columns' property should be considered as a the reference unique field for relation resolution.

      Example:

      id: 'name'
    5. primary

      When the primary tag is used, the script iterate over all the existing values, excepted if there's a 'generate_all: true' tag present (the fields in the 'primary' tag should be described as relations to other entities)

      Example:

      primary: 'id_carrier, id_group'
      columns:
          id_carrier:
            relation: Carrier
          id_group:
            relation: Group
    6. image (optional)

      Generate random images in the given relative path of the generated_data/img/ directory for each entity. It's used in conjonction with image_width, image_height and image_category.

      Example:

      image: 'c'
      image_width: 141
      image_height: 180
      image_category: abstract

      Possible image_category are:

      abstract
      animals
      business
      cats
      city
      food
      night
      life
      fashion
      people
      nature
      sports
      technics 
      transport
      
  2. The fields_lang section (optional)

    This section describes the list of fields present in the language related part of the entity (if any).

    You can set an optional 'id_shop' tag and a 'columns' property which support the type same 'value' and 'type' than the 'fields' section.

    Example:

    fields_lang:
        id_shop: 1
        columns:
            name:
              type: words
              args:
                - 6
            description:
              type: sentence
            description_short:
              type: sentence
              args:
                - 4
            link_rewrite:
              type: slug
            available_now:
              value: In stock
  3. The entities section (optional)

    This section describes any custom entities we want to create (no random generation for those one).

    The key of each entry used will be used as the 'id' of the entity

    Example:

    entities:
        My_carrier:
            fields:
                id_reference: 2
                active: 1
                shipping_handling: 1
                range_behaviour: 0
                is_free: 0
                shipping_external: 0
                need_range: 0
                shipping_method: 0
                max_width: 0
                max_height: 0
                max_depth: 0
                max_weight: 0
                grade: 0
                name: My carrier
                url: ~
            fields_lang:
                delay: Delivery next day!

Default xml data

If you want to use a default xml file instead of generating one using the entity model, just put it in the default_data directory.

It will be automatically parsed by the script and will be taken into account for the existing entity relations.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].