• tancrystal

    (@tancrystal)


    Hi guys!

    Any idea how I can add text (that changes based on the variation selected) beside the Woocommerce single product page quantity selector?

    I have the following attributes/variations now:


    Size – Size A and Size B

    Units – Box and Case

    I want the title “Box” or “Case” to display next to the quantity selector on the single product page.

    If the user selects “Box”, the text “Box” would appear next to the quantity selector

    If the user selects “Case”, the text “Case” would appear next to the quantity selector

    Any idea how I can achieve this?

    Thank you!

    A similar topic has been resolved. But the solution is only for static text beside the quantity selector. No mention of text changing based on the variation selected. Here is the topic link: https://ww.wp.xz.cn/support/topic/add-a-label-to-the-quantity-selector-1?replies=8#post-8407546

Viewing 1 replies (of 1 total)
  • I think that’s a big ask as a development for just one site. There is a WooCommerce JavaScript script in the page that monitors the user’s selected variation, fetches the variation’s data (sometime by Ajax) and inserts the relevant image, price, stock and description into the markup. It would be necessary to recraft that script to also add the relevant units. The customised script would need to be kept synchronised with WooCommerce changes.

    Try looking at units-type plugins at ww.wp.xz.cn, woocommerce.com and codecanyon.com.

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Woocommerce] text beside quantity selector based on selected variation’ is closed to new replies.