Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor mbrsolution

    (@mbrsolution)

    Hi Denis Lam, one of the plugin developers will review your request and reply soon.

    Thank you

    Plugin Author mra13

    (@mra13)

    Hi Denis, I am not 100% sure how you plan to use it. If you give me an example use case scenario, I should be able to help.

    You can suggest an action hook or filter (where you see fit) and we will add it in the plugin.

    You can directly call a PHP function from another source and specify the product details. Here is an example usage:

    <?php echo print_wp_cart_button_for_product("Product Name","10.00"); ?>

    Thread Starter Denis Lam

    (@spiffyd)

    Let me see if the direct PHP function call will work for our scenario. It does look promising as I can probably create my own shortcode that executes your function. Can you give me all the attributes your function can accept? Because I know in your shortcode there are other attributes we can add in there such as shipping. Thank you!

    Plugin Author mra13

    (@mra13)

    Here is an example of the parameters you could pass:

    <?php echo print_wp_cart_button_for_product($name, $price, $shipping, $var1, $var2, $var3); ?>

    Alternatively, you can do the following too (you can use all the parameters available in the shortcode):

    <?php echo do_shortcode('[wp_cart_button name="Test Product" price="19.95"]'); ?>

    Thread Starter Denis Lam

    (@spiffyd)

    Your function print_wp_cart_button_for_product() and its parameters were perfect for my custom coding needs. There’s no need for you to add anything extra in your simple plugin! ??

    Plugin Author mra13

    (@mra13)

    Glad to hear that ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Customizing Your Shortcode for Dynamic Pricing’ is closed to new replies.