More Restricted URL for vendor

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Viewing 24 reply threads
  • Author
    Posts
    • #35760
      mustafa
      Guest

      Hi,

      We want to limit the vendor “Store Name” in the URL To have only Latin characters with no space and only _ allowed. For example, like Instagram usernames.
      https://example.com/vendors/%5Byour_store%5D

      Can that be done?

      Thanks

    • #35779
      WCFM Forum
      Member

      HI,

      Do you want to apply this rule for store name or store url?

      Thank You

    • #35792
      mustafa
      Guest

      It should be for Store URL

    • #35872
      WCFM Forum
      Member

      Ok, we are looking into this.
      “_” is not an issue, but restricting Latin characters is difficult.

      I will update you on this.

      Thank You

    • #35886
      mustafa
      Guest

      Hi,

      Thanks for your feedback. Please, keep us updated as this feature is a must for our site.

    • #35902
      WCFM Forum
      Member

      Yeah sure!

    • #36627
      Mustafa
      Participant

      Hi,

      Any update on this?

    • #36881
      WCFM Forum
      Member

      We are looking for a solution for this, will update you soon.

      As i already mentioned you before – “Latin characters is difficult.”
      If you asked me English character then it will be very easy.

      Thank You

    • #36912
      Mustafa
      Guest

      Only English is fine.

    • #36994
      Mustafa
      Participant

      Can you also restrict changes? I mean disallow vendor to change their URL once set.

      Thanks

    • #37000
      WCFM Forum
      Member

      HI,

      Kindly add this code to your site –

      add_action( 'end_wcfm_membership_registration_form', function() {
      	?>
      	<script>
      	jQuery(document).ready(function($) {
      		$('#store_name').on('keydown', function( event ) {
      			var key = event.keyCode;
      			return ((key >= 65 && key <= 90) || key == 8 || key == 189 || key == 9 || key == 32);
      		});
      	});
      	</script>
      	<?php
      });
      add_filter( 'wcfm_is_allow_store_name', '__return_false' );

      This will restrict store name to only characters and “_”.
      Also vendors will not able to edit store name and slug later.

      Thank You

    • #37009
      Mustafa
      Participant

      Where should I add that code. I’ve added to child-theme function.php file but still no change.

    • #37010
      WCFM Forum
      Member

      HI,

      You have added this at right file, still show me screenshot for this.

      Between, what change you are expecting?

      Trying to register as a new vendor and you will see limitation at “Store Name” field.
      Also check at Vendor’s setting page – Store Name and Store Slug setting option no more available.

      Thank You

    • #37061
      Mustafa
      Participant

      Hi,

      I tested and it works for English but I can still type in Arabic characters for (store slug) which I don’t want to allow.

      The changes I am expecting is:
      1) I don’t want to restrict vendors from adding whatever they want for “Store Names”.
      2) I just want to restrict “Store Slugs”.

      Thanks for your support.

    • #37062
      WCFM Forum
      Member

      HI,

      OK, then you have to wait till WCFM Membership next update.

      I will update you as new version will be there.

      Thank You

    • #37948
      Mustafa
      Participant

      Hi,

      Please, make sure that you add this feature also during upgrade process of vendor account.

      Thank you

    • #38096
      WCFM Forum
      Member

      Hi,

      What do you mean by “during upgrade process of vendor account”?

      Thank You

    • #38280
      Mustafa
      Participant

      Hi,

      When vendors change their membership, the form to change their Store Slug is also there.

      Regards

    • #38984
      Mustafa
      Participant

      Any update on this?

    • #38986
      WCFM Forum
      Member

      Hi,

      WCFM Membership new update not yet released, I will give you support code after that.

      Thank You

    • #39176
      WCFM Forum
      Member

      Hi,

      Hope you have already updated latest WCFM and WCFM Membership, now please use this code for the purpose ->

      add_filter( 'wcfm_generated_store_slug', function( $store_slug ) {
      	$store_slug = preg_replace("/[^a-z0-9-]/", "", $store_slug);
      	return $store_slug;
      });

      Thank You

    • #39184
      Mustafa
      Participant

      Hi,

      It work for English. But what if user tries enter Arabic character?

      I want to restrict English character only.

    • #39187
      WCFM Forum
      Member

      Hi,

      It will only allow these characters -> a-z0-9-

      if Arabic inserted then those will be removed from slug.

      Thank You

    • #39190
      Mustafa
      Participant

      I checked, they are not removed. You can try this for example: عربي

    • #39194
      WCFM Forum
      Member

      Hi,

      It’s converted to alphanumeric -> https://ibb.co/4KDpR5R

      Between, do you have removed this code?

      ,

      Kindly add this code to your site –

      add_action( 'end_wcfm_membership_registration_form', function() {
      	?>
      	<script>
      	jQuery(document).ready(function($) {
      		$('#store_name').on('keydown', function( event ) {
      			var key = event.keyCode;
      			return ((key >= 65 && key <= 90) || key == 8 || key == 189 || key == 9 || key == 32);
      		});
      	});
      	</script>
      	<?php
      });

      If it’s there then how you can add other characters there?

      Thank You

Viewing 24 reply threads
  • The topic ‘More Restricted URL for vendor’ is closed to new replies.