Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Ultimate › Translate notice Single Vendor Checkout
- This topic has 15 replies, 3 voices, and was last updated 4 years, 7 months ago by Sushobhan.
- AuthorPosts
- April 24, 2020 at 3:20 pm #122497HenrietteParticipant
Hi,
I’m using Single Vendor Checkout code and it works perfectly.
The only thing is that I can not change the notice into my own language.
I tried to change it in the functions.php code but that doesn’t change anything. Even with clearing all caches.Would you please be so kind to tell me how to change this notice into my language?
Part of code >// We display an error message wc_clear_notices(); wc_add_notice( __( "Well, you already have some item in your cart. First checkout with those and then purchase other items!", "wcfm" ), 'error' ); } return $is_allow; }, 50, 3 );
Thank you very much
- April 24, 2020 at 6:07 pm #122541SushobhanKeymaster
Hello,
If your site supports a single language then you can simple enter your text directly into that function-
wc_add_notice( "write your own message in your own language, here", 'error' );
Thanks 🙂 - April 26, 2020 at 5:08 pm #123267HenrietteParticipant
Hi Sushobhan,
I already did that in the first place but it keeps showing the notice in English.
I didn’t change anything in the code, only the original text.I got the code from here: https://docs.wclovers.com/tweaks/#single-vendor-checkout
Edit: somehow I could not reply with the code added so I made a screenshot of what I have.
Attachments:
You must be logged in to view attached files. - April 27, 2020 at 3:17 pm #123634SushobhanKeymaster
Please clear your browser cache or try in incognito mode. Your edit should work as expected.
Thank You!
- April 27, 2020 at 5:32 pm #123694HenrietteParticipantThis reply has been marked as private.
- April 27, 2020 at 6:48 pm #123720SushobhanKeymaster
Hi,
Are you using WCFM – Direct PayPal Pay plugin? As this plugin already has this restriction added in it. If yes then you don’t need this code. Then you can translate the text using Loco Translate.
But, if that’s not the case, then I’m sure you have somehow pasted the code twice. Just search for ‘woocommerce_add_to_cart_validation’ filter. And for a quick fix just increase the function priority to anything above 50. You can find priority at the end of the code snippetreturn $is_allow; }, 50, 3 ); //Change 50 to 51
Thanks!
- May 5, 2020 at 9:50 am #126813HenrietteParticipant
Hi Sushobhan,
Sorry for my late reply. I missed yours again.
Just search for ‘woocommerce_add_to_cart_validation’ filter.
I did and it was only one time in my functions.php
And for a quick fix just increase the function priority to anything above 50. You can find priority at the end of the code snippet
I did and it didn’t work.
As this plugin already has this restriction added in it.
Than I deleted the piece of code in my functions.php and the single vendor checkout kept being active so I thought it was indeed the duplicate of the paypal plugin.
Are you using WCFM – Direct PayPal Pay plugin?
Yes I did but since I don’t need this after all I removed the plugin.
Deleted all caches including my browser history and uploaded the function.php file again with your original code.
Tried it in normal browser as well in incognito mode but now it doesn’t work at all anymore.
Now I can just put 2 different items from two different vendors in my shopping basket without blocking or warning.Tried one more time to change 50 to 51 but still the same. Sorry
- May 5, 2020 at 6:45 pm #127039SushobhanKeymaster
Hi,
Please share me a temporary site access to check. I’ll just check and tell you the problem, will not edit anything.
If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:
https://wordpress.org/plugins/temporary-login-without-password/
You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):
https://wordpress.org/plugins/wp-security-audit-log/
Don’t forget to mark it private.
Thank You!
- May 5, 2020 at 8:41 pm #127078HenrietteParticipantThis reply has been marked as private.
- May 5, 2020 at 10:21 pm #127109SushobhanKeymasterThis reply has been marked as private.
- May 6, 2020 at 9:53 am #127254HenrietteParticipantThis reply has been marked as private.
- May 6, 2020 at 10:35 am #127265HenrietteParticipantThis reply has been marked as private.
- May 6, 2020 at 5:05 pm #127442HenrietteParticipantThis reply has been marked as private.
- May 24, 2020 at 7:24 pm #134750orth.bastianParticipant
Is there a solution to this? I’m using newest version of WCFM, and set the checkbox in the admin panel. How can i translate this error message? Above snippet isn’t working.
- May 24, 2020 at 9:44 pm #134801SushobhanKeymaster
Hi,
Thanks for getting in touch with us!
Kindly use Loco Translate for this purpose. How to- https://docs.wclovers.com/locotranslate-translation-using-loco-translate-plugin/
Thank You!
- AuthorPosts
- You must be logged in to reply to this topic.