Пример #1
0
 def test_basic_shopify_methods(self):
     """
     Non-connection tests
     :return:
     """
     fake_creds = dict(
         SHOPIFY_KEY='incorrect_value',
         SHOPIFY_PASSWORD='******',
         SHOPIFY_STORE='incorrect_value',
         SHOPIFY_BASE_URL='incorrect_value',
     )
     s = Shopify(fake_creds)
     for call, count in prepare_call_tests:
         self.assertEqual(
             len(s.prepare_call(call)),
             count,
         )
Пример #2
0
 def test_basic_shopify_methods(self):
     """
     Non-connection tests
     :return:
     """
     fake_creds = dict(
         SHOPIFY_KEY='incorrect_value',
         SHOPIFY_PASSWORD='******',
         SHOPIFY_STORE='incorrect_value',
         SHOPIFY_BASE_URL='incorrect_value',
     )
     s = Shopify(fake_creds)
     for call, count in prepare_call_tests:
         self.assertEqual(
             len(s.prepare_call(call)),
             count,
         )
Пример #3
0
from shopify import Shopify

NAME = 'ledbury'
DISPLAY_NAME = 'Ledbury - Apparel'
cats = ['new-shirts', 'dress-shirts', 'business-casual', 'casual-sport', 'sunday-shirting', 'all-clothing', 'blazers', 'sweaters', 'pants', 'ties', 'cold-weather-accessories', 'collar-stays', 'cufflinks-studs', 'pocket-squares', 'the-tuxedo-capsule']
cat_names = ['New Shirts', 'Dress Shirts', 'Busienss Casual', 'Casual + Sport', 'Sunday Shirting', 'All Clothing', 'Sports Coats', 'Sweaters + Knits', 'Pants']
shipping = 'Free shipping and returns for all orders above $125'
note = 'Final upload'

brand = Shopify(NAME, DISPLAY_NAME, cats, shipping, note)
brand.run()
brand.write_csv()
brand.write_info()
# brand.post_collections(cat_names)
Пример #4
0
from shopify import Shopify

WEB_NAME = 'manscaped'  # Website name
DISPLAY_NAME = 'Manscaped - Grooming'
cats = ['']
cat_names = []
imgs = []
shipping = 'All Company products carry a 30-day Gentlemen’s Agreement from date of receipt of goods. All returns must be in their original individual packaging. Refunds do not include the original cost for shipping and handling. Discounted items are final sale and are not eligible for return or exchange.'
note = 'New brand'

brand = Shopify(WEB_NAME, DISPLAY_NAME, cats, shipping, note)
brand.url[0] = 'https://www.manscaped.com/'
brand.run()
brand.write_csv()
brand.write_info()
# brand.post_collections(cat_names, imgs)
Пример #5
0
from shopify import Shopify

WEB_NAME = 'oliversapparel'  # Website name
DISPLAY_NAME = 'Olivers - Apparel'
cats = ['pants', 'shorts', 'tees', 'midlayers']
cat_names = ['Pants', 'Shorts', 'Tees', 'Midlayers']
imgs = [
    'https://drive.google.com/uc?export=download&id=104eiNGMRfsjWNc2_9jnodeZ7-bNQZzH_',
    'https://drive.google.com/uc?export=download&id=1cTN_jwT4NY00W9n-qhzpJolKd36AX1WT',
    'https://drive.google.com/uc?export=download&id=1TEa_UunjI7UEYjDDYNb3lEiow7Wl2-ck',
    'https://drive.google.com/uc?export=download&id=18Nh1OdKJqjzwGfkkjOGfh_vxwMNf04Zb',
    'https://drive.google.com/uc?export=download&id=16_8qxPlSGWu2an-s2VODdJIdO9zoDFeM'
]
shipping = ' We offer returns using our label for an $8 fee deducted from your refund, or you can return using your own carrier or a refund to store credit for no charge. Returns and exchanges must be received in original, unused and unwashed condition. All returns must be postmarked within 60 days from order date to be eligible for a return.'
note = 'New brand'

brand = Shopify(WEB_NAME, DISPLAY_NAME, cats, shipping, note)
brand.url = [
    'https://shop.' + WEB_NAME + '.com/collections/',
    '/products.json?limit=250&page='
]
brand.run()
brand.write_csv()
brand.write_info()
# brand.post_collections(cat_names, imgs)
Пример #6
0
from shopify import Shopify

WEB_NAME = 'magicmind' # Website name
DISPLAY_NAME = 'Magic mind - Health and Wellness'
cats = ['']
cat_names = []
imgs = []
shipping = ''
note = 'New brand'

