PHP Render Functions – get_collections() – schema not being passed through
-
We are using the
get_collections()function to return collections on the fly. This is mainly to get metafield data via the API for each collectionDocumentation: https://docs.wpshop.io/php-functions#get_collections
The issue we’re having is that the schema parameter does not get passed through to the GraphQL query that ShopWP makes to Shopify.When
get_connectionsgets called in theCollectionsclass it makes a call to:
$result = $this->Storefront_Collections->api_get_collections($final_params, false, $with_products, $query_params_products);
As you can see, the second parameter is set tofalse. This means that the schema never gets to the final GraphQL layer Instead it uses the defaultcollection_schemain theQueriesclass.Can you please update the
get_collectionsobject to pass through thecustom_schemato the subsequent functions so we can return the data we need from collections.Cheers,
Nathan
The topic ‘PHP Render Functions – get_collections() – schema not being passed through’ is closed to new replies.