• Resolved pinguluk

    (@pinguluk)


    Hi!

    Great plugin.

    I want to ask if it’s possible to:

    • add a prefix to the SKU
    • set the sku / sku variations to be in uppercase
    • set the variations attributes individually to be used when it’s generating the skus (ex: for the attribute color named Negru use Neg, for the attribute sex named Barbati use B, for the attribute size named Large use LA etc)

    Thank you in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Steve

    (@skyvergesteve)

    Hey @pinguluk

    Thanks for contacting us about Product SKU Generator. I am happy to help out ??

    Glad you are enjoying the plugin!

    When you say you’re looking for a prefix, can you clarify for me what that should look like? For example, should this prefix be the same throughout the entire store, or does it depend on what kind of product the SKU is being generated for?

    Regarding setting the case and the variations, these would have to be done as a customization, which isn’t covered under our support policy. As such, implementing this isn’t something we can assist with directly.

    You can look through the source code here to get an idea of some of the filters that are in place and can be used, which may be of some help in getting this implemented.

    Can you please provide a bit more information on the prefix? I may be able to provide some filter ideas.

    Cheers,
    Steve
    SkyVerge

    Thread Starter pinguluk

    (@pinguluk)

    Hey @skyvergesteve,
    Thanks for your response.

    About the prefix, yeah, for my case I wanted to add a custom prefix throughout the entire store (ex: prefix CB_ => CB_TSHIRT, CB_PANTS, CB_GLASSES etc). But I achieved this by placing a function:

    // Sku generator uppercase
    function sku_generator_uppercase($sku) {
       $prefix = "CB-";
       return $prefix . strtoupper($sku);
    }
    add_filter('wc_sku_generator_sku', 'sku_generator_uppercase');

    Regarding the skus being to uppercase, I’ve added another function:

    // Variation sky generator uppercase
    function variation_sku_generator_uppercase($sku) {
       return strtoupper($sku);
    }
    add_filter('wc_sku_generator_variation_sku', 'variation_sku_generator_uppercase');

    The only thing that remains is the third point about the variations attributes individually, but for now I don’t really need it. Maybe you should add on the list of future upgrades.

    Plugin Support Steve

    (@skyvergesteve)

    Hey @pinguluk

    Glad you were able to figure out the methods to get these customizations in place! And thank you so much for sharing them, they will certainly prove to be useful to others looking for similar modifications to the plugin ??

    Regarding the request for setting the attributes individually, I will submit this feedback to be passed on to our develop team for consideration in future versions of the plugin.

    Again, thank you for the code snippets and the feedback on our plugin!

    Cheers,
    Steve
    SkyVerge

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Some good features’ is closed to new replies.