-
-
Save loughlincodes/0f98ace464acd1f47cd887b5c7c31158 to your computer and use it in GitHub Desktop.
<div class="reviews"> | |
{% assign looxstats = shop.metafields.loox["global_stats"] | split: "," %} | |
{% assign looxstar = looxstats[0] | round %} | |
{% assign looxcount = looxstats[1] | times:100 | money_without_currency | remove: '.00' %} | |
<a href="pages/happy-customers">Reviews (<span class="looxstars">{% for i in (1..looxstar) %}★{% endfor %}</span> {{ looxcount }})</a> | |
</div> <!-- end review --> |
Ah, as the metafield is created by the Loox app it must be setting the metafield to private on creation which means it can't be accessed via the storefront API directly.
In a store that has Loox installed, you can see the product level metafields in the admin and these are defaulted to being hidden from the storefront API:
You may be able to edit the shop.metafields.loox.global_stats storefront API visibility using this GraphQL mutation:
https://shopify.dev/docs/api/admin-graphql/2023-10/objects/metafieldstorefrontvisibility
As a last straw, you could contact Loox support - I have found them to be very responsive and interested in use-cases they hadn't considered before. They might be able to set that loox.global_stats to be accessible via the storefront API for you. Worth a shot if the above doesn't help.
No probs! Best of luck 🤞
Uh oh!
There was an error while loading. Please reload this page.