Hello everyone.
I am stuck with creating "price change". I have PHP array with sizes+prices with strings like: "XXL+350Kc".
The part before "+" is shown as an option in select and the part between "+" and "K" is the value that I want to add to an initial price when an option is selected (without the page reload). I know this is time to use JS. But JS and me still are not the best friends So I would like to ask you for help.
This is light version of my code:
<div class=\"productProp\"><b>Price:</b></div><div class=\"productProp\">".$item['price']." Kc</div>";
if ($item['size'] <> "")
{
$size = explode(";", $item['size_value']); // getting the array of sizes+prices
echo "<div class=\"productProp\">SIZE:</div>
<div class=\"productProp\"><select name=\"size\">";
for ($i=0; $i<count($size); $i++)
{
$parsed_price[$i] = get_string_between($size1[$i], "+", "K"); //part with price - function is working so I am not including it to save space
$parsed_size[$i] = substr($size[$i],0,strrpos($size[$i],'+')); //part with size
echo "<option value=\"".$parsed_size[$i]."\" >".$parsed_size[$i]."</option>";
}
echo "</select></div>";
}