I'm creating a website with downloadable products with WooCommerce. When users buy a product and receive an email, I want to customize the table of downloadable products in the email. More specific I only want to change the following:
Only thing I want to do is change 'Downloads' and 'download' to something else…
With some research, I thought I had the answer. I changed some things in order/order-details.php and order/order-downloads.php. But I think I didn't do it correctly.
Can someone tell me what I have to change exactly?
To change the title "Downloads", the right template involved is emails/email-downloads.php line 22
?><h2 class="woocommerce-order-downloads__title"><?php esc_html_e( 'Downloads', 'woocommerce' ); ?></h2>
To change the column label name "Download", you will use the following code:
add_filter('woocommerce_email_downloads_columns', 'custom_email_downloads_columns', 10, 1);
function custom_email_downloads_columns( $columns ){
$columns['download-file'] = __("New name", "woocommerce");
return $columns;
}
Code goes in function.php file of your active child theme (or active theme). Tested and work.
Related
I'm trying to change the "product" column title for downloadable products on customers email notification after completing a purchase.
Any advice would be greatly appreciated.
Using woocommerce_email_downloads_columns filter hook will allow you to change the column label name to something else:
// Change email downloads specific column label name
add_filter( 'woocommerce_email_downloads_columns', 'filter_wc_email_downloads_columns' );
function filter_wc_email_downloads_columns( $columns ) {
$columns['download-product'] = __( 'Name', 'woocommerce' );
return $columns;
}
Code goes in functions.php file of your active child theme (or active theme). Tested and works.
Similar: Change column titles from downloads table on Woocommerce Thankyou page
In Woocommerce when we go to My account "Downloads" section, a list of downloads is displayed which contain product name(linked to the product) and link to download the file.
Is there a way to remove the link of product and just display product name?
Update 3:
Here is the way to remove the product link from the product name in My account downloads:
// Display the product name without the link
add_action( 'woocommerce_account_downloads_column_download-product', 'custom_account_downloads_product_column' );
function custom_account_downloads_product_column( $download ){
// Display the product name without the link
echo esc_html( $download['product_name'] );
}
Code goes in function.php file of your active child theme (or active theme). Tested and works
I am trying to change the name of a tab in product page of woocommerce to a different name.
I am trying to find which PHP file has that particular code but I am unable to do that. Have also used plugins like WhatTheFile (it said the product page is loaded from single-product.php, but I couldn't find the html to edit there) and String Locator and they couldn't help even. Please have a look at this video I made and you will better understand my problem.
https://www.dropbox.com/s/bruhb2n83lhfnp6/Code.mp4?dl=0
I am using G5Plus April theme
Thank you
you can add code like this in functions.php of your theme to customize the product description tab title. For more details, Link 1, Link 2
add_filter( 'woocommerce_product_tabs', 'woo_customize_tabs', 100, 1 );
function woo_customize_tabs( $tabs ) {
$tabs['description']['title'] = __( 'More Information' ); // Rename the description tab
return $tabs;
}
Hope this will helps you.
I got a WooCommerce website, which hides the prices for not logged in users, and apparently it works fine, except with product variations, that even if it does what it should, is not properly done, or at least not the way I would do it.
I hides the price of the variable product, but allows you to choose options (which is fine, that way you might encourage users to register) the problem is that when you finish choosing the variables, it shows the following message "Sorry, this product is unavailable. Please choose a different combination." Which is incorrect, is not a combination problem, but a login issue. So I wouls like to ask for some help on changing this message. Just as a quick tip, There is anoter message which i have changed already in WooCommerce with a function in the child functions.php, check the code bellow, do you think I will be able to do something similar?
function my_woocommerce_membership_notice( $message ) {
if (strpos($message,'has been removed from your cart because it can no longer be purchased') !== false) {
$message = 'An item has been removed from your cart as you have been logged out for inactivity. Please login again to add products to your cart.';
}
return $message;
}
add_filter( 'woocommerce_add_error', 'my_woocommerce_membership_notice' );
You can see the actual behaviour of the website in here: http://nataliayandres.com/oxynergy/shop/my-personalized-cream/
You should try to use the WordPress gettex() function that will replace the concerned message by your custom one:
add_filter( 'gettext', 'customizing_product_variation_message', 10, 3 );
function customizing_product_variation_message( $translated_text, $untranslated_text, $domain )
{
if ($untranslated_text == 'Sorry, this product is unavailable. Please choose a different combination.') {
$translated_text = __( 'Here goes your custom text', $domain );
}
return $translated_text;
}
This code goes in function.php file of your active child theme (or theme) or also in any plugin file.
When a User Buys a Product he can generate up to 3 Serial Keys for his Product. This works fine so far. The User can see his Serials always in "my account"
The Data gets stored in the Database: Table=Usermeta Meta=Product_Serial
So from a Users Perspective evrything works fine but from the Admin Perspective not because the admin can´t see how much Serials the Customer has created and also he cant see the Serials the User is using.
Now I have created a Custom Field in the Theme functions.php with this code:
add_action( 'add_meta_boxes', 'add_meta_boxes' );
function add_meta_boxes()
{
add_meta_box(
'woocommerce-order-my-custom',
__( 'Order Custom' ),
'order_my_custom',
'shop_order',
'side',
'default'
);
}
But from here I don't know how to read out the Serial Key so the admin can see it. :( Any ideas ?
May be i am displaying data in wrong place in your order detail page. But you can check there is multipe hook avilable for this woocommerce/inculdes/admin/meta-boxes-/view/html-order-items.php.
I just take one this hook. Please add this code in functions.php
function my_function_meta_deta() {
echo "I am here";
}
add_action( 'woocommerce_admin_order_totals_after_refunded','my_function_meta_deta', $order->id );
As coder said there is multiple hooks you can also try this out.
add_action('woocommerce_admin_order_data_after_order_details', 'my_custom_order_manipulation_function');
function my_custom_order_manipulation_function( $orderID ) {
//dynamic functionalities / static html to display
}
Credits : Add order metadata to WooCommerce admin order overview