• Resolved EasySites

    (@easysites)


    Hi, I thank you for your plugin!
    I am trying to insert it directly inside the content-single.php file but without results.
    I have inserted the code
    <?php
    echo do_shortcode(‘[wp_cart_button name=”Test Product” price=”29.95″]’);
    ?>
    but I would like that the name of the product and the price will be taken automatically, without having to insert them manually.

    Can someone help me with how to modify the code to make it work correctly?

    Thank You!!

    https://www.ads-software.com/plugins/wordpress-simple-paypal-shopping-cart/

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

    (@mbrsolution)

    Hi, try something similar to the following example.

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

    Regards

    Plugin Contributor mbrsolution

    (@mbrsolution)

    Hi is your issue fixed?

    Thread Starter EasySites

    (@easysites)

    Sorry but no.
    Every post have a title and a price, that in php are the_title(); and the_price();
    I need that the button take automatically those information..

    Something like this

    <?php
    echo do_shortcode(‘[wp_cart_button name=”the_title();” price=”the_price();”]’);
    ?>

    but it does not work..

    Plugin Contributor mbrsolution

    (@mbrsolution)

    Hi here is a code someone shared to get the title and some extra features. This might provide some help.

    <?php echo do_shortcode(‘[wp_cart_button name=”‘. get_the_title() . ‘ “
                    price=”add your value here’. get_post_meta(get_the_ID(), ‘wpcf-price’, TRUE) . ‘” shipping=”4.99 var1=”Size | small | medium | large”]’); ?>
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to change php shortcode’ is closed to new replies.