php - Using Smarty or jQuery to calculate values, not sure which?

Solution:
Worked out my solution and it is as follows:
{if $product.bean_bag_filling_150 == "Y" && $product.bean_bag_filling_300 == "Y"}
{math assign="bb_qty_150_total" equation="x * y" x=$product.bean_bag_quantity_150 y=150}
{math assign="bb_qty_300_total" equation="x * y" x=$product.bean_bag_quantity_300 y=300}
<p>DEBUG: Total: {math equation="x + y" x=$bb_qty_150_total y=$bb_qty_300_total}</p>
{elseif $product.bean_bag_filling_150 == "Y" && $product.bean_bag_filling_300 == "N"}
<p>DEBUG: Total: {math equation="x * y" x=$product.bean_bag_quantity_150 y=150}</p>
{elseif $product.bean_bag_filling_150 == "N" && $product.bean_bag_filling_300 == "Y"}
<p>DEBUG: Total: {math equation="x * y" x=$product.bean_bag_quantity_300 y=300}</p>
{/if}
if anyone knows or a better solution please feel free to share :)
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: target class [commandmakecommand] does not exist.
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.