Username field is not shown in Woocommerce’s registration contact form

I just fund the tricky solution, it was very simple and I did think about it. I just went to WooCommerce -> Settings -> Accounts and I untick the checkbox for “Automatically generate username from customer email”. I got the solution from this topic but here the problem was the contrary: https://stackoverflow.com/questions/32781569/remove-username-field-registration-form-woocommerce

How to modify “[Product] has been added to your cart” in WooCommerce?

add_filter( ‘wc_add_to_cart_message’, ‘my_add_to_cart_function’, 10, 2 ); function my_add_to_cart_function( $message, $product_id ) { $message = sprintf(esc_html__(‘« %s » has been added by to your cart.’,’woocommerce’), get_the_title( $product_id ) ); return $message; } The above code will help you to change the message. Since by knowing the hook wc_add_to_cart_message you can improve the code

Where can I find a single item template

The WC single item template is located at: yoursite.com/wp-content/plugins/woocommerce/templates/single-product.php See this documentation: https://docs.woocommerce.com/document/template-structure/ So, you would want to move any of those templates to your child theme under /wp-content/themes/your-child-theme/woocommerce/[any_template_you_want] So, for example, if you wanted to edit the single-product.php but safe from WC updates, you would put the file in this directory and do your … Read more

Custom URL for each product variation – rewrite rules

Ok, for anyone looking for this, here’s a complete plugin that I came up with, that solves the issue: <?php /* Plugin Name: WooCommerce Variations URL Description: Adds support for variation-specific URL’s for WooCommerce product variations Author: Václav Greif Version: 1.0 Author URI: https://wp-programator.cz */ namespace WCVariationsUrl; final class Init { /** * Call this … Read more

WooCommerce showing star rating review instead of text review string

Suffered with same problem. Finally after lot of search and trial I came up with this solution. This gets the template where the rating is displayed from. But it displays like this: Rated 4.50 out of 5 based on 2 customer ratings (2 customer reviews) <div class=”rating-custom”> <?php wc_get_template( ‘single-product/rating.php’ ); ?> </div> Then paste … Read more

Pass custom Checkout field value to Stripe gateway in WooCommerce

You can use wc_stripe_payment_metadata dedicated filter hook to add (pass) some custom meta data to Stripe gateway, this way: add_filter( ‘wc_stripe_payment_metadata’, ‘stripe_payment_metadata_filter_callback’, 10, 3 ); function stripe_payment_metadata_filter_callback( $metadata, $order, $prepared_source ) { // Here below define your custom field meta key (as it’s saved in wp_postmeta DB table) $metadata=”custom_meta_key”; $metadata[ __( ‘Custom Label Text (or … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)