diff --git a/README.md b/README.md index b046e1c..3024b18 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,12 @@ A Node.js script designed to automate the bulk updating and rolling back of Shop ## Features -* **Bulk Price Updates:** Adjust product prices by a configurable percentage (increase or decrease). -* **Price Rollback:** Revert product prices to their original "compare-at" price, useful for ending sales or promotions. -* **Tag-Based Operations:** Target specific groups of products using Shopify product tags. -* **Scheduled Execution:** Optionally schedule price operations to run at a future date and time. -* **Comprehensive Logging:** Provides detailed logs of operations, including product counts, successful updates/rollbacks, and any encountered errors. -* **Graceful Shutdown:** Handles interruptions gracefully, ensuring data integrity. +- **Bulk Price Updates:** Adjust product prices by a configurable percentage (increase or decrease). +- **Price Rollback:** Revert product prices to their original "compare-at" price, useful for ending sales or promotions. +- **Tag-Based Operations:** Target specific groups of products using Shopify product tags. +- **Scheduled Execution:** Optionally schedule price operations to run at a future date and time. +- **Comprehensive Logging:** Provides detailed logs of operations, including product counts, successful updates/rollbacks, and any encountered errors. +- **Graceful Shutdown:** Handles interruptions gracefully, ensuring data integrity. ## Installation @@ -17,19 +17,22 @@ To get started with the Shopify Price Updater, follow these steps: ### Prerequisites -* Node.js (version 16.0.0 or higher) -* Access to a Shopify store with Admin API credentials. +- Node.js (version 16.0.0 or higher) +- Access to a Shopify store with Admin API credentials. ### Steps 1. **Clone the Repository:** + ```bash git clone https://github.com/your-repo/shopify-price-updater.git cd shopify-price-updater ``` - *(Note: Replace `https://github.com/your-repo/shopify-price-updater.git` with the actual repository URL if different.)* + + _(Note: Replace `https://github.com/your-repo/shopify-price-updater.git` with the actual repository URL if different.)_ 2. **Install Dependencies:** + ```bash npm install ``` @@ -52,12 +55,12 @@ To get started with the Shopify Price Updater, follow these steps: # SCHEDULED_EXECUTION_TIME=2024-12-25T10:30:00 ``` - * `SHOPIFY_SHOP_DOMAIN`: Your Shopify store's domain (e.g., `your-store.myshopify.com`). - * `SHOPIFY_ACCESS_TOKEN`: A Shopify Admin API Access Token with `write_products` and `read_products` permissions. - * `TARGET_TAG`: The Shopify product tag that identifies the products you want to update (e.g., `sale`, `clearance`). - * `OPERATION_MODE`: Set to `update` for price adjustments or `rollback` to revert prices. - * `PRICE_ADJUSTMENT_PERCENTAGE`: (Used only in `update` mode) The percentage by which to adjust prices. Use a positive number for an increase (e.g., `10` for +10%) and a negative number for a decrease (e.g., `-15` for -15%). - * `SCHEDULED_EXECUTION_TIME`: (Optional) An ISO 8601 formatted datetime string (e.g., `YYYY-MM-DDTHH:MM:SS`). If set, the script will wait until this time before executing the operation. Leave commented out or remove to execute immediately. + - `SHOPIFY_SHOP_DOMAIN`: Your Shopify store's domain (e.g., `your-store.myshopify.com`). + - `SHOPIFY_ACCESS_TOKEN`: A Shopify Admin API Access Token with `write_products` and `read_products` permissions. + - `TARGET_TAG`: The Shopify product tag that identifies the products you want to update (e.g., `sale`, `clearance`). + - `OPERATION_MODE`: Set to `update` for price adjustments or `rollback` to revert prices. + - `PRICE_ADJUSTMENT_PERCENTAGE`: (Used only in `update` mode) The percentage by which to adjust prices. Use a positive number for an increase (e.g., `10` for +10%) and a negative number for a decrease (e.g., `-15` for -15%). + - `SCHEDULED_EXECUTION_TIME`: (Optional) An ISO 8601 formatted datetime string (e.g., `YYYY-MM-DDTHH:MM:SS`). If set, the script will wait until this time before executing the operation. Leave commented out or remove to execute immediately. ## Usage @@ -71,17 +74,21 @@ This will run the script in `update` mode with the `TARGET_TAG` and `PRICE_ADJUS npm start ``` -### Run in Update Mode +### ~~Run in Update Mode~~ -Explicitly sets the `OPERATION_MODE` to `update`. This is useful if you want to override the `.env` setting for a single run. +~~Explicitly sets the `OPERATION_MODE` to `update`. This is useful if you want to override the `.env` setting for a single run.~~ + +Doesn't work currently, weird spacing issues in package.json ```bash npm run update ``` -### Run in Rollback Mode +### ~~Run in Rollback Mode~~ -Explicitly sets the `OPERATION_MODE` to `rollback`. This will revert prices of products with the `TARGET_TAG` from their current price to their `compare-at` price. +~~Explicitly sets the `OPERATION_MODE` to `rollback`. This will revert prices of products with the `TARGET_TAG` from their current price to their `compare-at` price.~~ + +Doesn't work currently, weird spacing issues in package.json ```bash npm run rollback