Get product link

WooCommerce default customer-complete-order.php email template does not link the order item to corresponding product. You need to use woocommerce_order_item_name filter and update the item name to have link. I just tried below code and it adds the link to order item (product name). Put this code in functions.php file of your theme. Hope this helps: … Read more

Add custom variable to cart content [closed]

I had to do something similar a while ago, this is what was working for me: In the example, the custom input name is “test_field” inside the add to cart form, and this way when you dump the cart_contents, you can see the value somewhere at the end //Store the custom field add_filter( ‘woocommerce_add_cart_item_data’, ‘add_cart_item_custom_data_vase’, … Read more

Display order items names in WooCommerce admin orders list [closed]

Never overwrite core files! for many reasons. Note that an order can have many items (products). On orders admin list, the following will add item(s) (product(s)) names, to order status column: add_action( ‘manage_shop_order_posts_custom_column’ , ‘custom_orders_list_column_content’, 20, 2 ); function custom_orders_list_column_content( $column, $post_id ) { global $the_order, $post; if ( ‘order_status’ === $column ) { $products_names … Read more

How to disable Woocommerce password recovery and use the default WordPress password reset page?

I found the solution in WP forum. Here it is: To remove the WooCommerce redirect for the “Lost Password” link, you’ll want to remove the “Lost Password” endpoint setting as found under **WooCommerce > Settings > Advanced > Account endpoints**. By simply leaving that blank, the user will be forced to use the default WordPress … Read more

add_filter to modify woocommerce_cart_item_name hyperlink

The key is to pass arguments to the callback function. Try this: /* Function that returns custom product hyperlink */ function wc_cart_item_name_hyperlink( $link_text, $product_data ) { $title = get_the_title($product_data[‘product_id’]); return sprintf( ‘<a href=”https://wordpress.stackexchange.com/questions/216353/%s”>%s </a>’,’example.com/mypage/’,$title ); } /* Filter to override cart_item_name */ add_filter( ‘woocommerce_cart_item_name’, ‘wc_cart_item_name_hyperlink’, 10, 2 ); The $product_data parameter is an array that … Read more

Move payment options at checkout in WooCommerce [closed]

You can customize the checkout page using hooks. To remove the payment options add the following code to your (child)theme’s functions.php: remove_action( ‘woocommerce_checkout_order_review’, ‘woocommerce_checkout_payment’, 20 ); To add it after the order notes use this hook: add_action( ‘woocommerce_after_order_notes’, ‘woocommerce_checkout_payment’, 20 );

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