PHP Math Forula

General questions relating to Joomla! 1.5 There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Locked
virtuemart_new
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Nov 03, 2011 5:18 am

PHP Math Forula

Post by virtuemart_new » Thu Nov 03, 2011 5:27 am

Our website allocates 2% of our sales to a local charity and we wanted to create a formula in the PHP file so it would display under the product asking price.

Therefore, I used the following formula, although it comes out 0. . . I assumed product_price was the sales price and not sure if I need to use another description to link to a sales price???????

<?php
$first_number=product_price;
$second_number=.02;
$sum_total=$second_number*$first_number;
Print($sum_total);
?>

Any help would be appreciated and again, trying to take the sales price of an item and simply show what 2% is below it on the product display. This is the allocation we send to our charity

Locked

Return to “General Questions/New to Joomla! 1.5”