The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
verified owner code...
 
Share:
Notifications
Clear all

[Solved] verified owner code for wpdiscuz

8 Posts
2 Users
1 Reactions
1,277 Views
Posts: 10
Topic starter
(@saeed-khoramdel)
Active Member
Joined: 4 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

Topic Tags
7 Replies
Posts: 10
Topic starter
(@saeed-khoramdel)
Active Member
Joined: 4 years ago

like this

Screenshot 2021 03 22 03 16 webp (WEBP Image, 900 × 456 pixels)
6 Replies
Asti
 Asti
Support
(@asti)
Joined: 7 years ago

Illustrious Member
Posts: 7617

@saeed-khoramdel,

You can do the customization using the wpdiscuz_comment_author hook. 

(@saeed-khoramdel)
Joined: 4 years ago

Active Member
Posts: 10

@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
 Asti
Support
(@asti)
Joined: 7 years ago

Illustrious Member
Posts: 7617

@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: 4 years ago

Active Member
Posts: 10

@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
 
 
Screenshot 2021 03 24 اعتماد به نفس – سعید خرم دل – رشد فردی

please solve this

and if you can please write this new code in a way which i can add css codes to label of verified owner without that css codes affect the Customer name
 
i want label of verified owner be a separate element from Customer name like element of badges in wpdiscuz
Asti
 Asti
Support
(@asti)
Joined: 7 years ago

Illustrious Member
Posts: 7617

@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: 4 years ago

Active Member
Posts: 10

@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;
}
Share: