The effects of alcohol on
sustanon 250 leucine for – real weight loss & bodybuilding benefits?
[Solved] verified owner code for wpdiscuz
How-to and Troubleshooting
(@saeed-khoramdel)
Active Member
Joined: 5 years ago
Hi
in my default woocommerce comment form when a user buy a product he became a verified owner
and when he writes his review he has this label { verified owner } beside of his name on comment form after sharing
but in wpdiscuz form there is not this label for people who bought proudcts
i have a code for this and my website is RTL
please give me a code base on RTL
THANKS
(@saeed-khoramdel)
Active Member
Joined: 5 years ago
(@asti)
Joined: 8 years ago
Illustrious Member
Posts: 8192
Mar 22, 2021 9:50 am
@saeed-khoramdel,
You can do the customization using the wpdiscuz_comment_author hook.
(@saeed-khoramdel)
Joined: 5 years ago
Active Member
Posts: 10
Mar 24, 2021 6:28 am
@asti
hi asti
Forgive me i wrote wrong in up there becuse my english is not very good i wrote i have a code and this is wrong i have not any code I wanted to write i want a code and mistakenly i wrote i have a code
and i dont know anything from code and ...
please give me a code wich show the label of verified owner after that a person buy a product on product page of woocommerce
and please guide me step by step i do not know what i must do with wpdiscuz_comment_author hook.
(@asti)
Joined: 8 years ago
Illustrious Member
Posts: 8192
Mar 24, 2021 9:56 am
@saeed-khoramdel,
Use this code:
add_filter("wpdiscuz_comment_author", function ($name, $comment) {
if (wc_review_is_from_verified_owner($comment->comment_ID)) {
$name .= " <em class='woocommerce-review__verified verified'>(" . esc_attr__("verified owner", "woocommerce") . ")</em>";
}
return $name;
}, 10, 2);
You should put the code in the active theme functions.php file.
(@saeed-khoramdel)
Joined: 5 years ago
Active Member
Posts: 10
Mar 24, 2021 1:07 pm
@asti
thanks it works but has some problems
when a Customer write his comment the code work correctly and for example show this name : mike {verified owner} but when some one like jim replys to mike this code does not work good and shows the name of mike like this :
jim reply to :
language of my website is persian and i show you picture of that for better understanding
please solve this
(@asti)
Joined: 8 years ago
Illustrious Member
Posts: 8192
Mar 25, 2021 8:58 am
@saeed-khoramdel,
jim reply to :
mike <em class='woocommerce-review__verified verified'>(verified owner)</em>
We may suggest you hide the “reply to” section using CSS code.
(@saeed-khoramdel)
Joined: 5 years ago
Active Member
Posts: 10
Mar 26, 2021 5:35 am
@asti
thanks asti for helping me to solve this
this is css code for hiding “reply to” if someone wants to use it
.wpd-reply-to{
display:none;
}