Support » Plugin: WooCommerce Product SKU Generator » missing dots on Attribute Terms like “1.2 Meter”

  • Resolved Erfan MHDi

    (@erfanmhd)


    hello,

    the plugin is using Attribute Term slug to generate SKU for product variations.
    in some attributes like length i have terms wit dots like “1.2 Meter” and the slug of this terms are like “1-2-meter” so the plugin is adding “1-2-meter” to variation SKU instead of “1.2-meter”.

    do you have any suggestion on how to fix this ?

    i think the only option may be to use term title instead of slug, right?

    can you give me a hint on how to do this please ?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Julie Martin

    (@julieskyverge)

    Hi @erfanmhd!

    Thanks for your question, happy to help out here. 🙂

    The issue here is that, by default, dots are not permitted in WordPress slugs and get converted to a hyphen or a dash, so using the slug will necessarily convert any dogs to a dash.

    As such, in this scenario, the title would likely be your best bet here.

    Does that help to clarify things at all? Please let me know if there’s anything else I can help out with.

    Thanks!

    Julie 🙂
    SkyVerge

    Thread Starter Erfan MHDi

    (@erfanmhd)

    Hello @julieskyverge,
    Thank you for your response,

    Is there any way i can force the plugin to use attribute term title (1.2 Meter) instead of term slug (1-2-meter) to generate SKU for variations?

    Currently we can only choose between attribute term slug and variation ID in plugin setting.

    Plugin Support Julie Martin

    (@julieskyverge)

    Hi @erfanmhd,

    Unfortunately, this option isn’t part of our plugin, though you may be able to make some edits to it to do so. Looking at the woocommerce-product-sku-generator.php file, it looks as though it wants either the slug on line 246 or the ID on line 250. You might be able to replace slug or ID with the title, though you’d need to pull the correct information yourself.

    Additionally, you may want to consider making these changes with a code snippet so that your changes aren’t replaced anytime there’s a plugin update.

    Regrettably, since this is a customization, our support policy doesn’t permit me to go into more depth here, though I hope that’s helpful.

    Is there anything else I can help out with here? Please don’t hesitate to let me know.

    Thanks!

    Julie 🙂
    SkyVerge

    Plugin Support Julie Martin

    (@julieskyverge)

    Hey there,

    Since we haven’t heard back from you in a while, I’m going to go ahead and mark this as resolved.

    If you have any other questions, please don’t hesitate to open up a new thread.

    Thanks so much!

    Julie 🙂
    SkyVerge

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.