Show variations attributes in Woocommerce Added to Cart message (1 post)

  1. c28g
    Posted 2 years ago #

    Hi, there. Thank you for creating the great WooCommerce. :)

    I just recently use WooCommerce to build an e-commerce website. I've an issue when a product is added to cart and it shows the "added to cart" message. My website requires the "added to cart message" to show the summary/details of the product recently added such as title, price and variations.

    Right now, I managed to have the product title and the price detail of the product for both the simple and variation product type. However, I can't figure out when it comes to showing the product variation attributes for the variation product type (ex: color/size). I tried to use the
    get_post_meta( $productID, 'pa_size', true)
    but no luck for me. It shows all the variations value for the current product while I only need the selectedvariation value.

    For example, a product has color variation: Gold and Silver. If user choose Gold, I want it to return variation value or could be variation id of Gold.

    I wonder how to work this around since I'm quite stuck on the issue for quite a while. :)

    Thank you,


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic