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_connections
gets called in theCollections
class 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_schema
in theQueries
class.Can you please update the
get_collections
object to pass through thecustom_schema
to 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.