Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meta tile and meta descriptions missing in category object #2074

Closed
Tjitse-E opened this issue Dec 10, 2018 · 6 comments
Closed

Meta tile and meta descriptions missing in category object #2074

Tjitse-E opened this issue Dec 10, 2018 · 6 comments
Assignees

Comments

@Tjitse-E
Copy link
Contributor

Steps to reproduce the issue

  1. Add meta_title and meta_description to local.json in vue-storefront-api:
  "entities": {
    "category": {
      "includeFields": [
        "meta_description",
        "meta_title",
        "children_data",
        "id",
        "children_count",
        "sku",
        "name",
        "is_active",
        "parent_id",
        "level",
        "url_key",
        "description",
        "image"
      ]
    },
  1. Add meta_title and meta_description to local.json in vue-storefront:
    "category": {
      "includeFields": [ "meta_description", "meta_title", "children_data", "id", "children_count", "sku", "name", "is_active", "parent_id", "level", "url_key", "product_count", "p
    },
  1. Rebuild vue-storefront and vue-storefront-api.
  2. Reindex via mage2vuestorefront:
node --harmony cli.js fullreindex
node --harmony cli.js categories --removeNonExistent=true --extendedCategories=true
  1. Clear browser data

Current behavior

Visit a frontend category and check the category computed property. The meta title and description are missing.

banken 2018-12-10 18-05-07

Expected behavior

After adding the (category) meta_title and meta_description these attributes should be available in the category object

Can you handle fixing this bug by yourself?

No, i'm also not sure that this is a bug. Maybe i'm doing something wrong?

Environment details

  • Vue Storefront (API): 1.6
  • Mage2vuestorerfront: master branch.
  • Browser: Chrome Mac v70
  • OS: Ubuntu 16
  • Node: v8.14.0

Additional information

Related issue: #1383

@pkarw
Copy link
Collaborator

pkarw commented Dec 10, 2018

Currently the Magento meta_* fields are not used (we do generate meta from description and title fields) in Category.js (either in Product.js) but I belive this can Ben easily fixed - @patzick can you take a look at it?

@Tjitse-E
Copy link
Contributor Author

@pkarw but what about the steps that I took to add an attribute to the category object, are they correct? Because i've also tried this with non meta attributes like description and image, and it also didn't work.

@pkarw
Copy link
Collaborator

pkarw commented Dec 11, 2018

@Tjitse-E do You have these fields filled correctly in Elastic? If so, then after adding them to category.includeFields should do the job (You need to restart the vue-storefront app after changing the config)

@Tjitse-E
Copy link
Contributor Author

@pkarw i've checked with Kibana, and I've noticed that some of the categories indeed have meta_title and meta_description fields now, and they are also available in the category object. However, this isn't the case for all the categories, in some categories the data is still missing. Maybe I will have to completely destroy and rebuild the elastic indexes? What would be the best way to do this?

@patzick patzick assigned qiqqq and unassigned patzick Jan 10, 2019
@qiqqq
Copy link
Collaborator

qiqqq commented Jan 10, 2019

@Tjitse-E I checked this issue and in my opinion passing data from elasticsearch to VS store works ok. I added some meta_title and meta_description fields to categories and products and this shows in vuex and in computed properties eg: https://prnt.sc/m5ez7l

Steps that you did are ok and this should works so in my opinion there is something wrong with elasticsearch indexes but I havn't knowled to help with ES.

@qiqqq
Copy link
Collaborator

qiqqq commented Jan 11, 2019

I changed the generation of title and description meta tags. Now this tags will be generated based on meta_title and meta_description fields if this fields occurs.

#2158

@pkarw pkarw closed this as completed Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants