• Resolved johnson0118

    (@johnson0118)


    I try to add sku to quote email in Quotes for WooCommerce. But I add ‘$items->get_sku()’ to ‘request-new-quote.php’, it doesn’t work. Please offer right sku code in Quotes for WooCommerce for reference to help me. Thanks for help.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Pinal Shah

    (@pinalshah)

    Hi @johnson0118,

    The correct way to call the get_sku() is to call it on a WC product object.

    So, something like the below would work:

    $_product = wc_get_product( $items->get_product_id() );
    $sku = $_product->get_sku();

    Please accept my apologies for the delay in response. In case if you have any further queries, please feel free to get in touch.

    Thanks,
    Pinal

    • This reply was modified 3 years, 5 months ago by Pinal Shah.
    Thread Starter johnson0118

    (@johnson0118)

    @pinalshah Thank you for your response. I recently found a method to add sku to quote Email. Add below code to foreach loop and <tr> tag, it works well.

    // add sku to foreach loop
    $product_id = $items->get_product_id();
    $_product = wc_get_product( $product_id );
    $sku = $_product->get_sku();
    // add sku end

    <!– add sku to <tr> tag –>
    <td style=”text-align:left; border: 1px solid #eee;”><?php echo wp_kses_post( $sku ); ?></td>
    <!– add sku end –>

    Thanks,
    Johnson

    • This reply was modified 3 years, 5 months ago by johnson0118.
    • This reply was modified 3 years, 5 months ago by johnson0118.
    • This reply was modified 3 years, 5 months ago by johnson0118.
    Plugin Author Pinal Shah

    (@pinalshah)

    Hi Johnson,

    I’m glad to know you were able to get this to work as desired. It would help me immensely if you would be so kind as to consider leaving a review for the plugin here.

    Thanks in advance,
    Pinal

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to Add Sku to quote Email’ is closed to new replies.