This project collects Amazon ASINs based on search terms retrieved from Shopware categories and manages them using the Rainforest API.
- Connects to the Shopware 6 API to retrieve categories.
- Uses custom fields in Shopware categories to determine search terms.
- Interacts with the Rainforest API to manage collections and ASINs.
- Optimized for PHP 8.3.
- Organized code structure with PSR-4 autoloading.
- PHP 8.3 or higher
- Composer
- Shopware 6 API credentials
- Rainforest API key
- Shopware Category Custom Fields (see Custom Fields Setup)
-
Clone the repository:
git clone https://github.com/ju-nu/amazon-collector.git cd amazon-collector -
Install dependencies via Composer:
composer install
-
Copy the
.env.examplefile to.envand fill in your credentials:cp .env.example .env
Edit the
.envfile and provide your Shopware API credentials and Rainforest API key.
To ensure the script works correctly, you need to create the following custom fields in your Shopware categories:
-
junu_category_collection(Boolean)- Description: A flag to indicate whether the category should be processed by the script.
- Values:
true: The category will be processed.falseor unset: The category will be skipped.
-
junu_category_collection_search(String)- Description: The search term to be used when querying Amazon via the Rainforest API. If not set, the category name will be used as the search term.
- Usage: Provide a specific search term if you want to override the category name.
-
junu_category_collection_id(String)- Description: Stores the collection ID from the Rainforest API corresponding to the category.
- Note: This field is automatically populated by the script when a new collection is created. You don't need to set this manually.
Run the script using the PHP CLI:
php main.php- Environment Variables: All configuration is done via the
.envfile. Ensure you have the correct values set for your environment.
This project is licensed under the MIT License.