There’s a class WC_Product_Vendors_Utils
that you can use e.g.
$vendor = WC_Product_Vendors_Utils::is_vendor_product( $item["product_vendors_product_id"] ); //replace this with the product ID
if ( ! empty( $vendor[0] ) ) {
$vendor_data = WC_Product_Vendors_Utils::get_vendor_data_by_id( $vendor[0]->term_id );
if ( ! empty( $vendor_data ) ) {
$vendor_slug = $vendor_data['slug']; // I am not sure of the correct value here but you can var_dump() just to make sure
}
}
Hope that will help you start generating the SKU properly 🙂
Related Posts:
- Woocommerce override mini-cart.php not working [closed]
- WP WC CLI – WooCommerce setup store with wp-cli [closed]
- WooCommerce Always Include Shipping Information in Checkout [closed]
- Add Products to user’s ID Woocommerce
- Woocommerce different URL for every table placed in the restaurant
- Disable Admin Bar Render on Plugin Page
- How to add product images using script?
- Woocommerce cart is a non-object inside `admin_post` action [closed]
- $woocommerce->cart is null inside WordPress Rest API
- Woocommerce custom shared taxonomy
- Invalid shipping method, WooCommerce [closed]
- Automatically adding category filter based on search string
- Woocommerce sidebar not loading in theme
- Make specific products accessible only to a user role in WooCommerce
- How to edit Image layout in single product page in woocommerce on wordpress?
- Woocommerce – Display active variation product price [closed]
- Need Old Version of plugins
- Serve different files depending on OS/Browser
- Dropdown menu on custom page with product to choose number of products per page
- Change the method of a class from child function.php
- How to send an automated email to the customers when product is added woocommerce
- Modifying a .js Function for Print [QZ Tray, WooCommerce POS]
- woocommerce product countdown not showing in variable product? [closed]
- Woocommerce Deposit, then random payments until product paid in full [closed]
- custom payment gateway in woocommerce failed to connect to remote api server
- Replacing a plugin function with a custom renamed function doesn’t work
- Multiple Billing forms in WooCommerce (one billing form per product)
- Want to Show Sub categories under Categories section using Woo Commerce [closed]
- PHP Error When a plugin is active
- Woocommerce Coupon Menu and Marketing Menu missing After “Coupons can now be managed from Marketing > Coupons.” [closed]
- WooCommerce: Force coupon for existing/registered customers [closed]
- Add_rewrite_endpoint doesn’t work with post name permalink structure
- How can I concatenate variables to search results title? [closed]
- Add a “View all” button on WooCommerce product archives pages
- I am trying to make a field show and save from quickedit screen
- woocommerce search by sku and title ajax
- Cross Sells are not being shown in Cart Page. Please Help!
- How to display registered customer list as dropdown in WooCommerce checkout?
- Sending customer an email with link to stripe to make payment
- Disable variations on woo commerce if out of stock
- Woocommerce – Change Variable Product Add to Cart to behave like external product using Custom Field (link) [closed]
- Make 2 different WooCommerce checkout pages?
- Edit all $wp_scripts at once to $in_footer = false
- WordPress – Ultimate Auction for WooCommerce
- Working on a product group in wordpress, where user choose how many children, wife and husband
- Sold out Label for variable products which are partially sold out
- How to add custom plugin data to the cart in woocommerce using custom button on product page?
- Create category for each user
- Translations not appended even strings are edited
- How to get brand children with woocommerce brands
- Show prices with tax Inclusive in Minicart widget
- How to add a PW Gift Card to a Woocommerce Order request API?
- How can I send the mail once?
- Make downloadable ebook read online without download option
- WPForms Custom Redirect not working
- Configure upload folder on WoComerce
- WordPress to be used more like an app?
- Make the product page as homepage WooCommerce
- Woocommerce convert simple products to variations
- BS Authorize.net Problem (Payment in hanging if customers is not logged in)
- Easiest way to load/fire a handful of functions, IF checkbox is checked?
- Getting all woocommerce products from REST API call in plugin
- WooCommerce Product Table – filter query on attributes
- Disable WC Bookings automatic order completion [closed]
- Problem Advanced Custom Fields PRO
- my hook or my function wont run in the cronjob
- Programmatically generate new pages for a site based on page template and content elements accessed via DB
- Display Woocommerce attribute name above product title
- In woocommerce, is there any way to empty wordpress default mini cart when order placed?
- In woocommerce, is it possible to make payment of one customer order by another customer?
- Get a list of Product Categories inside a loop
- Woocommerce budget search
- Coupon Codes for product discount combined with conditional free shipping
- Custom product page’s style for printing
- wc_get_product_terms() throws “Notice: Undefined offset: 0”
- Woocommerce list variations that are added already to cart in Single Product
- {status}_{post_type} does not run correctly?
- Woocommerce categories displayed on every category and shopping page
- 504 Timeout gateway when trying to pay for an order in Woocommerce. What else can I do?
- woocommerce product search based only title
- Need woocommerce function for getting cart list with items
- WPNeo Stripe connect does not work
- Widget logic using woocommerce product category
- WordPress Theme Conflict With Plugin
- How to Save settings of custom tab product page in admin side in a database?
- Holding 2 wp_user in the same action (to update billing_email when user_email is updated)
- Sort Reviews/Ratings by date on Woocommerce
- How to execute init or woocommerce_init only for checkout page
- How to add plus minus button on Input Quantity box Woocommerce? [closed]
- Woocommerce resize existing product images
- How to add a text in the checkout page woocomerce?
- Shortcode inside a redirect [closed]
- ‘Active lotteries’ only custom query for woocommerce lottery plugin and elementor
- I want to set a different banner for each product in the woocommerce plugin on my wordpress site
- Template selector for woocommerce product
- How to add product thumbnail on orders list on backend?
- I want create woocommerec match products columns
- Free multi dealer rental cars (sign up) [closed]
- Convert from Portfolio post to WooCommerce products [closed]
- Per-Day booking with customer-supplied start time using Woocommerce Bookings