Get Products within Current Product Category

You said you are able to get current product category name, store it in $current_product_category variable now try this code .. <ul class=”products”> <?php $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => 1, ‘product_cat’ => $current_product_category, ‘orderby’ => ‘rand’ ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); global $product; ?> … Read more

WordPress Customise

The interstitial page on that website isn’t part of WordPress. It’s just an external page with some ads and a download link on it. You can easily do this by yourself. Create a php file named download.php on your server and add the following code to it: <html> <head> <meta http-equiv=”refresh” content=”5; url=<?php $_GET[‘url’];?>” /></head> … Read more

Custom booking form field not saving

You have to save them somewhere like in the em_meta table or in the booking_meta field of the booking table (stored as a serialized array, so add to it, don’t replace it) and bring it up elsewhere. If you read the tutorials, you could quite easily add extra fields etc. http://wp-events-plugin.com/tutorials/ and this may help … Read more

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’); });