Metadata-Version: 2.4
Name: ocyan.plugin.google
Version: 0.1.1
Summary: Setup recaptcha, and configure product attributes for google_shopping and google_rich_snippets plugins.
Home-page: https://git.mandelblog.com/mandel-plugins/ocyan.plugin.google
Author: Motolani Olaiya
Author-email: motolaniolaiya@gmail.com
Classifier: Framework :: Ocyan
Classifier: Environment :: Plugins
Requires-Python: >=3.12,<3.13
Description-Content-Type: text/markdown
Requires-Dist: Django<6,>=5
Requires-Dist: ocyan.core>=1.2.7
Requires-Dist: python-stdnum
Requires-Dist: django-recaptcha
Provides-Extra: test
Requires-Dist: ocyan.plugin.testing; extra == "test"
Requires-Dist: pylint-django; extra == "test"
Requires-Dist: ruff; extra == "test"
Requires-Dist: coverage; extra == "test"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

Ocyan plugin Google
===================
Installation
-------------
Add `ocyan.plugin.google` to your projects dependencies.

Follow configuration below.


About & Usage of the Google plugin
-----------------------
Every duplicate config options and utils between the google plugins (google_shopping, google_rich_snippets) should be added in this plugin. This way we keep it clean. If in the future something new is moved/added, please write unit tests if this a breaking change!

Product type
------------
By default the google shopping product type is based on the oscar product class name.
For sites having a LOT if product types, this is not feasable and it is
possible to store the product type on a product attribute instead.
If so required, specify the product_type_attribute in ocyan.json

Configuration
-------------
Settings you need to configure in config.json
- gtin_attribute
    - If you fill in a GTIN attribute on your product, google can identify the product and will know all product specifications. 

    - The default product attribute code for this is "barcode", which you can change with this config option.

    - <b>Note:</b> The GTIN is validated (see utils.py), as google knows if you entered a invalid code here. If you do not fill in the attribute, it will fallback on the UPC as GTIN (If this is a valid one, because this one gets validated aswell!)

- mpn_attribute
    - MPN stands for "Manufacturer Part Number", it's a unqiue number that is issued by manufacturers to identify individual products.

    - The default product attribute for this is "mpn", which you can change with this config option.

    - <b>Note:</b> If GTIN is filled in on the product, this attribute is not required to be filled. However, if GTIN is not filled, then MPN and Brand are required by google.
    
- brand_attribute
    - Basically what the name says: The brand of the product. Google requires this for your feed! If you don't know the brand, just fill something in.

    - The default product attribute for this is "brand", which you can change with this config option.

- product_type_attribute
    - If you want to store product type on an attribute instead of the oscar productclass, specify the code of the attribute here.

    - the default product_type on the google shopping feed will be the product class name.

- recaptcha_public_key
    - The public key for recaptha

- recaptcha_private_key
    - The private key for recaptcha

- recaptcha_version
    - There are three versions: v2, v2-invisible and v3. By default it uses v2.


Example: 

```json
    "google": {
        "gtin_attribute": "custom_gtin",
        "mpn_attribute": "custom_mpn",
        "brand_attribute": "custom_brand",
        "recaptcha_public_key": "xxxx",
        "recaptcha_private_key": "xxxx",
        "recaptcha_version": "v3"
    }
```
