• Resolved nillamary

    (@nillamary)


    Hi,
    I have a travel photography site and connected woocommerce (WC) to sell print-on-demand physical (not downloadable) products from pwinty/prodigi (print lab) via its API. I also connected the FeedThemGallery plugin to auto-populate photos into products.

    Created a Model product in WC with 2 sets of attributes: photo sizes (x4) and photo mediums (x8). Then, auto-generated 26 variations for each product (not all sizes are offered for all mediums). I’m testing one photo gallery that only contains 5 photos (products) and 26 variations for each product.

    Fist issue:

    • Used the print lab’s SKUs for the WC Model Product, but when SKUs generate and transfer to attributes/variations for each product, WC adds “-1, -2, -3” at the end of each SKU as it reads the SKU number from the original Model product, then increments. I can’t manually edit the SKUs for the auto-created product variations as this returns an “Invalid or duplicated SKU”. Is there a workaround? (I’ve deleted ‘orphaned’ everything but still returns this error.)
    • Second issue:
      The print lab offers many canvas products. While most of their products have unique SKUs, canvas products don’t. So, need to use the same SKU (eg GLOBAL-CAN-16×20, GLOBAL-CAN-20×30, GLOBAL-CAN-24X32) when ordering and then use the Wrap (mirror wrap, black wrap, white wrap, etc.) as the attribute.

    • However, as the print lab’s SKU for each canvas comes from the WC Model product when auto-populated (disregarding the incremented number issue for a moment), when sent to the print lab, it does not recognise the auto-populated SKU+wrap attribute eg. GLOBAL-CAN-16×20-WHITE-WRAP. The print lab only recognises the GLOBAL-CAN-16×20 part.
    • The print lab’s tech support advises to create own SKUs for WC, which I can then map to the print lab’s SKU+attribute when sending to the print lab. As my ecart is auto-fulfilment, I don’t understand how this can work or how to do this in WC?
    • Any help would be fantastic! Many thanks and Happy New Year!!

    • This topic was modified 3 years, 11 months ago by nillamary.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support mouli a11n

    (@mouli)

    @nillamary

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    I hope that helps you to figure it out.
    Feel free to get back to us if you have further questions.

    Hi there,

    We’ve not heard back from you in a while, so I’m marking this thread as resolved.

    Hopefully, you were able to find a solution to your problem! If you have further questions, please feel free to open a new topic.

    Thank you ??

    Thread Starter nillamary

    (@nillamary)

    Hi,

    Sorry for the late response.

    I have another ticket open that now touches on the SKU issue also: “Invalid or Duplicated SKU on importing Product csv”

    For some reason, I didn’t get an email notification from @mouli for this ticket, even though I have notifications on – weird.

    • First issue: still trying to resolve.
    • Second issue: resolved in the functions.php file. However, its success still depends on the first issue being resolved.
    • I still need help with the SKU increments, which I can’t have for the print lab. The print lab only recognises its own SKUs. So, SKUs for the 26 variations need to be replicated for each product.

      I still don’t understand why if WC creates unique IDs for each product, this is enough and WC shouldn’t touch SKUs for variations. Variation SKUs shouldn’t matter to WC as these are typically business-reliant and each business has its own set of SKUs. Or, am I missing something here? ??

    Hello @nillamary ,

    Okay, let’s get back to the first issue.

    If I understand correctly, you want to have the same SKU for all variations under a product. Is that correct?

    In general, WooCommerce expects all SKUs to be unique. Many stores maintain unique SKU for variations as well.

    Now, you have mentioned you are using some code in your theme’s fucntions.php file. Is the code looks like this? –

    add_filter( 'wc_product_has_unique_sku', '__return_false' );

    It will allow you to use the same SKU in products and variations.

    By default, WooCommerce will try to give a unique SKU for each variation. When you are creating the products manually you can decide not to have any SKU in variations. Now the API you are using could be forcing SKU on variations as well. You may want to contact with to seek suggestion how to prevent this.

    I am going to change the thread status to unresolved for now. Let’s see if someone else can share their suggestion.

    Thank you ??

    Thread Starter nillamary

    (@nillamary)

    Hi @rur165

    Thank you for the response and code. That worked! I could kiss you! Been trying to work this out for weeks! ??

    This is what I did (to help others):

    • After adding your code to functions.php, I ensured the Model product and separate product variations were blank.
    • Cleared out all the orphaned SKUs, etc.
    • Exported product .csv file
    • Edited product SKUs in .xls then re-saved to .csv file
    • Imported file successfully
    • Tested all product variations, which contained correct print lab SKUs
    • Tested an order via my website (https://test.nillasphotography.com/shop/) to print lab and everything worked!
    • The next question I have, that would be fantastic to achieve:
      As I only have the same 26 SKUs for variations for each product, is it possible to include these 26 SKUs in the functions.php file so that when the products are auto-populated from the FeedThemGallery plugin, the 26 SKU variations are also auto-populated SKUs?

      This would cut out a lot of manual work with the .csv file export/edit/import. I don’t want to add another plugin to my site.

    • This reply was modified 3 years, 10 months ago by nillamary.
    • This reply was modified 3 years, 10 months ago by nillamary.
    • This reply was modified 3 years, 10 months ago by nillamary.

    Hello @nillamary ,

    I am glad to know that the code helped.

    About your second question, I do not have an exact solution in hand. However, here is a great example code to auto-add variation SKUs.

    You will have to tweak them according to your need.

    This will be a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    If you need a paid solution, you can consider taking help from one of our partner’s website.

    Thank you ??

    Hi there,

    It’s been a while since we heard from you, so I’m marking this thread resolved. Hopefully, you’ve been able to resolve this, but if you haven’t, please open up a new topic and we’ll be happy to help out.

    Thank you ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Woocommerce increments SKUs & API issues’ is closed to new replies.