If you look for all products with same ‘product_cip’ value try this:
$a=array( 'post_type' => 'product', 'post_status' => 'publish', 'posts_per_page' => - 1, 'meta_query' => array( array( 'key' => 'product_cip', 'value' => 'some value', 'compare'=> '=' ) ), 'fields' => 'ids' ); $b=get_posts($a); echo count($b);
if you have get all products data
$products_array=array(); foreach($b as $v){ $_product=wc_get_product($v); echo $_product->get_name().','; $products_array[]=$_product; }
Related Posts:
- How to access custom order item meta data from a meta key in WooCommerce?
- Save Custom Fields for Variations Product
- Adding existing user custom field value to a woocommerce product [closed]
- Adding Custom Text Area to WooCommerce Product
- WooCommerce conditional required checkout fields [closed]
- Include woocommerce custom field value in front-end search result
- woocommerce product custom field
- Conditionally hide or show woocommerce product variation in fontend by custom field
- Woocommerce: Custom fields and email shortcodes, ec_custom_field
- Bulk remove post meta
- How to create html block to display extra information on woocommerce single product page
- Display WP-Types custom fields in post [closed]
- Modifying custom order item meta from admin order view
- How to create a dropdown select of all items in an ACF field group
- How do I add an image upload, custom field to a WooCommerce product?
- WooCommerce – Adding Custom Fields To Invoice
- Woocommerce Product Custom Select List (not variation)
- jQuery – Automatic event trigger does not **really** check my form
- How to add new field to the account address?
- How to display custom field in woocommerce email orders? [closed]
- Woocommerce Retrieving custom field value from orders
- Update custom field values on edit address page woocommerce
- Woocommerce frontend edit custom fields
- Is it possible to add Term Meta Fields to a WooCommerce Attribute?
- Why does my numeric meta query work only on one meta key and not the other?
- Update custom field on the fly
- (woocommerce) How to get product id form order id & then retrieve custom meta linked to product?
- How to delete WooCommerce Products than have a specific custom field?
- WooCommerce 3 get custom variation on process order [closed]
- How to save array option as text and not integer?
- Use a different catalog image than the featured image
- Check if value exists before saving
- Add Custom field under the post title [closed]
- woocommerce how in checkout to add my custom field check box, and when i check it hide the shipping adress and add tax 19% [closed]
- price calculation from custom field (woocommerce) [closed]
- Hiding custom fields when content is empty [closed]
- Cannot save values to custom fields for variations on Woocommerce 2.4.6
- Send checkout page custom field in order email
- Extract array from custom field
- Assign class to Drop Down Selections in WooCommerce Products Custom Fields
- Is there a way to set default custom fields when creating a post?
- Underscores in custom fields
- Add custom field to the archive page?
- Show only posts which can be commented OR have custom meta field
- Need small coding with Custom Fields Search
- get_post_meta() unserialize issue – returns boolean(false)
- How can I remove fields in the attachment editor?
- Edit Custom Database Tables in WordPress
- How to store the value of a custom field dropdown select for post referencing?
- Change content before writing to database
- post meta data clearing on autosave
- WordPress Search Custom Meta Field Only
- Query Problem – Show posts within category ‘x’ that have a custom field between ‘y’ and ‘z’
- Add description text under input field for new profile fields
- Which is best in the following scenario : post_meta vs custom table vs parent/child posts
- Echo values from custom field outside loop php
- How to add content at the end of posts?
- Using a checklist to search against metadata
- Where did the Add New Custom Field go?
- Will loading too many ACF Fields cause slow down?
- Admin meta Image Path
- Extra option in editor
- Custom field not updating when value is empty
- Can’t get metabox value (a url) returned using WPAlchemy
- Syntax highligting for custom fields
- Displaying a checkbox array from advanced custom field
- Display custom field values from posts on frontpage
- Getting Custom Fields from WordPress JSON API [closed]
- Shortcode To Display Post Custom Field Value in Post Title, Post Content
- How to make a customized user registration form using the built in wp-register() template tag
- Link FROM attachment to full post and get custom fields values on attachment page?
- Getting the Featured image URL and inserting it as Custom Field on Post update / publish
- How to copy data from a custom field to the post_content?
- Pass PHP through redirect and custom fields
- How can I create a profile field group that the user can’t see?
- Custom field as featured image caption
- Is there a (sane) way to get all custom fields for a post, which do not have a leading underscore?
- Dynamically added custom fields not displayed on WooCommerce email notifications
- Rewrite comment form post ID on submit
- Add a custom field to my custom post type and then get posts which are before the given date in the custom field
- Custom User Dashboard
- Custom Fields not working properly
- Custom meta POST request fired twice when updating a post in Gutenberg
- add meta box considers the selected option as post parent
- How do I display a custom field in an existing form on the front end?
- Extend WP_User_Query or WP_User to return all custom fields?
- Quicktag button to automatically add a custom field to a post
- Display custom fields only if it has a value
- WordPress taxonomy child image
- Create custom fields/meta data gender+country – radiobuttons and dropdown on register screen for these fields
- Add nofollow to custom field link and make domain exceptions?
- wordpress simple post multi rating with post_meta and user_meta
- Custom fields are not displaying in page with multiple loops
- Download stuff after filling fields?
- Adding custom field to Lightbox in header only pulls current page data, not Lightbox item data
- Custom registration form and custom field
- Need help saving input fields for Security Deposit plugin in WC Vendors page
- How can i put a custom field inside this php
- How to apply Local Business Google Schema dynamically on a Custom Post single template?
- Match submitted array fields with the MYSQL database fields to update them correctly in PHP