AmazonProductField

Added v0.2.40
Column Type varchar

Description

This field will allow the user to enter an Amazon Standard Item Number (ASIN) and will check that it is valid.

Requirements

In order to use this field, you will need to provide a route fo for checking asin validity. The default route is:

Route::group(['middleware' => ['web', 'enso']], function () {
    Route::get('admin/amazon/asin-check', '\Yadda\Enso\Crud\Controllers\AmazonProductController@asinCheck');
});

API

Install paapi5-php-sdk.

enso composer require thewirecutter/paapi5-php-sdk

Credentials

Add an amazon entry in config/services.php. This should include access_key_id, secret_acces_key, default_locale and a locales array with a valid Amazon Associate tag and the corresponding region for each locale you wish to support.

You can then add additional locales as needed.

Read more information on how to get these credentials.

<?php

return [
    // ...

    'amazon' => [
        'apai' => [
            'default_locale' => 'co.uk',

            // See: https://docs.aws.amazon.com/AWSECommerceService/latest/DG/becomingDev.html
            'access_key_id' => env('AMAZON_ACCESS_KEY_ID'),

            'secret_access_key' => env('AMAZON_SECRET_ACCESS_KEY'),

            // All amazon locales
            'locales' => [
                'co.uk' => [
                    'associate_tag' => env('AMAZON_UK_ASSOCIATE_TAG', 'my-uk-associate-tag-123'),
                    'region' => 'eu-west-1',
                ],
                'com' => [
                    'associate_tag' => env('AMAZON_US_ASSOCIATE_TAG', 'my-us-associate-tag-321'),
                    'region' => 'us-east-1',
                ],
            ],
        ],
    ],
];