feat: add option to disable auto add to cart (#759)

This commit is contained in:
Nathan Grebowiec
2020-11-11 18:56:45 -07:00
committed by GitHub
parent 0e730f4203
commit a5249ecc7c
4 changed files with 5 additions and 1 deletions
+1
View File
@@ -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
View File
@@ -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) {