• Awais

    (@awais300)


    Hi,

    I’m using the setting “Generate a single SKU by combining the SKU set in each selected option” as shown in this screenshot https://i.imgur.com/AuQIQ6f.png

    Is there a pre-existing function that allows me to input a product ID and receive the generated SKU in return?





Viewing 1 replies (of 1 total)
  • Plugin Contributor Marc Lacroix

    (@marcusig)

    Hi there,

    There isn’t currently a specific function for this.

    Is there a pre-existing function that allows me to input a product ID and receive the generated SKU in return?

    I assume you area talking about order items.
    The SKU is saved as an order item meta.
    The meta Key is the SKU label you have entered in the settings, or by default SKU.

    So when you access an “order line item”, you should be able to do $item->get_meta( 'SKU' ), or whatever label you set for the SKU.

    Marc

Viewing 1 replies (of 1 total)
  • The topic ‘How to get the generated SKU’ is closed to new replies.