Metadata-Version: 2.1
Name: odoo10-addon-shopinvader-product-variant-selector
Version: 10.0.1.0.0.99.dev10
Summary: Module that allow multi selector on shopinvader site
Home-page: https://github.com/shopinvader/odoo-shopinvader
Author: Akretion
License: AGPL-3
Platform: UNKNOWN
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Requires-Python: ~=2.7
Requires-Dist: odoo10-addon-shopinvader
Requires-Dist: odoo (<10.1dev,>=10.0)

====================================
Shopinvader Product Variant Selector
====================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! This file is generated by oca-gen-addon-readme !!
   !! changes will be overwritten.                   !!
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
    :target: https://odoo-community.org/page/development-status
    :alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
    :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
    :alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-shopinvader%2Fodoo--shopinvader-lightgray.png?logo=github
    :target: https://github.com/shopinvader/odoo-shopinvader/tree/10.0/shopinvader_product_variant_selector
    :alt: shopinvader/odoo-shopinvader

|badge1| |badge2| |badge3| 

This is shopinvader the odoo module for the new generation of e-commerce.

This module adds the field `variant_selector` in the product variant metadata (exported to algolia or elastic).
The value of the field contains the possible combinations of variants that are available.
This ease frontend development of variant selectors.


Example of value
---------------------


.. code-block:: python

    [
        {
            "name": "Frame Type",
            "values": [
                {
                    "name": "Poster",
                    "sku": "Poster-White-70x50cm",
                    "selected": True,
                    "available": True,
                },
                {
                    "name": "Wooden",
                    "sku": "Wooden-White-70x50cm",
                    "selected": False,
                    "available": True,
                },
            ],
        },
        {
            "name": "Frame Color",
            "values": [
                {
                    "name": "White",
                    "sku": "Poster-White-70x50cm",
                    "selected": True,
                    "available": True,
                },
                {
                    "name": "Black",
                    "sku": "Poster-Black-70x50cm",
                    "selected": False,
                    "available": True,
                },
                {
                    "name": "Grey",
                    "sku": "Poster-Grey-70x50cm",
                    "selected": False,
                    "available": True,
                },

            ],
        },
        {
            "name": "Poster Size",
            "values": [
                {
                    "name": "45x30cm",
                    "sku": "",
                    "selected": False,
                    "available": False,
                },
                {
                    "name": "70x50cm",
                    "sku": "Poster-White-70x50cm",
                    "selected": True,
                    "available": True,
                },
                {
                    "name": "90x60cm",
                    "sku": "Poster-White-90x60cm",
                    "selected": False,
                    "available": True,
                },
            ],
        },
    ],

Undertanding the way to select attribute
------------------------------------------------

It's also important to understand how variant are selected and how attribute value are filtered.

Imaging a case where you have a child shoes with
- 6 sizes: 15, 16, 17, 18, 19, 20
- 3 colors: Green, Red, Yellow

It's a special shoes:
- Green exist in size: 18, 19
- Red exist in size: 15, 16, 17
- Yellow exist in size: 18, 19, 20

In your ERP you have configured to select is the size then the color.
And the default variant is the first "Green 18"

Step 1 : You go to the page of your product.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You will have:

.. code-block:: python

    size : 15, 16, 17, [18], 19, 20
    color : [Green], (Red), Yellow

    [] mean selected
    () mean not available


Only the color Green and Yellow are available because the size 18 is selected.


Step 2: Now you select the color Yellow
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You will have:

.. code-block:: python

    size : 15, 16, 17, [18], 19, 20
    color : Green, (Red), [Yellow]

Even if you select the color Yellow the size are now filetered because the second filter can not filter the first one.


Step 3: Now you select the size 16
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

As only the Red color is available for this size you are redirected to the Red shoes and you have

.. code-block:: python

    size : 15, [16], 17, 18, 19, 20
    color : (Green), [Red], (Yellow)


Why not trying to filter the size when changing the color?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Because if we do this if you select the size 16

Then you will have this

.. code-block:: python

    size : 15, [16], 17, (18), (19), (20)
    color : (Green), [Red], (Yellow)


And you will be locked in this situation without any possibility to select the Yellow shoes with size 19. There is an order for filling/selected the value of each option and selecting a value should only impact the next attribute not the previous one.


This is the Odoo side of Shopinvader_.

.. _Shopinvader: https://shopinvader.com

**Table of contents**

.. contents::
   :local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/shopinvader/odoo-shopinvader/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/shopinvader/odoo-shopinvader/issues/new?body=module:%20shopinvader_product_variant_selector%0Aversion:%2010.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Akretion

Contributors
~~~~~~~~~~~~

* Sebastien BEAU <sebastien.beau@akretion.com>

Other credits
~~~~~~~~~~~~~

The development of this module has been financially supported by:

* Abilis

Maintainers
~~~~~~~~~~~

This module is part of the `shopinvader/odoo-shopinvader <https://github.com/shopinvader/odoo-shopinvader/tree/10.0/shopinvader_product_variant_selector>`_ project on GitHub.

You are welcome to contribute.


