Support » Plugin: WooCommerce » Get values from Woocommerce product infos into shortcode

  • Resolved gianni333

    (@gianni333)


    Hi,
    I wondered if it is possible to get value (e.g. product title) from the product info to use them as let’s say a button name.

    I have the shortcode [maxbutton name=”View in 3D”] and I’d like the name to be that dynamic value product title, so I can add that button to the product template with anywhere elementor and have the button title be always the title of the respective product.

    Does anybody know if that’s possible and how?

    Thanks for any help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • If you are in product template you can use $product variable and get anything you want from product ie. $product->get_name();.

    Thanks a lot for your help. I can’t edit the product template directly (because don’t know how to^^), I’m using anywhere elementor instead to create product templates. Is there also a way to reference the product title directly into the html editor in wordpress?

    Plugin Support RK

    (@riaanknoetze)

    The best would be to get in touch with a web developer to make the necessary changes. WooCommerce itself doesn’t have any direct impact on the shortcodes of other plugins.

    I’m also closing this thread for now as it’s only geared towards support of the default WooCommerce plugins itself.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Get values from Woocommerce product infos into shortcode’ is closed to new replies.