Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM › Tag limit
- This topic has 20 replies, 2 voices, and was last updated 4 years, 8 months ago by Sarmistha Chakraborty.
- AuthorPosts
- April 3, 2020 at 12:50 am #114867Rochus de QuastenitParticipant
I want to set a limit on tags for my store but i can not find where that option is. i only see a category limit.
- April 3, 2020 at 5:26 pm #115085Sarmistha ChakrabortyMember
Hello,
Sorry we don’t have this feature.
Thank You.
- April 3, 2020 at 6:38 pm #115103Rochus de QuastenitParticipant
Is there a way that i can add a tag with custom code or a plugin?
- April 4, 2020 at 2:01 pm #115289Sarmistha ChakrabortyMember
Hi,
Add the below code n your activated theme’s functions.php
add_filter('wcfm_is_tags_input','__return_false');
And add the below script in your theme’s js file,
jQuery(document).ready(function ($) { $('.product_tags_as_dropdown').select2({ maximumSelectionLength: 2 //replace with your tag limit }); $('.product_tags_as_dropdown').select2('reload'); });
Thanks.
- April 4, 2020 at 7:59 pm #115374Rochus de QuastenitParticipant
Hello, thanks for the code! but the code ensures that vendors can only use tags that are already there. and not being able to create more tags that don’t exist yet.
- April 6, 2020 at 6:17 pm #115945Sarmistha ChakrabortyMember
Hello,
In this case vendor can not create new tag. He can assign only existing tags.
Thanks.
- April 7, 2020 at 12:46 pm #116258Rochus de QuastenitParticipant
is it also possible to get this feature but vendors are still be possible to make new tags? it is really important to my site.
- April 7, 2020 at 7:55 pm #116418Sarmistha ChakrabortyMember
Hello,
In this case please do not add the previously mentioned code,
Add the below script in your theme’s js file,jQuery(document).ready(function ($) { $('textarea#product_tags').on('keypress',function(e){ var n = 3; //add your number of tags limitation var charCount = $(this).val().split(/[\.,\?]+/).length; if(charCount >= n+1) { alert("You cann't add more than "+n); e.preventDefault(); } }); });
Thanks.
- April 7, 2020 at 9:59 pm #116460Rochus de QuastenitParticipant
Hello, I’ve added the code to my theme’s js file, but for some reason it did not work. Other example code did execute, but the code above did not.
- April 8, 2020 at 4:30 pm #116868Sarmistha ChakrabortyMember
Hi,
We assume that you have already removed previous code(otherwise new script will not execute), and you already checked that the new script are include in your site.
Still you having the same problem please share us your site details with site url(Set as private reply), then we will do it for you.Thanks.
- April 8, 2020 at 6:25 pm #116883Rochus de QuastenitParticipantThis reply has been marked as private.
- April 8, 2020 at 7:49 pm #116921Sarmistha ChakrabortyMemberThis reply has been marked as private.
- April 8, 2020 at 8:15 pm #116926Rochus de QuastenitParticipantThis reply has been marked as private.
- April 8, 2020 at 11:23 pm #116978Rochus de QuastenitParticipantThis reply has been marked as private.
- April 8, 2020 at 11:59 pm #116997Sarmistha ChakrabortyMemberThis reply has been marked as private.
- April 9, 2020 at 1:03 am #117013Rochus de QuastenitParticipantThis reply has been marked as private.
- April 9, 2020 at 1:43 am #117022Sarmistha ChakrabortyMemberThis reply has been marked as private.
- April 9, 2020 at 2:24 am #117029Rochus de QuastenitParticipantThis reply has been marked as private.
- April 9, 2020 at 11:50 am #117159Sarmistha ChakrabortyMemberThis reply has been marked as private.
- April 9, 2020 at 1:28 am #117018Rochus de QuastenitParticipantThis reply has been marked as private.
- April 9, 2020 at 1:30 am #117019Rochus de QuastenitParticipantThis reply has been marked as private.
- AuthorPosts
- You must be logged in to reply to this topic.