• I’ve got a webshop with woocommerce installed and I want to use the easy modal. I want to give the modal the product_id so that it can show the product details in the modal. But I can’t get it to work properly.

    The link for the modal
    <a data-product_id="<?php echo get_the_id(); ?>" data-product_sku="" rel="nofollow" class="button add_to_cart_button eModal-1 product_type_simple">+</a>

    What’s in the modal
    [product_page id="<?php echo $product_id; ?>"]

    Is there a way to keep the product_id always updated so it shows the right product in modal.

    https://www.ads-software.com/plugins/easy-modal/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Daniel Iser

    (@danieliser)

    @thatislife – In that case you would need to create a custom shortcode that you could then call the other shortcode dynamically with the current product ID.

    You can’t call php dynamically like that in the WP editors.

    Hope that helps.

    Thread Starter Thatislife

    (@thatislife)

    you gotta help me with that one… cause I’ve never made a custom shortcode before.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show woocommerce product by id in modal’ is closed to new replies.