How to remove woocommerce check out page's default email address text - woocommerce

By default email field is showing email address from wordpress general settings , I want to show a custom text like 'example#example.com' in this field as a place holder value. Please advise

None of the answers solved my problem either...
Took me a while to work this out, really simple in the end, just put this at the end of your functions.php file and change the value to whatever you want.
function woocommerce_change_checkout_field_value() {
echo "<script>document.getElementById('billing_email').value = 'Your value here';</script>";
}
add_action( 'woocommerce_after_checkout_form', 'woocommerce_change_checkout_field_value');

Go to your dashboard -> Woocommerce -> Settings -> Emails -> Email options, you will see ""From" Name" and ""From" Email Address", change those and it should change it on the email.
More information about configuring some of the basic options on woocommerce you can visit this page.

You need to implement checkout field customization hook for doing this. Its correct way of doing it.
Please refer to this : https://docs.woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/

get WooCommerce Checkout Manager
then complete Replace Placeholder Name of your field.

Related

Add new input field to ACF Link

I am currently trying to add an additional input field where users are able to specify an aria-label inside the already existing link field within Advanced Custom Fields in Wordpress. I’ve attached an image to give a visual representation of what I am looking to do.
Link Modal
Then on the frontend you would use something like $link[aria-label] to get it from the link array.
Any help to achieve this would be amazing. Thank you!
You can try if that field already exists in the ACF link.
Store that link value in a variable and print_r it and check. Check the below code.
<?php
$link = get_field('YOUR-FIELD-NAME');
print_r($link);
?>

ERROR: please fill the required fields (name, email). in Wordpress Comment

I have a problem submitting comment form for not signed in users. When I try to submit the forms, it is giving me an error -
ERROR: please fill the required fields (name, email).
I am using default template for WordPress. I have tried to deactivate the plugins one by one to make sure that if this is not a conflict, but then it is also not working. However, It's working fine for logged in users.
You can just make the email and name fields not required, To achieve this, go to Dashboard > Settings > Discussion and uncheck the Comment author must fill out name and email.
Edit:
Read the comments for actual solution ...
I had the same issue. Check the code below within your theme and remove 'comment-form' and 'comment-list'.
add_theme_support(
'html5',
array(
'search-form',
//'comment-form',
//'comment-list',
'gallery',
'caption',
)
);
Note this question should be on WordPress stackoverflow.

Notify email when someone's posted a review in WooCommerce

I noticed that Woocommerce's reviews are managed through Wordpress Comments. But why is it that Wordpress isn't notifying my email when someone posted a review to a product. I have set the "Email me whenever anyone posted a comment".
Is this function available in Woocommerce or i'm missing something?
Please advise, thanks everyone!
Regards, Ven
By default Wordpress sends a notification to the author of the product/post (the person who created the product in your instance). The suggested site owner (settings > general) is not the recipient of these notifications. This is where the trouble might start. This author information is in Woocommerce hidden and is hard to figure out who that is in your user database. It might be that the original author of the product doesn't exist anymore, and especially if the original author has been deleted from the database and you didn't move the contents of that user to a new user.
The default comment notifications are produced in this Wordpress file: wp-includes/pluggable.php
Below is a trick to override the recipient for the comment/review notification, put this code in your child-theme's functions.php and change the part example#example.com to your desired email recipient and you will receive a notification every time someone adds a comment/review to your site.
function new_comment_moderation_recipients( $emails, $comment_id ) {
return array( 'example#example.com' );
}
add_filter( 'comment_moderation_recipients', 'new_comment_moderation_recipients', 24, 2 );
add_filter( 'comment_notification_recipients', 'new_comment_moderation_recipients', 24, 2 );
I tested it and it works.
On the Wordpress Dashboard navigate to Settings > General and the Email address listed here is where you will get notifications.

Display a custom field in node.tpl

I can't seem to figure out how to display (echo) a custom field I added to user profiles(via people > account settings > manage fields).
I added a text field called team (field_team). I then clicked manage display and displayed it. It then shows up under there profile page. Great!
However, now I will like to also display that on the frontpage and in the node view as well. How, or where do I do that?
EDIT: I ended up finding this article and this works. http://drupal.org/node/1194506
Code used:
<?php
$node_author = user_load($node->uid);
print ($node_author->roles[3]);
print ($node_author->field_biography['und'][0]['value']);
?>
You must enable devel module to try this:
global $user;
dpm($user);
Hope that helps revealing the new field.

how to change the link in the wordpress email with newpassword?

how to change the link in the wordpress email with newpassword?
this information we get when we click on forgot password.
username : admin
password : admin
http://www.example.com/wp-login.php
here i want to change this url "http://www.example.com/wp-login.php" and set my own url... how can i do?
some reference code:
if ( !function_exists('is_user_logged_in') ) :function is_user_logged_in() {
$user = wp_get_current_user();
You can hook into the retrieve_password_message filter
function someFunction($message, $key){
}
add_filter('retrieve_password_message', 'someFunction');
You would then have to use the "someFunction" function to parse the $message variable and change the link.
The message variable contains the entire message. So you could simply trim the message based on the number of characters then tack on your new link...
HTH
(Untested)
Using hooks would be my first thought so that you wouldn't have to edit any core files, however I have used the SB Welcome Email Editor plugin a couple times for this exact reason. Their are a couple plugins like this out their and they are fairly light weight and allow full customization of all Wordpress generated emails.
Try using a plugin such as Theme My Login, which does everything for you.
Editing core wordpress files is never a good idea, when updating wordpress, you'll loose all your work.
You can simply follow steps if you want to edit your code file.
Go to your wordpress folder. Look for the following files:
1. /wp-login.php
2. /includes/functions.php
Change the all the codes which contains wp-login.php into your custom URL.
for example: admin.php or client-login.php
Now you can changed your login/signup URL into your custom URL.
Known issue: You can find some database error if you make any mistakes. Just refresh the page and try with the customized Url it will work...
Example site I used here : http://androideveloper.com/admin.php from http://androideveloper.com/wp-login.php
Cheers.

Resources