How to run code when cookie is added?
How to run code when cookie is added?
How to run code when cookie is added?
i think you can use ‘wp_enqueue_scripts’ hook and try with condition like this- add_action( ‘wp_enqueue_scripts’, ‘my_deregister_javascript’ ); function my_deregister_javascript(){ if( get_the_ID() != ‘67688’ ) { wp_deregister_script( ‘wc-lottery-jquery-plugin’ ); } } for front-end
the filter function must be inside the action function, because if it isnt it is not recognize. So I think. At least with variables is like this. add_action( ‘woocommerce_before_checkout_form’, ‘add_checkout_error’, 9 ); function add_checkout_error() { wc_print_notice( __( ‘An error message.’, ‘woocommerce’ ), ‘error’ ); add_filter(‘woocommerce_order_button_html’, ‘remove_order_button_html’ ); function remove_order_button_html( $button ) { $button = ”; … Read more
What I understood is that no AJAX is needed. If somebody don’t understand all the fancy example around, you just need to use the pre_get_posts hook. In my case what I did is: function custom_product_search($query) { $query->query_vars[‘post_parent’] = htmlentities($_GET[‘model’]) ?? htmlentities($_GET[‘make’]); return $query; } add_action(“pre_get_posts”, ‘custom_product_search’); I don’t know if this is the correct solution … Read more
Is doing a database query in Woocommerce efficient to only display posts from a certain category?
Help to locate a woocommerce hook method
In your admin panel edit the attribute “Authors” and set the order as Custom. Now you can use a csv to edit all your products and attributes for each one. The order you will set there, that’s the order that will be displayed in each product. About Woocommerce default csv import / export function you … Read more
https://woocommerce.wp-a2z.org/oik_api/wc_delete_product_transients/ You need to clear only 1 transient: delete_transient( ‘wc_var_prices_’. $product->get_id() );
pass a woocommerce product name to contact form7?
Do you plan to do it on the wp-admin dashboard or frontend? If you plan to add it to the frontend, what plugin are you using for that?