WooCommerce shop, my account, cart every page redirect to home page [closed]
I found the solution that Go to Settings –> Permalinks –> I have used custom permalinks So change it to another default permalink and save Solves the problem
I found the solution that Go to Settings –> Permalinks –> I have used custom permalinks So change it to another default permalink and save Solves the problem
You can use “woocommerce_get_price_html” filter to remove class from span tag like: add_filter( ‘woocommerce_get_price_html’, ‘remove_class_price_html’, 10, 2 ); function remove_class_price_html( $price, $product ) { return str_replace( ‘woocommerce-Price-currencySymbol’, ”, $price ); } Or else you can use preg_replace to remove class from both span tags.
At first I will notice that logging in with the username only sounds like a insecure solution . You should not display the form in the init action hook. Add form display function to the action hook from checkout page (e.g. woocommerce_before_checkout_form) or overwrite the checkout template in the active theme and insert the form … Read more
You cannot include template files via URL, which is what get_template_directory_uri() returns. You need to use the server file path, which you get get with get_theme_file_path(): $heroslider = get_theme_file_path( ‘template-parts/hero-slider.php’ ); echo $heroslider; include_once( $heroslider ); However, if you’re including templates (rather than files with function/class definitions), you should use get_template_part() to get the correct … Read more
You can use category id using if ( is_product_category(‘your category id’) ){ Change your product size } Please refer to this LINK
WooCommerce conditional to test if a Product is Variable. global $product if( $product->is_type( ‘variable’ ) ){ // a variable product } Found it here: https://gist.github.com/patrickgilmour/9d4a28b4a2f0c1dcecbf and here https://wordpress.org/support/topic/condition-to-check-if-product-is-simple-or-variable.
This action hook is performed after submission: add_action( ‘woocommerce_thankyou’, ‘custom_woocommerce_auto_complete_order’ ); function custom_woocommerce_auto_complete_order( $order_id ) { echo $order_id; }
My bad.. it was the namespace add_filter( ‘woocommerce_breadcrumb_defaults’, ‘mynamespace\\custom_breadcrumb’);
Figured this out now. Instead of using $wp_query->set(), I instead set arguments, and then ran the woocommerce loop. This is the final code I used. add_action(‘wp_ajax_listFilteredProducts’, ‘listFilteredProducts’); add_action(‘wp_ajax_nopriv_listFilteredProducts’, ‘listFilteredProducts’); function listFilteredProducts($wp_query) { if(isset($_GET[‘formData’])) { $value = $_GET[‘formData’]; } // If no price input, but tags have been input if ($value[‘priceRange’] == 0 && $value[‘tags’] != … Read more
I don’t know if is the best way to do this but aparently works well. I override the users table adding one with an blog_id field as key. Add an “wp_pre_insert_user_data” filter to set the blog_id field and change the user id to some like “blog_id000user_id” (100044 for example is from blog 1). Override the … Read more