Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Web Design (WordPress, Joomla, etc.) Simple php math question

  • Simple php math question

    Posted by Bryan Myhr on May 13, 2011 at 4:53 am

    I’ve got a e-commerce plugin that returns the product price with ”
    echo wpsc_the_product_price()” So I want to do some math to display a final price after mounting. This is what I have tried.

    <?php $price = wpsc_the_product_price();
    $mount = 19.75;
    echo $price + $mount;
    ?>

    As I am not fluent in php, this does not work. How do I call up that price into the math?

    Bryan Myhr replied 15 years, 2 months ago 1 Member · 1 Reply
  • 1 Reply
  • Bryan Myhr

    May 13, 2011 at 6:18 am

    Ok, I figured out that there was an extra space showing up and this fixed it, just in case anybody else runs into this.

    $price = substr(wpsc_the_product_price(),2);

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy