- TS application listening port: 7777
|-- dist
|-- src
|-- .dockerignore
|-- Dockerfile
| const { Queue, QueueEvents } = require('bullmq'); | |
| const { EventEmitter } = require('events'); | |
| const config = require('../config'); | |
| const createUid = require('uid'); | |
| class QueueArena extends EventEmitter { | |
| constructor({ redisDb = 1 }) { | |
| super(); | |
| this.redisDb = redisDb; | 
| import Axios from 'axios' | |
| state = { | |
| todos : null | |
| }, | |
| getters = { | |
| TODOS : state => { | |
| return state.todos; | |
| } | |
| }, | 
| # Stop customers from using a discount code | |
| # This script will reject all discount codes. Useful if you have a sale | |
| # and don't want additional discounts to be applied | |
| # Set the rejection message for discount codes | |
| REJECTION_MESSAGE = "Discount codes cannot be used during this sale" | |
| class RejectAllDiscountCodes | |
| # Initializes the campaign. | |
| # | 
| # See https://onlygrowth.com/blogs/posts/17-shopify-scripts-to-maximize-conversions for some helpful snippets | |
| class FreeGift | |
| def initialize(variant_id, minTotal, message, quantity = 1) | |
| @variant_id = variant_id | |
| @minTotal = minTotal | |
| @message = message | |
| @giftQuantity = quantity | |
| end | |
| # Get the total of the cart without the variant price being included | 
| discounted_product = 12275195905 | |
| products_needed = [592406273] | |
| products_seen = [] | |
| Input.cart.line_items.each do |line_item| | |
| product = line_item.variant.product | |
| products_seen << product.id if products_needed.include?(product.id) | |
| end | |
| Input.cart.line_items.each do |line_item| | 
| {% comment %} | |
| To add a companion product to the cart automatically if a primary product is in cart: | |
| 1. Create a new link list under your Navigation tab. | |
| 2. In that link list, make the first link point to companion product. | |
| 3. Copy your link list handle where indicated at line 9 | |
| 4. Set the minimum cart total required for the bonus product on line 10 | |
| {% endcomment %} | |
| {% assign linklist = linklists['put-your-link-list-handle-here'] %} | |
| {% assign min_total = 100 %} | 
| <form action="/cart/add" method="post"> | |
| {% if product.variants.size > 1 %} | |
| {% if product.options[0] %} | |
| {% assign used = '' %} | |
| <label for="select-one">{{ product.options[0] }}</label> | |
| <select id='select-one' onchange="letsDoThis()"> | |
| {% for variant in product.variants %} | |
| {% unless used contains variant.option1 %} | |
| <option value="{{ variant.option1 }}">{{ variant.option1 }}</option> | |
| {% capture used %}{{ used }} {{ variant.option1 }}{% endcapture %} |