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

How to get the first image gallery of a product in woocommerce in a loop

Along with the product thumbnail (I’m assuming you have this), what you need is a list (array) of the product images – WooCommerce has such methods, eg $product->get_gallery_attachment_ids(). You can grab the first ID in the array and use it to fetch the single image using wp_get_attachment_image(), or wp_get_attachment_url(), etc., then use that as an … Read more

How to update user role without logout

I think you are on the right track, wp_cache_delete was what finally helped me get an auto-signup with auto-login plugin working… I have this from there: wp_cache_delete($current_user->ID, ‘users’); wp_cache_delete($current_user->user_login, ‘userlogins’); Then see what roles you get after that with: $current_user = wp_get_current_user();

WooCommerce – Load Templates From Plugin For All Template Files

WooCommerce uses the template_include filter/hook to load main templates like archive-product.php and single-product.php. And here’s the class which handles main templates. And there’s a filter in that class which you can use to capture the default file (name) which WooCommerce loads based on the current request/page — e.g. single-product.php for single product pages. You can’t, … 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

get product attributes for current product and store it in a variable

get_terms() Retrieves the terms in a given taxonomy or list of taxonomies. What you need is get_the_terms() Retrieves the terms of the taxonomy that are attached to the post. So you can simply replace $brand_terms = get_terms( ‘pa_liquor-brands’ ); with $brand_terms = get_the_terms( $post, ‘pa_liquor-brands’ ); And that should to the trick. You can read … Read more

Can’t set proper WooCommerce language translation [closed]

After installing WordPress version 4.6.1 and WooCommerce version 2.6.6, both with the default enabled language, English (United States), I followed the steps below and had the translation successfully installed and working: Set a language for your WordPress installation Click on the General sub-menu item under Settings from the Dashboard of your WordPress installation, and scroll … Read more

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