Making changes to woocommerce order before save

A popular method is to hook to the order status. You have several status names to choose from: completed processing cancelled on-hold You would use it like this: add_action(‘woocommerce_order_status_processing’ In addition you can intercept a certain change like this: add_action(‘woocommerce_order_status_on-hold_to_completed’ Finally you can intercept any change that takes place like this: add_action(‘woocommerce_order_status_changed’

WooCommerce – Print Processing orders [closed]

Here’s the solution: Remove the SKU table header Add (SKU) to the Product header Product (SKU) pass false, true in email_order_items_table function $order->email_order_items_table(false, true) This is not the visual result you were expecting, but it works and it shows the SKU. The second parameter in email_order_items_table indicates whether to show the SKU or not.

Not getting result using ajax on wordpress

Its looks like you are not printing the admin ajax URL. add_action(‘wp_head’, ‘my_action_javascript’); function my_action_javascript() { ?> <script type=”text/javascript” > jQuery(document).ready(function($) { var ajaxurl = “<?php echo admin_url(‘admin-ajax.php’); ?>”; $(‘.myajax’).click(function(){ var data = { action: ‘my_action’, whatever: 1234 }; // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php $.post(ajaxurl, … Read more

Testimonials/Reviews for Products

The most frequent approach would be to create a new “review” or “testimonial” Custom Post Type (“CPT”) with a plugin or in your theme‘s functions.php file (or a new child theme‘s functons.php file, if your current theme is not custom-built), and then alter your product page template to use a secondary loop to display your … Read more

How to add a menu page for options in wordpress for user that has the role of vendor?

The third argument to add_menu_page() is $capability. add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position ); That governs who can see the page. You’ve registered yours as “administrator”, which is a user role. Presumably your vendors are not of that role. To fix this, you will need to change that argument to a capability (preferably … Read more