Update deprecated @price helpers to modern price helper syntax#180
Update deprecated @price helpers to modern price helper syntax#180vitrixbot wants to merge 1 commit intoTryGhost:mainfrom
Conversation
Replace deprecated {{@price.monthly}} and {{@price.yearly}} with
{{price monthly_price currency=currency}} and {{price yearly_price currency=currency}}
WalkthroughThe change modifies the Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
members/signup.hbs (1)
17-55:⚠️ Potential issue | 🔴 Critical
monthly_price,yearly_price, andcurrencyare undefined—prices will not render.Lines 21 and 39 use
{{price monthly_price currency=currency}}, but these variables do not exist in this template scope. They are never defined, passed, or available in the{{else if@member}}context.The old syntax (
{{@price.monthly}},{{@price.yearly}},{{@price.currency}}) relied on Ghost's legacy@priceglobal, which was available at any scope. The new syntax requires these values to be in scope, either as template variables or from a tier/plan object context.To fix: either restore the working
@priceglobals (if still supported in your Ghost version), or wrap the checkout content in a{{#get"tiers"}}block to accessmonthly_priceandyearly_pricefrom tier objects. Seemembers/account.hbsline 36-41 for the correct pattern of iterating tiers with{{#foreach@member.subscriptions}}and accessing{{price plan}}.
The global
@priceobject is deprecated. This updatesmembers/signup.hbsto use the modern{{price}}helper:{{price currency=@price.currency}}{{@price.monthly}}→{{price monthly_price currency=currency}}{{price currency=@price.currency}}{{@price.yearly}}→{{price yearly_price currency=currency}}The
{{price}}helper handles currency symbol formatting automatically.Supersedes #160 (which had a duplicate currency symbol bug).