You can use woocommerce_shortcode_products_query
filter to change orderby
argument. it will set orderby
as post__in
in [products]
shortcode query. I have tested and it is working fine for me. you can take reference from below code and adjust code as per your need. Let me know if this works for you!
add_filter( 'woocommerce_shortcode_products_query', 'woocommerce_shortcode_products_orderby_post_in' );
function woocommerce_shortcode_products_orderby_post_in( $args ) {
if( isset( $args['orderby'] ) ) {
$args['orderby'] = 'post__in';
}
return $args;
}
Related Posts:
- How can I define a custom template for woocommerce [products] shortcode? [closed]
- Shortcode with product catgory counter
- wc_get_product in a none woocommerce page
- WooCommerce Multi-Currency shortcode not working
- shortcode to display woocommerce cart total
- Products Shortcode is Displaying Single Product Page Price for all Products [closed]
- Woocommerce Shortcode custom orderby not working
- Override static method in WC_Shortcodes class (shortcode) [closed]
- Unable to pull in custom product attribute in shortcode [closed]
- Adding author option to [products] woocommerce shortcode
- Pass class to Woocommerce shortcode [relative_products] [closed]
- Create a shortcode for native WooCommerce search form [closed]
- How can i access woocommerce order variables inside shortcode?
- porto theme pagination on woocommerce not working
- I want to show always 4 category boxes everytime in woocommerce
- How to use products shortcode in taxonomy-product_cat with multiple columns?
- Why isn’t working WooCommerce session inside shortcode?
- Shortcodes in billing fields doesn’t work
- woocommerce Shortcodes – Change display between mobile and Desktop
- How to check which shortcode is using my template?
- If YITH Wishlist page is set to the WooCommerce my-account endpoint, the endpoints stop working all together. Any solution?
- Creating a shortcode with a variable (Woocommerce)?
- Trying to insert a div ID link into Woocommerce shortcode Pagination
- how should i get products based on tags in woocommerce
- Order by rating not works in wp_query
- Woocommerce: show default variation price is products list?
- Woocommerce checkout fields on the same line
- display available size on hover, in woocommerce shop page [closed]
- How to Add Product Variation with Multiple Images via WooCommerce REST API
- WooCommerce: Email Notifications
- How do you add custom metadata to WooCommerce orders? Specifically a second external order ID
- WooCommerce: Adding Order Item Meta Data That’s Hidden
- Redirect user after login through woocommerce login page to page with his/her username?
- WooCommerce restore stock on order cancel
- WordPress select field – show current value?
- Get the category ID in checkout page woocomerce
- Arranging Product Details on Shop Page
- WooCommerce product taxonomies and menu export
- Javascript / Ajax Error After Migrating To New Domain Name
- How can i stop woocommerce checkout event based on api request result?
- WordPress Twenty Seventeen header image size not responsive for mobile
- WooCommerce back-end very slow takes 10 seconds to load, slow queries
- Checkout form looks terrible [closed]
- How to upload multiple image using wp_insert_post
- How can i manage total price in checkout page? [closed]
- In WooCommerce product archive, how can you also set the quantity to be added to cart by typing, instead of just by using +/-?
- WooCommerce product category permalinks
- How to do string attachment with wp_mail
- Can’t show most recent comment on top with wp_list_comments() for WooCommerce reviews
- WooCommerce order complete email logic
- WooCommerce Displaying Price With & Without TAX [closed]
- Filtering variable WooCommerce products by stock level using meta_query
- WooCommerce which roles and capabilities control user login re-direct to Woo Account Page?
- how do i remove a woo-commerce widget?
- How can I convert woocommerce checkout fields in capital letters
- main menu hide woo commerce single products tittle
- Conditional action hook
- Sending Email upon registration
- Order by date on category dynamically – Woocommerce
- Woocomnerce Limit Purchase value before proceed checkout
- Add to cart – button should be disabled
- How To Customize The Product Page Template for a WooCommerce Custom Product Type Plugin [closed]
- Hide Add to Cart button on woocommerce Product description page of a particular product
- wp_set_object_terms setting only first id from array
- I need to export all products and images but I don’t know which table the images are in
- Add only sku to product url woocoomerce
- What is better way to sync wp multisite woocommerce products
- Remove required from a custom field created from WooCommerce Checkout Field Editor plugin
- How to change status of woocommerce orders when post status is changed
- manage_shop_order_posts_custom_column() hook is Not working In Functions.php file in my WordPress active theme
- How to send woocommerce emails in multiple languages
- Displaying Woocommerce Product Attributes on single product page
- WooCommerce – Child Category wont show, but Parent does
- How to hide a random text with a div tag using a class on product pages with a specific tag
- Missing variable options on add to cart form
- Woocommerce digital download not working – database error Cannot add or update a child row: a foreign key constraint fails [closed]
- when product out of stock single page show button notify woo-commerce
- WooCommerce , Auto cancel orders status from processing after X days
- Change WooCommerce Word “Product” to Another Word
- Recently viewed products – Order by viewed
- How can i add product Accessories from front-end using custom php form?
- How to save order item custom attributes save into custom table
- Manually create an order with a product ID woocommerce
- WooCommerce subscriptions give option of manual renewal on checkout [closed]
- Change order status after checkout
- Is it safe to update an old site after backing it up and activating a child theme?
- How to add coupon expiry date into the followup emails?
- Disable Woocommerce main shop page, but not the product category archive pages
- access Woo commerce | WordPress methods externally
- How to store ACF from product in user_meta?
- Woocommerce set single city to sell to
- Trying to link to a custom css file in a new folder
- How to not show shortcode contents if cart is empty?
- How do I make a diagonal strikethrough on wordpress? [closed]
- Woocommerce – Remove ‘Buy Product’ Button from shop page [closed]
- Add woocommerce.css in template?
- How to dublicate WC Product title to shortdescription field? [closed]
- Add Additional 3 buttons next to “Add to cart” button in woocommerce product page
- Woocommerce product and category in url [closed]
- Display product categories + child-categories on a single product page