Ejemplo n.º 1
0
						<?php 
    $storevalue = '';
    $currdata = array();
    $base_currency_id = "";
    // If all currency fields r filled
    $currfilled = 1;
    $multiCurrencies = 0;
    if (count($curr) > 1) {
        $multiCurrencies = 1;
    }
    // key contain 0,1,2... // value contain INR...
    foreach ($curr as $key => $value) {
        //$name="jform[attribs][$value]";
        $currvalue = "";
        if (!empty($pid)) {
            $currvalue = $quick2cartModelAttributes->getCurrenciesvalue($pid, $value, $client);
        }
        $storevalue = isset($currvalue[0]['price']) ? $currvalue[0]['price'] : '';
        if (empty($storevalue)) {
            $currfilled = 0;
        }
        if (!empty($curr_syms[$key])) {
            $currtext = $curr_syms[$key];
        } else {
            $currtext = $value;
        }
        ?>

							<?php 
        if ($multiCurrencies) {
            ?>
Ejemplo n.º 2
0
 function getProdPriceWithDefltAttributePrice($item_id)
 {
     $return = array();
     $return['itemdetail'] = array();
     $helperobj = new comquick2cartHelper();
     $curr = $helperobj->getCurrencySession();
     $path = JPATH_SITE . DS . 'components/com_quick2cart/models/attributes.php';
     if (!class_exists('quick2cartModelAttributes')) {
         JLoader::register('quick2cartModelAttributes', $path);
         JLoader::load('quick2cartModelAttributes');
     }
     $quick2cartModelAttributes = new quick2cartModelAttributes();
     //  GETTING ITEM_DETAILS
     $item_details = $quick2cartModelAttributes->getCurrenciesvalue('0', $curr, 'com_quick2cart', $item_id);
     if (!empty($item_details[0])) {
         $return['itemdetail'] = $item_details[0];
     }
     //  GETTING ATTRIBUTE DETAILS
     $attribure_option_ids = array();
     $tot_att_price = 0;
     $allAttr = $quick2cartModelAttributes->getItemAttributes($item_id);
     if (!empty($allAttr)) {
         foreach ($allAttr as $attr) {
             //  if cumpulsory then only consider price ( i.e attribute_compulsary=0)
             if (!empty($attr->attribute_compulsary)) {
                 $attr_details = $helperobj->getAttributeDetails($attr->itemattribute_id);
                 foreach ($attr_details as $options) {
                     if ($options->ordering == 1 && !empty($options->{$curr})) {
                         $attribure_option_ids[] = $options->itemattributeoption_id;
                         $tot_att_price += $options->{$curr};
                         break;
                     }
                     //  consider prefix also
                 }
             }
         }
     }
     $attrDetails = array();
     $attrDetails['tot_att_price'] = $tot_att_price;
     $attrDetails['attrOptionIds'] = $attribure_option_ids;
     $return['attrDetail'] = $attrDetails;
     return $return;
 }