GScan not picking up some {{products}} incompatibilities for 5.0

I just finished updating a site from 4.48.0 to 5.0.2, GScan notifiying me that I had to switch a couple of instances of {{products}} to {{tiers}}. Easy enough, and the instance was backed up and upgraded without a hitch.

However, there’s a bunch of other similar handlebars usage which GScan apparently didn’t pick up and which results in the tiers/membership page not fully rendering. I checked out the docs but I wasn’t clear about what I should be doing to update things. Anybody know how I should be updating the following? I tried straight-up replacing product with tier and products with tiers, but that didn’t quite do the trick.

<div class='c-member-plans'>
  {{#foreach @products as |product|}}
    <div class='c-member-plan'>
      <div class="member-plan__alignment">
        <div>
          <header class='c-member-plan__header'>
            <h3 class='c-member-plan__title'>{{product.name}}</h3>
            <div class='c-member-plan__description'>{{product.description}}</div>
            <span class='c-member-plan__sign'>{{ price currency=@price.currency }}</span>
            {{#if product.monthly_price}}
              <span class='monthly-plan'><strong class='c-member-plan__amount'>{{price monthly_price.amount}}</strong> / {{t 'month'}}</span>
            {{/if}}
            {{#if product.yearly_price}}
              <span class='annual-plan'><strong class='c-member-plan__amount'>{{price yearly_price.amount}}</strong> / {{t 'year'}}</span>
            {{/if}}
            {{^if product.monthly_price}}
              {{^if product.yearly_price}}
                <span><strong class='c-member-plan__amount'>0</strong></span>
              {{/if}}
            {{/if}}
          </header>
          <div class='c-member-plan__content'>
            {{#if benefits}}
              <ul class='c-member-plan__list'>
                {{#foreach benefits as |benefit|}}
                  <li>{{benefit.name}}</li>
                {{/foreach}}
              </ul>
            {{/if}}
          </div>
        </div>
        {{#if product.monthly_price}}
          <span class="monthly-plan">
            <a class='c-btn c-btn--action c-btn--small' data-members-plan="{{product.monthly_price.id}}">Join {{ price currency=@price.currency }}{{price monthly_price.amount}} / month tier</a>
          </span>
        {{/if}}
        {{#if product.yearly_price}}
          <span class="annual-plan">
            <a class='c-btn c-btn--action c-btn--small' data-members-plan="{{product.yearly_price.id}}">Join {{ price currency=@price.currency }}{{price yearly_price.amount}} / year tier</a>
          </span>
        {{/if}}
        {{^if product.monthly_price}}
          {{^if product.yearly_price}}
            <form data-members-form='subscribe' class='signup-box c-subscribe-form'>
              <div>
                <div class='u-alert u-alert--success u-mt-8'>{{t 'Please check your inbox and click the link to confirm your subscription.' }}</div>
                <div class='u-alert u-alert--invalid u-mt-8'>{{t 'Please enter a valid email address!' }}</div>
                <div class='u-alert u-alert--error u-mt-8'>{{t 'An error occurred, please try again later.' }}</div>
                <label for='signin-form-email' class='u-hidden-visually'>{{t 'Your email' }}</label>
                <input type='email' class='c-subscribe-form__input' id='signup-form-email' placeholder='Your email' required data-members-email>
              </div>
              <div>
                <button type='submit' class='c-btn c-btn--action c-btn--small c-subscribe-form__btn'>Subscribe</button>
              </div>
            </form>
          {{/if}}
        {{/if}}
      </div>
    </div>
  {{/foreach}}
</div>

Hi @Stromfeldt!

Check this code:

<div class='c-member-plans'>
  {{#get "tiers" include="monthly_price,yearly_price,benefits" limit="all"}}
  {{#foreach tiers}}
    <div class='c-member-plan'>
      <div class="member-plan__alignment">
        <div>
          <header class='c-member-plan__header'>
            <h3 class='c-member-plan__title'>{{name}}</h3>
            {{#if description}}<div class='c-member-plan__description'>{{description}}</div>{{/if}}
            {{#if monthly_price}}
            <span class='c-member-plan__sign'>{{price currency=currency}}</span><span class='monthly-plan'><strong class='c-member-plan__amount'>{{price monthly_price}}</strong> / {{t 'month'}}</span>
            {{/if}}
            {{#if yearly_price}}
            <span class='c-member-plan__sign'>{{price currency=currency}}</span><span class='annual-plan'><strong class='c-member-plan__amount'>{{price yearly_price}}</strong> / {{t 'year'}}</span>
            {{/if}}
            {{^if monthly_price}}
              {{^if yearly_price}}
                <span class='c-member-plan__sign'>$</span><span><strong class='c-member-plan__amount'>0</strong></span>
              {{/if}}
            {{/if}}
          </header>
          <div class='c-member-plan__content'>
            {{#if benefits}}
              <ul class='c-member-plan__list'>
                {{#foreach benefits as |benefit|}}
                  <li>{{benefit}}</li>
                {{/foreach}}
              </ul>
            {{/if}}
          </div>
        </div>
        {{#if monthly_price}}
          <span class="monthly-plan">
            <a class='c-btn c-btn--action c-btn--small' data-portal="signup/{{id}}/monthly">Join {{price currency=currency}}{{price monthly_price}} / month tier</a>
          </span>
        {{/if}}
        {{#if yearly_price}}
          <span class="annual-plan">
            <a class='c-btn c-btn--action c-btn--small' data-portal="signup/{{id}}/yearly">Join {{price currency=currency}}{{price yearly_price}} / year tier</a>
          </span>
        {{/if}}
        {{^if monthly_price}}
          {{^if yearly_price}}
            <form data-members-form='subscribe' class='signup-box c-subscribe-form'>
              <div>
                <div class='u-alert u-alert--success u-mt-8'>{{t 'Please check your inbox and click the link to confirm your subscription.' }}</div>
                <div class='u-alert u-alert--invalid u-mt-8'>{{t 'Please enter a valid email address!' }}</div>
                <div class='u-alert u-alert--error u-mt-8'>{{t 'An error occurred, please try again later.' }}</div>
                <label for='signin-form-email' class='u-hidden-visually'>{{t 'Your email' }}</label>
                <input type='email' class='c-subscribe-form__input' id='signup-form-email' placeholder='Your email' required data-members-email>
              </div>
              <div>
                <button type='submit' class='c-btn c-btn--action c-btn--small c-subscribe-form__btn'>Subscribe</button>
              </div>
            </form>
          {{/if}}
        {{/if}}
      </div>
    </div>
    {{/foreach}}
  {{/get}}
</div>
2 Likes

Hey @Stromfeldt we discovered this bug in gscan yesterday - it’s not fully checking templates that are nested inside folders. We’re working on a fix for it as fast as we can.

1 Like

Gscan 4.31.0 is out with fixes for this, please test it and let me know if it catches these issues and helps explain how to solve them. An update to Ghost is coming today as well.

Hey @fueko. That’s amazing, thanks so much! I was apparently more than a little off. :sweat_smile:

1 Like

Hey @Hannah, Gscan is now working with this and does now seem to pick up all the issues in the implementation of the tiers signup page:

However, the link at the end of all that results in a 404.

Fixed the link now, thanks.

1 Like