Parissa Kalaee
Parissa Kalaee

Reputation: 638

Google Wallet Generic Class (two-item row is not shown)

I followed the codelab for adding a new card to google wallet (of course I used the business profile of the company and the issuer id was not temporary).

As one of steps, I added one row with two items, in generic_class.js,but it is not shown in the final generated card

'classTemplateInfo': {
'cardTemplateOverride': {
  'cardRowTemplateInfos': [
    {
      'twoItems': {
        'startItem': {
          'firstValue': {
            'fields': [
              {
                'fieldPath': 'object.textModulesData["company"]',
              },
            ],
          },
        },
        'endItem': {
          'firstValue': {
            'fields': [
              {
                'fieldPath': 'object.textModulesData["badgeId"]',
              },
            ],
          },
        },
      },
    },
  ],
}

(of course, if I click on details, they are shown in the bottom, outside of the card).

enter image description here

Then I noticed that the final card of the codelab is also without the row!

enter image description here

So I want to add two or three rows to my generic_class like the pass builder, any idea? enter image description here

I searched the web and asked wallet support team, no answer yet.

Upvotes: 0

Views: 2059

Answers (5)

Condrea David Emanuel
Condrea David Emanuel

Reputation: 111

I had a similar problem, on generic template the rows were not visible on the card itself, but they were visible in the details section.

And it was due to the class id suffix, and object id suffix, those have to be different all the times (if you do create them, as I was doing using CreateJWTNewObjects). It shows you the card with that old id, and I was seeing the row are not visible.

Also if you want to show hide the details section of the card, you have to add DetailsTemplateOverride

Upvotes: 0

Parissa Kalaee
Parissa Kalaee

Reputation: 638

OMG, I found the solution! I wrongly updated the class :-| It should be like this:

  updatedClass['classTemplateInfo'] = {
    "cardTemplateOverride": {
      "cardRowTemplateInfos": [
        {
          "twoItems": {
            "startItem": {
              "firstValue": {
                "fields": [
                  {
                    "fieldPath": "object.textModulesData['company']"
                  }
                ]
              }
            },
            "endItem": {
              "firstValue": {
                "fields": [
                  {
                    "fieldPath": "object.textModulesData['badgeId']"
                  }
                ]
              }
            }
          }
        }
      ]
    }

};

I had written an extra 'classTemplateInfo': { under the updatedClass['classTemplateInfo'] = { and that's why it didn't work!

the final result of the Card with row!

Upvotes: 2

MaximChemist
MaximChemist

Reputation: 11

The support service helped solve a similar problem. You need to replace 'object.textModulesData["company"]' with "object.textModulesData['company']"

Upvotes: 1

amuramoto
amuramoto

Reputation: 2848

It appears you are missing a closing curly brace on your class object

Upvotes: 0

MaximChemist
MaximChemist

Reputation: 11

I encountered the same problem while completing the manual enter link description here. However, in my case, detailed information was not displayed either. Displaying detailed information was achieved only by default after removing the detailsTemplateOverride field from the class description. It was not possible to achieve correct display of information on the front side.

Upvotes: 0

Related Questions