mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 05:17:35 +00:00
feat: add option to disable auto add to cart (#759)
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
ASCII_BANNER=
|
||||
ASCII_COLOR=
|
||||
AUTO_ADD_TO_CART=
|
||||
BROWSER_TRUSTED=
|
||||
COUNTRY=
|
||||
DESKTOP_NOTIFICATIONS=
|
||||
|
||||
@@ -84,6 +84,7 @@ environment variables are **optional**._
|
||||
|
||||
| Environment variable | Description | Notes |
|
||||
|:---:|---|---|
|
||||
| `AUTO_ADD_TO_CART` | Enable auto add to cart on support stores | Default: `true` |
|
||||
| `BROWSER_TRUSTED` | Skip Chromium Sandbox | Useful for containerized environments, default: `false` |
|
||||
| `HEADLESS` | Puppeteer to run headless or not | Debugging related, default: `true` |
|
||||
| `INCOGNITO` | Puppeteer to run incognito or not | Debugging related, default: `false` |
|
||||
|
||||
@@ -302,6 +302,7 @@ if (process.env.MAX_PRICE) {
|
||||
}
|
||||
|
||||
const store = {
|
||||
autoAddToCart: envOrBoolean(process.env.AUTO_ADD_TO_CART, true),
|
||||
country: envOrString(process.env.COUNTRY, 'usa'),
|
||||
maxPrice: {
|
||||
series: {
|
||||
|
||||
+2
-1
@@ -117,7 +117,8 @@ async function lookupCard(
|
||||
}
|
||||
|
||||
if (await lookupCardInStock(store, page, link)) {
|
||||
const givenUrl = link.cartUrl ? link.cartUrl : link.url;
|
||||
const givenUrl =
|
||||
link.cartUrl && config.store.autoAddToCart ? link.cartUrl : link.url;
|
||||
logger.info(`${Print.inStock(link, store, true)}\n${givenUrl}`);
|
||||
|
||||
if (config.browser.open) {
|
||||
|
||||
Reference in New Issue
Block a user