Support » Plugin: WooCommerce Product SKU Generator » Removing The Hyphens

  • Resolved Orlybg

    (@orlybg)


    Hello there,
    First of all, Great plugin! thanks!

    My problem is that the SKU that is being generated for the variations has hyphens in it which im not interested in having.
    My SKU looks like this: SHSMANOLIS-38-blwh When i want it like this: SHSMANOLIS38blwh
    I have tried to change the setting for spaces in “Replace spaces in attributes?” but nothing changes…

    Please assist
    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author SkyVerge

    (@skyverge)

    Hey @orlybg, happy to help out here! The “Replace spaces in attributes” setting looks like it wouldn’t relate to your use case right now. It seems that 38 and blwh are probably two separate attributes — is that right?

    The “replace spaces in attributes” setting only applies to a single attribute; for example, if my “Color” attribute had a value of “Sky blue”, the space there would be replaced.

    What you’re referring to is the separator between each attribute, which always uses a hyphen. I’m afraid this doesn’t have a setting, but you could change it with a custom code snippet.

    Here’s an example on how to do so: https://gist.github.com/bekarice/33c3858b0c2e744fd2f503b840820284 — you’d likely want to use the part that says “Example 2”. If you use this please be sure you know how to add custom code to your site.

    Cheers!

    Hello and thank you so much for this!
    I have implemented what you have wrote and gone for the code snippets plugin option.
    My SKU looked like this: SHSMANOLIS-38-blwh and after doing what you wrote it looks like this SHSMANOLIS-38blwh When i want it like this: SHSMANOLIS38blwh So we are half way there.

    Can you please help me remove also the hyphen between the parent sku to the variations?

    Thanks

    Plugin Author SkyVerge

    (@skyverge)

    Sure thing!

    That’s definitely an oversite on my part, they should likely be using the same separator. I’ll look at possible adjustments in the next update. In the meantime, you can add another snippet here to remove the divider between the parent / variations as well.

    Cheers!
    Beka

    I managed to create item SKU’s that begin with a hyphen (I think because I impulsively saved the Product before naming it or something). Will this be a problem? At first I thought they were negative numbered SKU’s, but I’m guessing it’s just this separator?

    Plugin Author SkyVerge

    (@skyverge)

    @kerryoco re-saving the product with the name entered will re-generate the SKU to correct this for you. If not, you can temporarily disable the plugin, delete the SKU, then re-enable the plugin to regenerate it on the next save.

    Cheers! -Beka

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Removing The Hyphens’ is closed to new replies.