The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
verified owner code...
 
Notifications
Clear all

[Solved] verified owner code for wpdiscuz

8 Posts
2 Users
1 Reactions
2,006 Views
Posts: 10
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@saeed-khoramdel)
Active Member
Joined: 5 years ago
[#1870]

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


7 Replies
Posts: 10
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@saeed-khoramdel)
Active Member
Joined: 5 years ago

like this

Screenshot 2021 03 22 03 16 webp (WEBP Image, 900 × 456 pixels)

6 Replies
Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8225
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@saeed-khoramdel,

You can do the customization using the wpdiscuz_comment_author hook. 


(@saeed-khoramdel)
Joined: 5 years ago

Active Member
Posts: 10
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

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

Illustrious Member
Posts: 8225
Asti
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@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
Asti
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

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

Illustrious Member
Posts: 8225
Asti
Asti
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@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
Asti
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

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