diff --git a/app/core/application.coffee b/app/core/application.coffee index 91bc5cc46..561a5223f 100644 --- a/app/core/application.coffee +++ b/app/core/application.coffee @@ -29,7 +29,7 @@ elementAcceptsKeystrokes = (el) -> # not radio, checkbox, range, or color return (tag is 'textarea' or (tag is 'input' and type in textInputTypes) or el.contentEditable in ['', 'true']) and not (el.readOnly or el.disabled) -COMMON_FILES = ['/images/pages/base/modal_background.png', '/images/level/code_palette_wood_background.png', '/images/level/popover_background.png', '/images/level/code_editor_background.png'] +COMMON_FILES = ['/images/pages/base/modal_background.png', '/images/level/popover_background.png'] #'/images/level/code_palette_wood_background.png', , '/images/level/code_editor_background.png' preload = (arrayOfImages) -> $(arrayOfImages).each -> $('<img/>')[0].src = @ diff --git a/app/views/play/modal/SubscribeModal.coffee b/app/views/play/modal/SubscribeModal.coffee index 1f7a21980..ae32e9116 100644 --- a/app/views/play/modal/SubscribeModal.coffee +++ b/app/views/play/modal/SubscribeModal.coffee @@ -28,7 +28,8 @@ module.exports = class SubscribeModal extends ModalView c = super() c.state = @state c.stateMessage = @stateMessage - c.price = @product.amount / 100 + #c.price = @product.amount / 100 + c.price = 5.99 # Sale c.BTest = me.getSubscribeCopyGroup() is 'new' return c @@ -38,6 +39,8 @@ module.exports = class SubscribeModal extends ModalView popoverContent = "<p>" + $.i18n.t('subscribe.parents_blurb1') + "</p>" popoverContent += "<p>" + $.i18n.t('subscribe.parents_blurb2') + "</p>" popoverContent += "<p>" + $.i18n.t('subscribe.parents_blurb3') + "</p>" + popoverContent = popoverContent.replace /9[.,]99/g, '5.99' # Sale + window.popoverContent = popoverContent @$el.find('#parents-info').popover( animation: true html: true @@ -64,10 +67,10 @@ module.exports = class SubscribeModal extends ModalView # overwrite amount with sale price # maybe also put in another description with details about how long it lasts, etc # NOTE: Do not change this price without updating the context.price in getRenderData -# options = { -# description: 'Subscription. Half price for three months!' -# amount: 499 -# } + options = { + description: 'Monthly Subscription (HoC sale)' + amount: 599 + } stripeHandler.open(options) diff --git a/server/payments/subscription_handler.coffee b/server/payments/subscription_handler.coffee index 63170bb33..f21b657ff 100644 --- a/server/payments/subscription_handler.coffee +++ b/server/payments/subscription_handler.coffee @@ -32,7 +32,7 @@ class SubscriptionHandler extends Handler @logSubscriptionError(user, 'Cannot find customer: ', +customer.id + '\n\n' + err) return done({res: 'Cannot find customer.', code: 404}) @checkForExistingSubscription(req, user, customer, done) - + else newCustomer = { card: token @@ -47,7 +47,7 @@ class SubscriptionHandler extends Handler else @logSubscriptionError(user, 'Stripe customer creation error. '+err) return done({res: 'Database error.', code: 500}) - + stripeInfo = _.cloneDeep(user.get('stripe') ? {}) stripeInfo.customerID = customer.id user.set('stripe', stripeInfo) @@ -68,11 +68,11 @@ class SubscriptionHandler extends Handler checkForExistingSubscription: (req, user, customer, done) -> couponID = user.get('stripe')?.couponID - + # SALE LOGIC # overwrite couponID with another for everyone-sales - # couponID = 'hoc_bonanza' if not couponID - + couponID = 'hoc_599' if not couponID + if subscription = customer.subscriptions?.data?[0] if subscription.cancel_at_period_end