Updated Readme

This commit is contained in:
2025-08-20 15:49:48 -05:00
parent 0402c56330
commit 98672fb99d

View File

@@ -4,12 +4,12 @@ A Node.js script designed to automate the bulk updating and rolling back of Shop
## Features ## Features
* **Bulk Price Updates:** Adjust product prices by a configurable percentage (increase or decrease). - **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. - **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. - **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. - **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. - **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. - **Graceful Shutdown:** Handles interruptions gracefully, ensuring data integrity.
## Installation ## Installation
@@ -17,19 +17,22 @@ To get started with the Shopify Price Updater, follow these steps:
### Prerequisites ### Prerequisites
* Node.js (version 16.0.0 or higher) - Node.js (version 16.0.0 or higher)
* Access to a Shopify store with Admin API credentials. - Access to a Shopify store with Admin API credentials.
### Steps ### Steps
1. **Clone the Repository:** 1. **Clone the Repository:**
```bash ```bash
git clone https://github.com/your-repo/shopify-price-updater.git git clone https://github.com/your-repo/shopify-price-updater.git
cd shopify-price-updater 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:** 2. **Install Dependencies:**
```bash ```bash
npm install 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 # SCHEDULED_EXECUTION_TIME=2024-12-25T10:30:00
``` ```
* `SHOPIFY_SHOP_DOMAIN`: Your Shopify store's domain (e.g., `your-store.myshopify.com`). - `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. - `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`). - `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. - `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%). - `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. - `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 ## Usage
@@ -71,17 +74,21 @@ This will run the script in `update` mode with the `TARGET_TAG` and `PRICE_ADJUS
npm start 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 ```bash
npm run update 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 ```bash
npm run rollback npm run rollback