• Resolved wooken

    (@wooken)


    Greetings,

    To get a specific product info, I use `<?php print_r($woocommerce->get(‘products/794’)); ?>
    `, but the info doesn’t include vendor name or id. How can I also get vendor info when I get a product info ?

    * I’m using WC Vendors Marketplace plugin to add vendors to WC.

    Thanks in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Mark Kevin

    (@mkesteban08)

    Hi Wooken,

    You can fetch the vendor name and shop description by using this:

    <h1><?php echo $shop_name; ?></h1>
    <div class=”wcv_shop_description”>
    <?php echo $shop_description; ?>
    </div>

    I hope that this could help, please don’t hesitate to let me know if you need further assistance with this.

    Thread Starter wooken

    (@wooken)

    @mkesteban08

    Hi,

    Where should I use the code you suggested ? those 2 variables are not defined in WC api, and no way I can get vendor info when I get a product info using WC api this way.

    Hello @wooken ,

    Please could you provide us a copy of the code snippet and the file that you are editing so that we can better understand your query? You can use something like – https://pastebin.com/ or github to share the code and file with us.

    Hi @wooken

    To get the vendor_id you’d need to get the underlying posts post_author as the post_author is not accessible in the WooCommerce API.

    cheers,

    Jamie.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Including vendor info while getting product info via WC API’ is closed to new replies.