Background - The page connects to an api to get some information. When it displays on the page I need to increase the price by 1.25% for the summer season.
This the info from the API: (this works)
<?php
$types = "a,b,c,camper-van";
$vehicles = json_decode(file_get_contents("https://api.outdoorsy.co/v0/rentals?owner_id=24019&limit=1000&full=true&type=" . $types), true);
$seasons = json_decode(file_get_contents("https://api.outdoorsy.co/v0/seasons?owner_id=24019&limit=1000"), true);
usort($vehicles, "custom_sort");
foreach ($vehicles as $vehicle):
?>
This is the displayed section of the page:
<p class="fleet-list-item_rates">
<strong>Sept. 15th – May 14th</strong>: <?php print(money_format('%.2n', $vehicle["price"]["day"] / 100)) ?> / day <em>*7 Days or More 14% Discount</em>
<?php
foreach($seasons as $season):
$price = find_price_within_season($season, $vehicle["id"]);
if ($price):
$day = $price["day"] / 100.0;
else:
$day = ($vehicle["price"]["day"] / 100.0) * ($season["adjust_price_percent"] / 100);
endif;
?>
<br>
<strong><?php print(friendly_date($season["from"])) ?> - <?php print(friendly_date($season["to"])) ?></strong>: <?php print(money_format('%.2n', $day)) ?> / day
<?php endforeach; ?>
</p>
This is my edit to add the addition 1.25%
<p class="fleet-list-item_rates">
<strong>May 14th - Sept. 15th</strong>: <?php print(money_format('%.2n', $vehicle["price"]["day"] / 100)) ?> / day <em>*7 Days or More 10% Discount</em>
<?php
$percentagechange = 1.25;
$numberToAdd = ($price / 100) * $percentagechange;
$newNumber = $price + $numberToAdd;
$newNumber = ["newNumber"];
foreach($seasons as $season):
$price = find_price_within_season($season, $vehicle["id"]);
if ($price):
$day = $price["day"] / 100.0;
else:
$day = ($vehicle["price"]["day"] / 100.0) * ($season["newNumber"] / 100);
endif;
?>
<br>
<strong><?php print(friendly_date($season["from"])) ?> - <?php print(friendly_date($season["to"])) ?></strong>: <?php print(money_format('%.2n', $day)) ?> / day
<?php endforeach; ?>
</p>
Just at a loss on how to increase the value by 1.25%.