diff --git a/ghost/admin/app/controllers/offer.js b/ghost/admin/app/controllers/offer.js index 1c2e631542..493d8d190a 100644 --- a/ghost/admin/app/controllers/offer.js +++ b/ghost/admin/app/controllers/offer.js @@ -69,13 +69,6 @@ export default class OffersController extends Controller { }; } - get discountVal() { - if (this.offer?.type === 'fixed' && typeof this.offer?.amount === 'number') { - return (this.offer?.amount / 100); - } - return this.offer?.amount; - } - get cadence() { if (this.offer.tier && this.offer.cadence) { return `${this.offer.tier.id}-${this.offer.cadence}`; @@ -114,7 +107,7 @@ export default class OffersController extends Controller { }); this.cadences = cadences; if (this.offer && !this.offer.tier) { - this.updateCadence(this.cadences[0].name); + this.updateCadence(this.cadences[0]?.name); } } diff --git a/ghost/admin/app/templates/offer.hbs b/ghost/admin/app/templates/offer.hbs index f4ddf727d6..67ac2e8c5f 100644 --- a/ghost/admin/app/templates/offer.hbs +++ b/ghost/admin/app/templates/offer.hbs @@ -29,6 +29,7 @@ @id="name" @value={{this.offer.name}} @input={{this.setOfferName}} + data-test-input="offer-name" @class="gh-input" />

Will be shown to members on the Stripe Checkout page

@@ -62,10 +63,11 @@ @type="number" @placeholder="" @disabled={{this.isDiscountSectionDisabled}} - @value={{readonly this.discountVal}} + @value={{readonly (gh-price-amount this.offer.amount)}} @input={{this.setDiscountAmount}} @id="amount" - @class="gh-input" /> + @class="gh-input" + /> diff --git a/ghost/admin/app/templates/offers.hbs b/ghost/admin/app/templates/offers.hbs index 2993c00e16..183b8e0f7e 100644 --- a/ghost/admin/app/templates/offers.hbs +++ b/ghost/admin/app/templates/offers.hbs @@ -18,8 +18,8 @@ {{#each this.offers as |offer|}} - - + +

{{offer.name}}