brand = Shopify(WEB_NAME, DISPLAY_NAME, cats, shipping, note)
brand.url[0] = 'https://magicmind.co/'
brand.run()
brand.write_csv()
brand.write_info()
# brand.post_collections(cat_names, imgs)
Пример #7
0
from shopify import Shopify

WEB_NAME = 'jackhenry'  # Website name
DISPLAY_NAME = 'Jack Henry - Grooming'
cats = ['hair', 'face', 'body', 'kits']
cat_names = ['Hair', 'Face', 'Body', 'Kits']
imgs = [
    'https://drive.google.com/uc?export=download&id=1FZrsL4sB-l5QlYDZktnJuP1i8_qxJqQm',
    'https://drive.google.com/uc?export=download&id=1a2ixh4okYCukZfRK6Usfnlqu1cqVGkYt',
    'https://drive.google.com/uc?export=download&id=1b3qqq8o5AUmCNlwqIQtsIjwJtZo2vDqA',
    'https://drive.google.com/uc?export=download&id=1ysaoLFmDrGP4BGKY3UVYipdfw63HTfQx',
    'https://drive.google.com/uc?export=download&id=1wCb0QgPrCwqcsIPyAplmZJgg94J_dIO5'
]
shipping = 'Free shipping and free returns. Returns available for unworn and unused products.'
note = 'New brand'

brand = Shopify(WEB_NAME, DISPLAY_NAME, cats, shipping, note)
brand.url[0] = 'https://jackhenry.co/collections/'
brand.run()
brand.write_csv()
brand.write_info()
# brand.post_collections(cat_names, imgs)
Пример #8
0
from shopify import Shopify

WEB_NAME = 'drinkhydrant'  # Website name
DISPLAY_NAME = 'Hydrant - Health and Wellness'
cats = ['']
cat_names = []
imgs = []
shipping = 'Hydrant purchases come with free Standard Shipping, which is 3-5 Business Days. Expedited shipping is also available, which is 2-3 Business Days. Unfortunately, we don’t ship on Saturdays or Sundays. We offer a 30 day money back guarantee on our hydration mixes - if you are unhappy with your purchase for some reason, please let us know within 30 days at: [email protected]'
note = 'New brand'

brand = Shopify(WEB_NAME, DISPLAY_NAME, cats, shipping, note)
brand.url = [
    'https://www.' + WEB_NAME + '.com', '/products.json?limit=250&page='
]
brand.link = brand.url[0] + '/'
brand.run()
brand.write_csv()
brand.write_info()
# brand.post_collections(cat_names, imgs)
Пример #9
0
from shopify import Shopify

WEB_NAME = 'oarsandalps'  # Website name
DISPLAY_NAME = 'Oars + Alps - Apparel'
cats = ['deo-face-body-swag']
cat_names = []
imgs = []
shipping = 'Free Gifts with Orders $30+ | Free Shipping $40+ | Always Free Returns'
note = 'New brand'

brand = Shopify(WEB_NAME, DISPLAY_NAME, cats, shipping, note)
brand.url[0] = 'https://www.oarsandalps.com/collections/'
brand.run()
brand.write_csv()
brand.write_info()
# brand.post_collections(cat_names, imgs)
Пример #10
0
from shopify import Shopify

NAME = 'w-co'
DISPLAY_NAME = 'W Co. - Apparel'
cats = ['new-releases', 'outerwear', 't-shirts', 'accessories']
cat_names = ['New Releases', 'Outerwear', 'T-Shirts', 'Accessories']
shipping = 'FREE SHIPPING ON ORDERS OVER $100 — FREE RETURNS — FREE EXCHANGES'.lower(
)
note = 'Final upload'

brand = Shopify(NAME, DISPLAY_NAME, cats, shipping, note)
brand.url = [
    'https://' + NAME + '.us/collections/', '/products.json?limit=250&page='
]
brand.link = brand.url[0].split('collections')[0]
brand.run()
brand.write_csv()
brand.write_info()
# brand.post_collections(cat_names)
Пример #11
0
from app import db
from models import Discount
from flask import Blueprint, render_template, request
from shopify import Shopify

shopify = Shopify()

api_module = Blueprint('api', __name__, url_prefix='/api')


@api_module.route('/generate', methods=['POST'])
def generate_discount():
    if request.method == 'POST':
        discount = Discount(**request.form.to_dict())
        shopify.add_discount(discount)
        db.session.add(discount)
        db.session.commit()
        return render_template('index.html', code=discount.code)