} else { ?> <?php echo $currency_attributes[0] . " " . number_format($price, 2, ".", ""); ?> <?php } ?> </p> </td> <td valign="top" align="center"> <?php // get Shipping price of each product $shippingControl = clsGenerateShippingControl::getShippingControlProduct($product_id, $product_option_id, $userid, $destination_country, $destination_state, $destination_zip); if (count($shippingControl) > 0) { // render shipping price select control echo $shippingControl['selectControl']; $shippingtotal = $shippingtotal + $shippingControl['shipppingPrice']; } $taxProductPrice = $price; if ($discountrate != "") { $taxProductPrice = $discountrate; } if ($discountrate > 0) { $totaltaxCart += $discountrate; } else { $totaltaxCart += $price; } /* if($rw['eProductTaxExempt']=="N")
public static function getShippingControlProduct($productid = 0, $productOptionId = 0, $userId = "", $destination_country = "", $destination_state = "", $destination_zip = "") { // get shipping price for product $resultShippingArray = clsGenerateShippingControl::getShippingPriceProduct($productid, $productOptionId, $userId, $destination_country, $destination_state, $destination_zip); $currency_attributes = displayCurrencyType(); $shippingPrice = 0; if (count($resultShippingArray) == 0) { $shippingControl .= " <option value='0'>Shipping rates not available</option>"; } else { // foreach ($productArray AS $key=>$val) { if (count($resultShippingArray[$productOptionId]) > 0) { $chkCnt = 0; $error = 0; foreach ($resultShippingArray[$productOptionId] as $eachShippingArr) { $chkCnt++; $radiochecked = ""; $serviceName = $val; $display_shipping_rate = ConvertUSDollorToUserCurrency($currency_attributes[2]) * $eachShippingArr['rate']; $display_shipping_rate = number_format($display_shipping_rate, 2, ".", ""); if ($chkCnt == 1) { $shippingPrice = $display_shipping_rate; } $value1 = $eachShippingArr['service_name'] . '=>' . number_format($eachShippingArr['rate'], 2, '.', ''); $shippingControl .= "<option value='" . $value1 . "'>" . $eachShippingArr['service_name'] . " " . $currency_attributes[0] . " " . $display_shipping_rate . "</option>"; } // for each product shipping } else { $shippingControl .= " <option value='0'>Shipping rates not available</option>"; } } $selectControl = "<select name='shipping_option_" . $productOptionId . "' id='productshipping_" . $productOptionId . "' onchange=calculateCartTotal('" . $productOptionId . "') class='chk_shipping_price' >" . $shippingControl . "</select>"; $currentControle = array("selectControl" => $selectControl, "shipppingPrice" => $shippingPrice); // $shippingControl = "<select name='shipping_option_"+$productOptionId+"' id='productshipping"+$productOptionId+"'>". $shippingControl "</select>"; return $currentControle; }