Skip to content
This repository has been archived by the owner on May 8, 2019. It is now read-only.

Design Page

Guo Yunhe edited this page Mar 4, 2017 · 5 revisions

Model: app/Design.php, app/DesignTranslation.php

Route: design/{id}

Price

Database columns: price, currency, eur_price

Support custom currency and price in EUR will be automatically generated upon rates at that time. Most of our designers are from European countries and use euro as currency. Note the eur_price is not always up-to-date. It is only used for comparing and reference.

Options

Table optset and model Optset (Option Set):

Name Type Values
id INT
design_id INT
type VARCHAR color, size, material, custom

Table optset_translation:

Name Type Values
id INT
optset_id INT
lang VARCHAR
name VARCHAR

Table option and model Option:

Name Type Values
id INT
optset_id INT
image_id INT
design_id INT If this option link to another design
price_add DECIMAL(8,2) Add or sub from base price 3.00, -5.99
value VARCHAR Color: #88f7d3

Table option_value_translation:

Name Type Values
id INT
option_id INT
lang VARCHAR
name VARCHAR

Example JSON:

{
    "color": {
        "options": [
            {
                "name": "Yaaa Red",
                "image_id": 187,
                "price_add": 0,
                "translations": {
                    "zh": "很红",
                    "de": "Yaaa Rot",
                }
            },
            {
                "name": "Baaa Blue",
                "image_id": 188,
                "price_add": 7.99,
                "translations": {
                    "zh": "很蓝",
                    "de": "Yaaa Blau",
                }
            },
            {
                "name": "Hooo Green",
                "image_id": 189,
                "price_add": 0,
                "translations": {
                    "zh": "很绿",
                    "de": "Hooo Grün",
                }
            },
        ]
    },
    "size": {
        "options": [
            {
                "name": "XXL"
            },
            {
                "name": "XL"
            },
            {
                "name": "L"
            },
            {
                "name": "M"
            }
        ]
    }
}