Code specific for specific products
you can use if(is_product() && get_the_id() == 1253) { // your code here } get product id first
you can use if(is_product() && get_the_id() == 1253) { // your code here } get product id first
For existing orders, you need to use the wc_get_order() function.
you can find and edit new order email template and code for generating the new email in the directory “plugins\woocommerce\templates\emails\email-order-details.php”. i hope its useful and ll solve your issue.
have you try withup date_post_meta <?php update_post_meta( $post_id, $meta_key, $meta_value, $prev_value ); ?> for example update_post_meta($variation_post_id, ‘_price’, $variation[‘price’]); update_post_meta($variation_post_id, ‘_regular_price’,$variation[‘price’]);
For account moderation (allow login only after email verification), there are lots of plugin, you can try Theme My Login, it has moderation option. For using your email address as sender, there are two ways, if you want to send VIA SMTP server you can use any SMTP plugin like Easy WP SMTP or any … Read more
How are you editing your CSS? You can use media queries to set which screen size you want your css to be applicable to: https://www.w3schools.com/css/css_rwd_mediaqueries.asp
Woocommerce adds the action hook at priority order 30. add_action(‘woocommerce_single_product_summary’,’woocommerce_template_single_add_to_cart’,30); So, You may have done remove_action(‘woocommerce_single_product_summary’,’woocommerce_template_single_add_to_cart’,30); to remove the action from the hook. To remove an action the priority must match the priority with with the function was originally added. Now you can do function add_cart_button(){ global $product; $id = $product->get_id(); if($id != 1345 ): … Read more
With .= you are appending you HTML code to the HTML code of the menu contained in the string $items, so the login will appear at the end. You instead want to insert the link inside the HTML of $items, so you must manipulate the string. You for example can search for the HMTL of … Read more
add_filter( ‘woocommerce_product_single_add_to_cart_text’, ‘wpse_woo_custom_cart_button_text’ ); add_filter( ‘woocommerce_product_add_to_cart_text’, ‘wpse_woo_custom_cart_button_text’ ); function wpse_woo_custom_cart_button_text() { global $product; $product_type = $product->get_type(); // To modify on a single product page if( $product_type == ‘variable-subscription’ || $product_type == ‘variable’ ){ if( is_single() ) return __( ‘Buy Now’, ‘my-textdomain’ ); else return __( ‘Choose options’, ‘my-textdomain’ ); } // To modify on the … Read more
This cannot be done via WP_Query, the orderby parameter can take multiple values, but those are telling it what to order by, aka date, time, title, etc These are the valid values You can specify that it must order by post meta, but you can’t specify more than one post meta, because it uses the … Read more