How can I add only related products?

Remove the action from it’s hook, then add it to a different hook (corresponding to where you’d like it to display). You can view the available hooks by viewing the WooCommerce single-product.php and content-single-product.php template files. Just like it all of WordPress anywhere there is a do_action( ‘some_hook_name’ ) that signifies an action hook that … Read more

Woo Commerce filter

This is my solution. I have found that this function (woocommerce_order_status_completed) is for when you made a payment or when you give completed status. woocommerce_order_status_completed{ function check_quantity($order_id) { global $wpdb; $order = new WC_Order( $order_id ); $items = $order->get_items(); foreach ( $items as $item ) { $product_name = $item[‘name’]; $product_id = $item[‘product_id’]; $product_variation_id = $item[‘variation_id’]; … Read more

Display products based on sub-categories

you can register a new widget with your custom loop like this <?php add_action( ‘widgets_init’, ‘Miy_widget_box’ );?> <?php function Miy_widget_box() { register_widget( ‘Miy_Widget’ ); }?> <?php class Miy_Widget extends WP_Widget { public function __construct() { // widget actual processes parent::WP_Widget(false,’Title Widget’,’description=Description Widget’); } public function form( $instance ) { // outputs the options form on … Read more

WordPress In Menu

You can adjust what items are shown in the menu via the wp_get_nav_menu_items. This is the same filter that I am using in my Nav Menu Roles plugin. Adapting from that, we can loop through the menu items, and check if any of them are links to the “checkout” page. From there we can test … Read more

WooCommerce Email Customization

Try filtering the output of that function to remove that column, or set it to an empty string. e.g. function wpse_120798_item_totals($total_rows, $order) { foreach ($total_rows as &$row) { unset($row[‘value’]); // or: $row[‘value’] = ”; } return $total_rows; } add_action(‘woocommerce_email_before_order_table’, function() { add_filter(‘woocommerce_get_order_item_totals’, ‘wpse_120798_item_totals’); }); add_action(‘woocommerce_email_after_order_table’, function() { remove_filter(‘woocommerce_get_order_item_totals’, ‘wpse_120798_item_totals’); });

How we add tabs in plugin page

If you are looking to add tabs in admin page then you can try doing this: <h3 class=”nav-tab-wrapper”> <a class=”nav-tab nav-tab-active” href=”#”>Test1</a> <a class=”nav-tab” href=”#”>Test2</a> <a class=”nav-tab” href=”#”>Test3</a> <a class=”nav-tab” href=”#”>Test4</a> <a class=”nav-tab” href=”#”>Test5</a> <a class=”nav-tab” href=”#”>Test6</a> </h3> this will give you native look and feel