Pass Product Variation Ids in WP Post Object

  • 8 months, 1 week ago #35274

    Hi, I would like to get the product variations ids in the wp post object, Is there any code to do so.. or any file from where these data is being added to post object.

    In this custom key, the data is available , almost all fields being sent to solr are available, except variation ids.
    Image image.png of Pass Product Variation Ids in WP Post Object

    wpsolr
    Keymaster
    8 months, 1 week ago #35276

    WP_Post objects are returned to your theme, in the standard post loop. From there, your custom search.php file can retrieve anything from the WP_Post.

    8 months, 1 week ago #35289

    I was just checking if we get the variation ids, without extra code as extra code would take some time to fetch

    wpsolr
    Keymaster
    8 months, 1 week ago #35295

    It would require lots of steps, to index your ids and retrieve them from the queries.

    You can get inspiration from /plugins/wpsolr-pro/wpsolr-pro/wpsolr/pro/extensions/geolocation/class-wpsolr-option-geolocation.php, where lat,long data is added to the index and ‘distance’ is retrieved from queries.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.