Open your theme’s function.php and add following
add_action( 'woocommerce_shortcode_before_products_loop', 'roka_before_products_shortcode_loop', 1, 10 );
add_action( 'woocommerce_shortcode_after_products_loop', 'roka_after_products_shortcode_loop', 0, 10 );
function roka_before_products_shortcode_loop( $atts ) {
$GLOBALS[ 'roka_woocommerce_loop_template' ] =
( isset( $atts[ 'class' ] ) ? $atts[ 'class' ] : '' );
}
function roka_after_products_shortcode_loop( $atts ) {
$GLOBALS[ 'roka_woocommerce_loop_template' ] = '';
}
Then override the file content-product.php
by copying it to your theme’s woocommerce
folder.
find the line <li <?php post_class(); ?>>
and add following after that:
<?php
if(
isset( $GLOBALS[ 'roka_woocommerce_loop_template' ] ) &&
$GLOBALS[ 'roka_woocommerce_loop_template' ] == 'simple-list'
) {
echo '<a href="' . get_the_permalink() . '">' . get_the_title() . '</a>';
return;
}
?>
Related Posts:
- 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]
- How can I custom order the product display?
- 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
- WooCommerce: Can’t use wc_get_products for custom REST API endpoints
- Menu not show woocommerce product category
- Orders being sent to wrong admin email in WooCommerce [closed]
- WooCommerce: add different order item meta for each item in order
- What is the right hook to use in WooCommerce for handling the post of the sale price?
- Add Additional “Checkout” button next to “Add to cart” button in woocommerce product page
- Woocommerce: Remove variant options from admin new order email
- WP WPQuery, not running properly in WP CLI
- How to get all products from an order including variations via SQL query?
- What is the action hook for an order that fails on frontend checkout in WooCommerce?
- Woocommerce change tax rate programmaticly
- Filter get_adjacent_post to follow woocommerce product category
- Run function on “Place Order” [closed]
- Get the cart details from the order id in woocommerce?
- Hiding products with a specific tag from WooCommerce main shop page
- Woocommerce Customs Endpoint
- Woocommerce add payment method outside of checkout and my account
- Changing the Woocommerce breadcrumb menu [closed]
- How to detect if this post is a woocommerce product?
- Set a custom field to all orders
- Force User Registration before visitng Checkout Page
- Complex price options. Am I stuck with 180 variations?
- Position image widget in mega menu
- short description in shop page after title
- Allow WooCommerce existing customers to checkout without being logged in [closed]
- WooCommerce Cart URL bug
- WP_Error on attribute + term insert
- change woocommerce product statut (draft ->publish // publish->draft) depends on the month [closed]
- How to add taxonomy term under the thumbnail on woocommerce product page
- How to overwrite price html in woocommerce single product page
- woocommerce breadcrumbs in theme [closed]
- Convert WordPress Woocomerce product to WordPress post
- How to set the meta description of a WooCommerce product as its primary category description?
- How to change woocommerce checkout privacy policy, terms and condition text [closed]
- Woocommerce Email show HTML source code [closed]
- add to cart button not adding products in cart only in safari and edge browser [closed]
- WC Lightbox, Zoom and Slider not loading [closed]
- Woocomerce pulling wrong time from server -5 hrs difference
- How to use Custom Field to display product brief description in shop page with Woocommerce?
- What happens in the database when you link variations in woocommerce? [closed]
- Display custom product option in admin order details
- remove sale price after finished countdown in woocommerce
- Woocommerce. How can I charge a fee from seller
- How to update permalink programmatically?
- How to use decimal in quantity fields in WooCommerce for certain categories?
- Getting WordPress fatal error when hitting WooCommerce API
- Display shipping class in single product page woocommerce
- Is it ok to 301 redirect product-category pages to custom pages?
- how i can limit woo Category number like as ‘posts_per_page’ => -1, but it cannot work please help me
- Update a list of product to featured if product have meta value (Mysql not wpquery)
- Woocommerce – Add custom email footer to specific email template
- WooCommerce related product – only show from primary category
- Woocommerce: Variable Product – get variation name
- Forgot password flow does not work, getting email with a link but after clicking link it’s not working
- Html code is not showing in woocommerce shop page on adding in header.php?
- Is this code collecting user password?
- WordPress Migration
- some products free and some product is not free for shipping
- Importing Attributes in to Woocommerce
- woocomerce products and categories don’t display fixed
- Save Woocomerce discount as percentage to database
- Woocommerce Shipping based on condition and cart value
- Update order status based on condition
- How to bypass Woocommerce checkout validation from the plugin? [closed]
- Category with description and thumbnail
- Woocommerce – Remove ‘Buy Product’ Button + Make Product Thumbnails Clickable
- Issue with Woocommerce and extra field in orders data
- Give auto discount to upsells products
- WooCommerce Table Rates not splitting up
- How can I let the user choose size of a shoe in the store? [closed]
- Hide/show specific products for backend users in woocommerce
- I’d like to add a button under the “Add to Cart” button which says “Buy on Amazon” and links to my Amazon product page [closed]
- WooCommerce pay per photo upload [closed]
- Woocommerce checkout column total too small can not get it wider [closed]
- Woocommerce | I want to the button ‘Add to Cart’ on the (all) product-page changed by just ‘open product’ button
- Adding line breaks in WooCommerce order processing emails