ecommerce: customer choice -> summing up checked values

Permalink
Hi,

what I'm trying to achieve is if I add a customer choice (multiple checkboxes) to a product I would like to have displayed the sum of the checked values so the customer will know how much he has to pay for the extras.

EXAMPLE:
<input type="checkbox"  name="extra_1" value="100"  />
<input type="checkbox"  name="extra_1" value="200"  />


So if both are checked I want to display the value "300".

If there is not a built in possibility I know how I would do it with javascript. The only problem here CONCRETE5 outputs stuff like this:
<input type="checkbox"  class="ccm-input-checkbox" name="akID[46][atSelectOptionID][]" id="akID[46][atSelectOptionID]_15" value="1"  />
with value=1 and I have no chance to access the real value of lets say 300 on this page.

Any ideas???
All help is much apprechiated.

Thanks
Toby

miosdesign
 
miosdesign replied on at Permalink Reply
miosdesign
NOT THE CLEANEST SOLUTION EVER - BUT IT WORKS:

ADD THESE LINES TO THE END OF packages/core_commerce/page_types/product_detail.php


<?PHP
$db=mysql_connect($SERVER-URL, $username, $password); mysql_select_db($databasename, $db);
   function empty_str($str) {
      return ($str=="");
   }
   function db_query($sql) {
      return mysql_query($sql);
   }
   function db_get($result) {
      return mysql_fetch_array($result);
   }
echo "<form name='extra' action='#'>";
      // PREISE
      $sql = "SELECT prPrice,   prSpecialPrice,productID     FROM CoreCommerceProducts;";
      $result = mysql_query($sql);
miosdesign replied on at Permalink Reply
miosdesign
BY THE WAY this solution does only recognice customer choices - select options from atCoreCommerceProductAdjustmentSelectOptions at the moment