• Resolved Hazel Z.

    (@cadencehart)


    Hi! I’m a PHP newbie and I need assistance in modifying WP eStore shortcodes.

    Most of my posts’ contents are displayed via Custom Fields. Therefore, I need to use the shortcodes in theme files. Now the problem is, a product ID needs to be specified for every add to cart button. The original code below is not dynamic so I have to call a custom field in every post that specifies the product ID. (Note: I only display one product per page).

    Code to add in theme is:
    <?php echo get_button_code_for_product(1); ?>

    The More Fields Plugin function to call the product id is
    <?php meta('id'); ?>

    How do I merge these two functions to correctly display the add to cart button?

    Thank you so much for the help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Hazel Z.

    (@cadencehart)

    Found the solution. Here it is:

    <?php $productkey = get_post_meta($post->ID, 'wp-product-id', true); ?>
    <?php echo get_button_code_for_product($productkey); ?>

    Can you elaborate on this one?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WP eStore Shortcode Help (PHP required)’ is closed to new replies.