• Resolved kyushubec

    (@kyushubec)


    Hello Marc,
    Sorry to bother you again!

    I used your great shortcode to imbed the configurator as you know.

    [mkl_configurator product_id=1 classes=”container-class something-else”]

    Now I have made a second product page, and I am using elementor which creates a “single product template” that is applied to all single products.
    This seems to mean when I specify a product ID in the shortcode, that ID is applied to all pages, so the two product pages I have made are embedding the same product.

    Is there a way I can get the shortcode to default to the product page it is on?

    Another way is if I make many elementor templates, but I’m having trouble getting that to go well.

    If there is a way from the code end, that would be very helpful.

    Thank you!

    https://woocommerce-384941-1559973.cloudwaysapps.com/product/meishi-ire

    https://woocommerce-384941-1559973.cloudwaysapps.com/product/passcase

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter kyushubec

    (@kyushubec)

    Just a little update, I figured out how to create multiple templates, updated the shortcodes in each and used tags to force them to their correct pages.
    This works, but it will be nice if I can use one template so I can keep design changes consistent across product pages.

    Thank you again if there is anything you can do to help.:)

    Plugin Contributor Marc Lacroix

    (@marcusig)

    Hi there,

    I’m looking into this. I haven’t used that feature of Elementor, so I’m not sure what can be done in Elementor, but there has to be a way to have content which is specific to the current product, as in you add the shortcode on the product edit page and not in the theme editor?

    Plugin Contributor Marc Lacroix

    (@marcusig)

    So I’ve had a look, and you can use the dynamic fields in the shortcode block:

    Once Post ID is selected, add [mkl_configurator product_id= in the before field and ] in the after field:

    This should produce the shortcode for the current product, so you don’t have to use one template per product.

    Note that I’m using an older version of Elementor, so they might have changed this slightly in recent versions.

    Thread Starter kyushubec

    (@kyushubec)

    Hi Marc,

    That worked perfectly!
    Thank you so much! ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Making the shortcode dynamic’ is closed to new replies.