You can parse the URL for each parameter and then perform the price edits upon page load with jQuery. There are tough (but robust) ways to do this, and also very straight forward ways to do this.
Firslty, note that window.location
has a search
member, which contains all characters after and including a ?
in the url. With that knowledge you can just get the indexOf
whatever you are looking for in the URL parameters. If indexOf
returns something other than -1
you're in business.
$(document).ready(function(){
//Store the search.
var search = window.location.search;
//Look for the url parameter in the search.
if(search.indexOf("price=myprice") > -1){
//Go through each price element (Selector Should be the element containing the actual price number.)
$(".selector.to.price-text.element").each(function(){
//Calculate the new price based on the old price.
var newPrice = parseFloat($(this).text()) * 1.15;
//Put the new price onto the page. (Lines not condensed for readability).
$(this).text(newPrice);
});
}
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
The code above isn't going to be turn key for your application, you will need to change the selector at minimum.
As stated in the comments to your question by Paul Swetz you should track your price changes based on which user is viewing the page.