add_filter not works in ajax
add_filter not works in ajax
add_filter not works in ajax
Woocommerce Order Reports MYSQL
The solution is old as time is. And it was already described earlier. Place in functions.php class iWC_Orderby_Stock_Status { public function __construct() { // Check if WooCommerce is active if (in_array(‘woocommerce/woocommerce.php’, apply_filters(‘active_plugins’, get_option(‘active_plugins’)))) { add_filter(‘posts_clauses’, array($this, ‘order_by_stock_status’), 2000); } } public function order_by_stock_status($posts_clauses) { global $wpdb; // only change query on WooCommerce loops if (is_woocommerce() … Read more
In your coupon_lines array, each item in the array needs 2 properties: code (the coupon code itself) and amount, which is either a flat fee (eg 50.00 off) or a discount (eg 10% off). Your structure ends up looking like: “coupon_lines”: [ { “code”: “MYCODE1”, “amount”: “10.00” }, { “code”: “MYCODE2”, “amount”: “25.00” } ] … Read more
This seems to be a common bug likely caused by the WC update. To solve the issue the best solution currently seems to be use the filter “woocommerce_shipping_package_name” function custom_shipping_package_name( $name ) { return ‘Frakt’; } add_filter( ‘woocommerce_shipping_package_name’, ‘custom_shipping_package_name’ );
You can load the WP environment in order to verify the user’s login. Have a look at these previous answers: https://stackoverflow.com/questions/15304926/how-to-include-wordpress-functions-in-custom-php-file https://stackoverflow.com/questions/47251705/load-wordpress-page-content-from-external-php Include WP_Query in my own PHP file? You might also find it helpful to add define(‘WP_USE_THEMES’, false); to stop WP from loading the theme, etc, if it’s not needed in your php script.
I have found a solution: // 2. Display T&C @ Single Order Page add_action( ‘woocommerce_admin_order_data_after_billing_address’, ‘display_optout_acceptance’, 10, 1 ); function display_optout_acceptance( $order ) { $nosignoptout = get_post_meta( $order->get_id(), ‘nosign’, true ); if ( $nosignoptout == 1) { echo ‘<p><strong>Shipping Opt-Out: </strong>Selected</p>’; } else echo ‘<p><strong>Shipping Opt-Out: </strong>Not Selected</p>’; }
Use filter woocommerce_checkout_fields: add_filter( ‘woocommerce_checkout_fields’ , ‘checkout_change_fields’ ); function checkout_change_fields( $fields ) { return $fields; } more samples https://docs.woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/
Try this ode, dont forgot to change ex: http://test.com/custom_page custom_page => ( Change with your current registration page slug ) change this link ‘http://customlink.com/asdasda/‘ => (Change with where you want to redirect ) $registration_redirect=”http://customlink.com/asdasda/“ add_filter( ‘registration_redirect’, ‘my_redirect_home’ ); function my_redirect_home( $registration_redirect ) { global $post; $post_slug=$post->post_name; if( ‘custom_page’ === $post_slug ){ $registration_redirect=”http://customlink.com/asdasda/”; } return $registration_redirect; … Read more
Custom changes performed on WP + WooCom site on maintenance subdomain. How to perform a migration to a main domain?