function convert_product_attributes_result($attributes_values, $load_option_name = true, $can_operate = false)
 {
     if ($load_option_name) {
         $attributes_values->fields['products_options_name'] = zen_options_name($attributes_values->fields['options_id']);
         $attributes_values->fields['products_options_values_name'] = zen_values_name($attributes_values->fields['options_values_id']);
     }
     $attributes_values->fields['products_display_price'] = $attributes_values->fields['price_prefix'] . $attributes_values->fields['options_values_price'];
     $attributes_values->fields['products_attributes_display_weight'] = $attributes_values->fields['products_attributes_weight_prefix'] . $attributes_values->fields['products_attributes_weight'];
     require_once DIR_WS_CLASSES . 'currencies.php';
     $currencies = new currencies();
     $attributes_price_final = zen_get_attributes_price_final($attributes_values->fields["products_attributes_id"], 1, $attributes_values, 'false');
     $attributes_price_final_value = $attributes_price_final;
     $attributes_price_final = $currencies->display_price($attributes_price_final, zen_get_tax_rate(1), 1);
     $attributes_price_final_onetime = zen_get_attributes_price_final_onetime($attributes_values->fields["products_attributes_id"], 1, $attributes_values);
     $attributes_price_final_onetime = $currencies->display_price($attributes_price_final_onetime, zen_get_tax_rate(1), 1);
     $new_attributes_price = '';
     if ($attributes_values->fields["attributes_discounted"]) {
         $new_attributes_price = zen_get_attributes_price_final($attributes_values->fields["products_attributes_id"], 1, '', 'false');
         $new_attributes_price = zen_get_discount_calc($attributes_values->fields['products_id'], true, $new_attributes_price);
         if ($new_attributes_price != $attributes_price_final_value) {
             $new_attributes_price = '|' . $currencies->display_price($new_attributes_price, zen_get_tax_rate(1), 1);
         } else {
             $new_attributes_price = '';
         }
     }
     $attributes_values->fields['attributes_display_price_final'] = $attributes_price_final . $new_attributes_price . ' ' . $attributes_price_final_onetime;
     // status
     $attributes_values->fields['products_status'] = "";
     foreach ($this->statuses as $type => $icon_info) {
         $attributes_values->fields['products_status'] .= self::make_status_link($attributes_values->fields, $type, $icon_info['color'], $icon_info['alt'], $can_operate);
     }
     return $attributes_values->fields;
 }
                ?>
</td>
            <td class="main"><?php 
                echo zen_draw_input_field('discount_price[' . $discount_name[$i]['id'] . ']', $discount_name[$i]['discount_price']);
                ?>
</td>
// Dual Pricing start
	        <td class="main"><?php 
                echo zen_draw_input_field('discount_price_w[' . $discount_name[$i]['id'] . ']', $discount_name[$i]['discount_price_w']);
                ?>
</td>
<?php 
                if (DISPLAY_PRICE_WITH_TAX_ADMIN == 'true') {
                    ?>
            <td class="main" align="right"><?php 
                    echo $currencies->display_price($discounted_price, '', 1) . ' ' . $currencies->display_price($discounted_price, zen_get_tax_rate(1), 1);
                    ?>
</td>
	    <td class="main" align="right"><?php 
                    echo $currencies->display_price_w($discounted_price_w, '', 1) . ' ' . $currencies->display_price_w($discounted_price_w, zen_get_tax_rate(1), 1);
                    ?>
</td>
            <td class="main" align="right"><?php 
                    echo ' x ' . number_format($discount_name[$i]['discount_qty']) . ' = ' . $currencies->display_price($discounted_price, '', $discount_name[$i]['discount_qty']) . ' ' . $currencies->display_price($discounted_price, zen_get_tax_rate(1), $discount_name[$i]['discount_qty']);
                    ?>
</td>
	    <td class="main" align="right"><?php 
                    echo ' x ' . number_format($discount_name[$i]['discount_qty']) . ' = ' . $currencies->display_price_w($discounted_price_w, '', $discount_name[$i]['discount_qty']) . ' ' . $currencies->display_price_w($discounted_price_w, zen_get_tax_rate(1), $discount_name[$i]['discount_qty']);
                    ?>
</td>
<?php 
示例#3
0
         $limit = @mysql_result($groups_query, 0, "customers_status_accumulated_limit");
         $current_discount = @mysql_result($groups_query, 0, "customers_status_discount");
         if ($customer['customers_status'] != $customers_groups_id) {
             if ($changed) {
                 // send emails
                 // assign language to template for caching
                 $vamTemplate->assign('language', $_SESSION['language']);
                 $vamTemplate->caching = false;
                 // set dirs manual
                 $vamTemplate->assign('tpl_path', 'templates/' . CURRENT_TEMPLATE . '/');
                 $vamTemplate->assign('logo_path', HTTP_SERVER . DIR_WS_CATALOG . 'templates/' . CURRENT_TEMPLATE . '/img/');
                 $vamTemplate->assign('CUSTOMERNAME', $check_status['customers_name']);
                 $vamTemplate->assign('EMAIL', $check_status['customers_email_address']);
                 $vamTemplate->assign('GROUPNAME', $customers_groups_name);
                 $vamTemplate->assign('GROUPDISCOUNT', $current_discount);
                 $vamTemplate->assign('ACCUMULATED_LIMIT', $currencies->display_price($limit, 0));
                 //email to admin
                 $html_mail_admin = $vamTemplate->fetch(CURRENT_TEMPLATE . '/admin/mail/' . $_SESSION['language'] . '/accumulated_discount_admin.html');
                 $txt_mail_admin = $vamTemplate->fetch(CURRENT_TEMPLATE . '/admin/mail/' . $_SESSION['language'] . '/accumulated_discount_admin.txt');
                 vam_php_mail(EMAIL_BILLING_ADDRESS, EMAIL_BILLING_NAME, STORE_OWNER_EMAIL_ADDRESS, STORE_OWNER, '', EMAIL_BILLING_REPLY_ADDRESS, EMAIL_BILLING_REPLY_ADDRESS_NAME, '', '', EMAIL_ACC_SUBJECT, $html_mail_admin, $txt_mail_admin);
                 //email to customer
                 $html_mail_customer = $vamTemplate->fetch(CURRENT_TEMPLATE . '/admin/mail/' . $_SESSION['language'] . '/accumulated_discount_customer.html');
                 $txt_mail_customer = $vamTemplate->fetch(CURRENT_TEMPLATE . '/admin/mail/' . $_SESSION['language'] . '/accumulated_discount_customer.txt');
                 vam_php_mail(EMAIL_BILLING_ADDRESS, EMAIL_BILLING_NAME, $check_status['customers_email_address'], $check_status['customers_name'], '', EMAIL_BILLING_REPLY_ADDRESS, EMAIL_BILLING_REPLY_ADDRESS_NAME, '', '', EMAIL_ACC_SUBJECT, $html_mail_customer, $txt_mail_customer);
             }
         }
     }
     // eof denuz added accumulated discount
 }
 if ($order_updated == true) {
     $messageStack->add_session(BUS_ORDER . $this_orderID . ' ' . BUS_SUCCESS, 'success');
        $link_to = '<a href="orders.php?action=edit&oID=' . $affiliate_sales['affiliate_orders_id'] . '">' . $affiliate_sales['affiliate_orders_id'] . '</a>';
        ?>
            <td class="dataTableContent"><?php 
        echo $affiliate_sales['affiliate_firstname'] . " " . $affiliate_sales['affiliate_lastname'];
        ?>
</td>
            <td class="dataTableContent" align="center"><?php 
        echo vam_date_short($affiliate_sales['affiliate_date']);
        ?>
</td>
            <td class="dataTableContent" align="right"><?php 
        echo $link_to;
        ?>
</td>
            <td class="dataTableContent" align="right">&nbsp;&nbsp;<?php 
        echo $currencies->display_price($affiliate_sales['affiliate_value'], '');
        ?>
</td>
            <td class="dataTableContent" align="right"><?php 
        echo $affiliate_sales['affiliate_percent'] . "%";
        ?>
</td>
            <td class="dataTableContent" align="right">&nbsp;&nbsp;<?php 
        echo $currencies->display_price($affiliate_sales['affiliate_payment'], '');
        ?>
</td>
            <td class="dataTableContent" align="center"><?php 
        if ($affiliate_sales['orders_status']) {
            echo $affiliate_sales['orders_status'];
        } else {
            echo TEXT_DELETED_ORDER_BY_ADMIN;
示例#5
0
            for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
                echo '<br><nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];
                if ($order->products[$i]['attributes'][$j]['price'] != '0') {
                    echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';
                }
                echo '</i></small></nobr>';
            }
        }
        // BOF: Attributes Product Codes - If product code exists, use it, else default to product model.
        echo '            </td>' . "\n";
        if (tep_not_null($order->products[$i]['code'])) {
            echo '            <td class="dataTableContent" valign="top">' . $order->products[$i]['code'] . '</td>' . "\n";
        } else {
            echo '            <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n";
        }
        echo '            <td class="dataTableContent" align="right" valign="top">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n" . '            <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->display_price($order->products[$i]['final_price'], 0, 1, $order->info['currency']) . '</b></td>' . "\n" . '            <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], 1, $order->info['currency']) . '</b></td>' . "\n" . '            <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->display_price($order->products[$i]['final_price'], 0, $order->products[$i]['qty'], $order->info['currency']) . '</b></td>' . "\n" . '            <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty'], $order->info['currency']) . '</b></td>' . "\n";
        echo '          </tr>' . "\n";
    }
    ?>
          <tr>
            <td align="right" colspan="8"><table border="0" cellspacing="0" cellpadding="2">
<?php 
    for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
        echo '              <tr>' . "\n" . '                <td align="right" class="smallText">' . $order->totals[$i]['title'] . '</td>' . "\n" . '                <td align="right" class="smallText">' . $order->totals[$i]['text'] . '</td>' . "\n" . '              </tr>' . "\n";
    }
    ?>
            </table></td>
          </tr>
        </table></td>
      </tr>
      <tr>
示例#6
0
     echo '<tr class="dataTableRow">' . "\n";
     echo '<td class="dataTableContent" align="right"><b>' . ADDPRODUCT_TEXT_STEP . ' 3: </b></td>' . "\n";
     echo '<td class="dataTableContent" valign="top" colspan="2"><i>' . ADDPRODUCT_TEXT_OPTIONS_NOTEXIST . '</i></td>' . "\n";
     echo '</tr>' . "\n";
     $_POST['step'] = 4;
 } else {
     echo '<tr class="dataTableRow">' . tep_draw_form('addProduct', FILENAME_ORDERS_EDIT, 'oID=' . $_GET['oID'] . '&action=' . $_GET['action']) . "\n";
     echo '<td class="dataTableContent" align="right"><b>' . ADDPRODUCT_TEXT_STEP . ' 3: </b></td><td class="dataTableContent" valign="top">';
     $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $_POST['add_product_products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int) $languages_id . "' order by popt.products_options_name");
     while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
         $products_options_array = array();
         $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . $_POST['add_product_products_id'] . "' and pa.options_id = '" . (int) $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int) $languages_id . "'");
         while ($products_options = tep_db_fetch_array($products_options_query)) {
             $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
             if ($products_options['options_values_price'] != '0') {
                 $products_options_array[sizeof($products_options_array) - 1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . ') ';
             }
         }
         if (isset($_POST['add_product_options'])) {
             $selected_attribute = $_POST['add_product_options'][$products_options_name['products_options_id']];
         } else {
             $selected_attribute = false;
         }
         echo $products_options_name['products_options_name'] . ':' . "\n";
         echo tep_draw_pull_down_menu('add_product_options[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute) . '<br />' . "\n";
     }
     echo '</td>';
     echo '<td class="dataTableContent" align="center"><input type="submit" value="' . ADDPRODUCT_TEXT_OPTIONS_CONFIRM . '">';
     echo '<input type="hidden" name="add_product_categories_id" value=' . $_POST['add_product_categories_id'] . '>';
     echo '<input type="hidden" name="add_product_products_id" value=' . $_POST['add_product_products_id'] . '>';
     echo '<input type="hidden" name="step" value="4">';
          </tr>
          <tr>
            <td colspan="10"><?php 
                echo zen_black_line();
                ?>
</td>
          </tr>
          <tr>
<?php 
            } else {
                // attributes display listing
                // calculate current total attribute price
                // $attributes_values
                $attributes_price_final = zen_get_attributes_price_final($attributes_values->fields["products_attributes_id"], 1, $attributes_values, 'false');
                $attributes_price_final_value = $attributes_price_final;
                $attributes_price_final = $currencies->display_price($attributes_price_final, zen_get_tax_rate($product_check->fields['products_tax_class_id']), 1);
                $attributes_price_final_onetime = zen_get_attributes_price_final_onetime($attributes_values->fields["products_attributes_id"], 1, $attributes_values);
                $attributes_price_final_onetime = $currencies->display_price($attributes_price_final_onetime, zen_get_tax_rate($product_check->fields['products_tax_class_id']), 1);
                ?>
            <td class="smallText">&nbsp;<?php 
                echo $attributes_values->fields["products_attributes_id"];
                ?>
&nbsp;</td>
            <td class="smallText">&nbsp;<?php 
                // echo $products_name_only;
                ?>
&nbsp;</td>
            <td class="smallText">&nbsp;<?php 
                echo $options_name;
                ?>
&nbsp;</td>
          </tr>
          <tr>
            <td colspan="10"><?php 
                echo zen_black_line();
                ?>
</td>
          </tr>
          <tr>
<?php 
            } else {
                // attributes display listing
                // calculate current total attribute price
                // $attributes_values
                $attributes_price_final = zen_get_attributes_price_final($attributes_values->fields["products_attributes_id"], 1, $attributes_values, 'false');
                $attributes_price_final_value = $attributes_price_final;
                $attributes_price_final = $currencies->display_price($attributes_price_final, zen_get_tax_rate(1), 1);
                $attributes_price_final_onetime = zen_get_attributes_price_final_onetime($attributes_values->fields["products_attributes_id"], 1, $attributes_values);
                $attributes_price_final_onetime = $currencies->display_price($attributes_price_final_onetime, zen_get_tax_rate(1), 1);
                ?>
            <td class="smallText">&nbsp;<?php 
                echo $attributes_values->fields["products_attributes_id"];
                ?>
&nbsp;</td>
            <td class="smallText">&nbsp;<?php 
                // echo $products_name_only;
                ?>
&nbsp;</td>
            <td class="smallText">&nbsp;<?php 
                echo $options_name;
                ?>
&nbsp;</td>
     //loop all the products in the order
     $products_ordered_attributes = '';
     // Raymond Burns not sure about code below. THIS SEEMS TO BE DEPRECATED CODE TO BE REMOVED
     if (isset($order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > 0) {
         for ($j = 0, $n2 = sizeof($order->products[$i]['attributes']); $j < $n2; $j++) {
             $products_ordered_attributes .= "\n\t" . $order->products[$i]['attributes'][$j]['option'] . ' ' . $order->products[$i]['attributes'][$j]['value'];
         }
     }
     /* ** Altered for CCGV ** */
     $total_weight += $order->products[$i]['qty'] * $order->products[$i]['weight'];
     $total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
     $total_cost += $total_products_price;
     /* ** EOF alterations for CCGV ** */
     if ($order->products[$i]['model']) {
         /* ** Altered for Mail Manager **/
         $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n" . '<br />';
     } else {
         $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n" . '<br />';
     }
     /* ** EOF alteration for Mail Manager **/
 }
 $Text_Billing_Adress = "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . $order->billing['name'] . "\n";
 if ($order->billing['company']) {
     $Text_Billing_Adress .= $order->billing['company'] . "\n";
 }
 $Text_Billing_Adress .= $order->billing['street_address'] . "\n";
 if ($order->billing['suburb']) {
     $Text_Billing_Adress .= $order->billing['suburb'] . "\n";
 }
 $Text_Billing_Adress .= $order->billing['city'] . "\n";
 if ($order->billing['state']) {
示例#10
0
}
$affiliate_amount = $affiliate_sales['total'];
if ($affiliate_transactions > 0) {
    $affiliate_average = tep_round($affiliate_amount / $affiliate_transactions, 2);
} else {
    $affiliate_average = "n/a";
}
$affiliate_commission = $affiliate_sales['payment'];
$affiliates_raw = "select count(*) as count from " . TABLE_AFFILIATE . "";
$affiliates_raw_query = tep_db_query($affiliates_raw);
$affiliates_raw = tep_db_fetch_array($affiliates_raw_query);
$affiliate_number = $affiliates_raw['count'];
$heading = array();
$contents = array();
$heading[] = array('params' => 'class="menuBoxHeading"', 'text' => BOX_TITLE_AFFILIATES);
$contents[] = array('params' => 'class="infoBox"', 'text' => BOX_ENTRY_AFFILIATES . ' ' . $affiliate_number . '<br>' . BOX_ENTRY_CONVERSION . ' ' . $affiliate_conversions . '<br>' . BOX_ENTRY_COMMISSION . ' ' . $currencies->display_price($affiliate_commission, ''));
$box = new box();
echo $box->menuBox($heading, $contents);
echo '<br>';
//
$contents = array();
if (getenv('HTTPS') == 'on') {
    $size = getenv('SSL_CIPHER_ALGKEYSIZE') ? getenv('SSL_CIPHER_ALGKEYSIZE') . '-bit' : '<i>' . BOX_CONNECTION_UNKNOWN . '</i>';
    $contents[] = array('params' => 'class="infoBox"', 'text' => tep_image(DIR_WS_ICONS . 'locked.gif', ICON_LOCKED, '', '', 'align="right"') . sprintf(BOX_CONNECTION_PROTECTED, $size));
} else {
    $contents[] = array('params' => 'class="infoBox"', 'text' => tep_image(DIR_WS_ICONS . 'unlocked.gif', ICON_UNLOCKED, '', '', 'align="right"') . BOX_CONNECTION_UNPROTECTED);
}
$box = new box();
echo $box->tableBlock($contents);
?>
                    </td>
            break;
        default:
            if (is_object($aInfo)) {
                $heading[] = array('text' => HTML_B_START . $aInfo->affiliate_firstname . BLANK . $aInfo->affiliate_lastname . HTML_B_END);
                $contents[] = array('align' => 'center', 'text' => HTML_A_START . olc_href_link(FILENAME_AFFILIATE, olc_get_all_get_params(array('acID', 'action')) . 'acID=' . $aInfo->affiliate_id . '&action=edit') . '">' . olc_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . olc_href_link(FILENAME_AFFILIATE, olc_get_all_get_params(array('acID', 'action')) . 'acID=' . $aInfo->affiliate_id . '&action=confirm') . '">' . olc_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . olc_href_link(FILENAME_AFFILIATE_CONTACT, 'selected_box=affiliate&affiliate=' . $aInfo->affiliate_email_address) . '">' . olc_image_button('button_email.gif', IMAGE_EMAIL) . HTML_A_END);
                $affiliate_sales_raw = "select count(*) as count, sum(affiliate_value) as total, sum(affiliate_payment) as payment from " . TABLE_AFFILIATE_SALES . " a left join " . TABLE_ORDERS . " o on (a.affiliate_orders_id=o.orders_id)\n        where o.orders_status >= " . AFFILIATE_PAYMENT_ORDER_MIN_STATUS . " and  affiliate_id = '" . $aInfo->affiliate_id . APOS;
                $affiliate_sales_values = olc_db_query($affiliate_sales_raw);
                $affiliate_sales = olc_db_fetch_array($affiliate_sales_values);
                $contents[] = array('text' => HTML_BR . TEXT_DATE_ACCOUNT_CREATED . BLANK . olc_date_short($aInfo->date_account_created));
                $contents[] = array('text' => EMPTY_STRING . TEXT_DATE_ACCOUNT_LAST_MODIFIED . BLANK . olc_date_short($aInfo->date_account_last_modified));
                $contents[] = array('text' => EMPTY_STRING . TEXT_INFO_DATE_LAST_LOGON . BLANK . olc_date_short($aInfo->date_last_logon));
                $contents[] = array('text' => EMPTY_STRING . TEXT_INFO_NUMBER_OF_LOGONS . BLANK . $aInfo->number_of_logons);
                $contents[] = array('text' => EMPTY_STRING . TEXT_INFO_COMMISSION . BLANK . $aInfo->affiliate_commission_percent . ' %');
                $contents[] = array('text' => EMPTY_STRING . TEXT_INFO_COUNTRY . BLANK . $aInfo->countries_name);
                $contents[] = array('text' => EMPTY_STRING . TEXT_INFO_NUMBER_OF_SALES . BLANK . $affiliate_sales['count'], EMPTY_STRING);
                $contents[] = array('text' => EMPTY_STRING . TEXT_INFO_SALES_TOTAL . BLANK . $currencies->display_price($affiliate_sales['total'], EMPTY_STRING));
                $contents[] = array('text' => EMPTY_STRING . TEXT_INFO_AFFILIATE_TOTAL . BLANK . $currencies->display_price($affiliate_sales['payment'], EMPTY_STRING));
            }
            break;
    }
    if (olc_not_null($heading) && olc_not_null($contents)) {
        echo '            <td width="25%" valign="top">' . NEW_LINE;
        $box = new box();
        echo $box->infoBox($heading, $contents);
        echo '            </td>' . NEW_LINE;
    }
    ?>
          </tr>
        </table></td>
      </tr>
<?php 
示例#12
0
function b_specials()
{
    global $currency, $currencies, $languages_id, $xoopsDB, $xoopsConfig, $customer_group, $customer_id, $_GET;
    /* if(!defined("XOSC_BLOCK") && !defined("XOSC_CONFIG")) {
      define("XOSC_BLOCK",1);
      require_once(XOOPS_ROOT_PATH."/modules/osC/includes/application_top.php");
     }
    */
    // Config Part
    require_once XOOPS_ROOT_PATH . "/modules/osC/includes/configure.php";
    require_once XOOPS_ROOT_PATH . "/modules/osC/includes/database_tables.php";
    require_once XOOPS_ROOT_PATH . "/modules/osC/includes/filenames.php";
    require_once XOOPS_ROOT_PATH . "/modules/osC/includes/functions/database.php";
    require_once XOOPS_ROOT_PATH . "/modules/osC/includes/functions/general.php";
    require_once XOOPS_ROOT_PATH . "/modules/osC/includes/functions/html_output.php";
    require_once XOOPS_ROOT_PATH . "/modules/osC/includes/classes/boxes.php";
    require_once XOOPS_ROOT_PATH . "/modules/osC/includes/classes/currencies.php";
    require_once XOOPS_ROOT_PATH . "/modules/osC/includes/classes/product.php";
    require_once XOOPS_ROOT_PATH . "/modules/osC/includes/classes/customer_group.php";
    require_once XOOPS_ROOT_PATH . "/modules/osC/includes/languages/" . $xoopsConfig['language'] . ".php";
    //$currencies = new currencies();
    if (!isset($customer_group)) {
        if (!isset($_SESSION['customer_id'])) {
            $customer_group = new customer_group(0);
        } else {
            $customer_group = new customer_group($_SESSION['customer_id']);
        }
    }
    if (!defined('XBLOCK_CONFIG')) {
        $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);
        while ($configuration = tep_db_fetch_array($configuration_query)) {
            define($configuration['cfgKey'], $configuration['cfgValue']);
        }
        define('XBLOCK_CONFIG', "1");
    }
    if (!isset($_SESSION['languages_id'])) {
        $lang_query = "select languages_id from " . TABLE_LANGUAGES . " where directory ='" . $xoopsConfig['language'] . "'";
        $lang = tep_db_query($lang_query);
        $lang_id = tep_db_fetch_array($lang);
        $languages_id = $lang_id['languages_id'];
    } else {
        $languages_id = $_SESSION['languages_id'];
    }
    // currency
    if (isset($_GET['currency'])) {
        $currency = $_GET['currency'];
    }
    if (!session_is_registered('currency') || isset($HTTP_GET_VARS['currency']) || USE_DEFAULT_LANGUAGE_CURRENCY == 'true' && LANGUAGE_CURRENCY != $currency) {
        if (!session_is_registered('currency')) {
            session_register('currency');
        }
        if (isset($HTTP_GET_VARS['currency'])) {
            if (!($currency = tep_currency_exists($HTTP_GET_VARS['currency']))) {
                $currency = USE_DEFAULT_LANGUAGE_CURRENCY == 'true' ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;
            }
        } else {
            $currency = USE_DEFAULT_LANGUAGE_CURRENCY == 'true' ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;
        }
    }
    if ($currency == '') {
        if (!($currency = tep_currency_exists($HTTP_GET_VARS['currency']))) {
            $currency = USE_DEFAULT_LANGUAGE_CURRENCY == 'true' ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;
        }
    }
    //$currencies = new currencies();
    if (!isset($currencies) || !is_object($currencies)) {
        $currencies = new currencies();
    }
    //echo "CUR:".$currencies.":".$currency;
    //print_r($currencies);
    // Box Part
    if ($random_product = tep_random_select("select p.products_distributor_id,p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int) $languages_id . "' and s.status = '1' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {
        $sproduct = new product($random_product["products_id"]);
        $add_text = '';
        if ($customer_group->getdisplaytax() == '1') {
            $add_text = '<br>' . TEXT_VAT_INFO . ' ' . $sproduct->get_tax() . ' % ' . $sproduct->get_tax_title();
        }
        if ($customer_group->getdisplayshipment() == '1') {
            $add_text .= '<br>' . TEXT_SHIPPING_HANDLING_INFO;
        }
        $image_path = DIR_WS_IMAGES;
        switch ($random_product['products_distributor_id']) {
            case 1:
                $image_path = 'http://ec.ingrammicro.de/jpg/';
                break;
            case 2:
                $image_path = '';
                break;
        }
        $info_box_contents = array();
        $info_box_contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product["products_id"]) . '">' . tep_image($image_path . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br><s>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>' . $add_text);
        $block = new infoBox($info_box_contents);
    }
    return $block->content;
}
 $total_tax = 0;
 // eof order editor 5 0 9
 for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
     //loop all the products in the order
     $products_ordered_attributes = '';
     if (isset($order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > 0) {
         for ($j = 0, $n2 = sizeof($order->products[$i]['attributes']); $j < $n2; $j++) {
             $products_ordered_attributes .= "\n\t" . $order->products[$i]['attributes'][$j]['option'] . ' ' . $order->products[$i]['attributes'][$j]['value'];
         }
     }
     $total_weight += $order->products[$i]['qty'] * $order->products[$i]['weight'];
     $total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
     $total_cost += $total_products_price;
     if (EMAIL_USE_HTML == 'true') {
         if ($order->products[$i]['model']) {
             $products_ordered .= $order_totals_zelle_beginn . $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $order_totals_zelle_mitte . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . $order_totals_zelle_end;
         } else {
             $products_ordered .= $order_totals_zelle_beginn . $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' = ' . $order_totals_zelle_mitte . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . $order_totals_zelle_end;
         }
     } else {
         if ($order->products[$i]['model']) {
             $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
         } else {
             $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
         }
     }
 }
 $Text_Billing_Adress = "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . $order->billing['name'] . "\n";
 if ($order->billing['company']) {
     $Text_Billing_Adress .= $order->billing['company'] . "\n";
 }
			          <td class="dataTableContent"></td>
			          <td class="dataTableContent"></td>
			          <td class="dataTableContent" align="center"><b><?php 
    echo $totalquantity;
    ?>
</b>&nbsp;</td>
                      <?php 
    if ($show_breakdown == 'on') {
        ?>
                      <td class="dataTableContent"></td>
                      <?php 
    }
    ?>
			          <td class="dataTableContent" align="right"><b><?php 
    echo TEXT_TOTAL . '&nbsp;';
    echo $currencies->display_price($totalgross, '', 1);
    ?>
</b>&nbsp;</td>
		 	        </tr> 
                  <?php 
}
?>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
      </form>
    </td>
示例#15
0
                  <td align="right" class="dataTableContent"><?php 
echo TEXT_CONVERSION;
?>
</td>
                  <td align="left" class="dataTableContent"><?php 
echo $affiliate_conversions;
?>
</td>
                </tr>
                <tr>
                  <td align="right" class="dataTableContent"><?php 
echo TEXT_AMOUNT;
?>
</td>
                  <td align="left" class="dataTableContent"><?php 
echo $currencies->display_price($affiliate_amount, '');
?>
</td>
                  <td align="right" class="dataTableContent"><?php 
echo TEXT_AVERAGE;
?>
</td>
                  <td align="left" class="dataTableContent"><?php 
echo $currencies->display_price($affiliate_average, '');
?>
</td>
                </tr>
                <tr>
                  <td align="right" class="dataTableContent"><?php 
echo TEXT_COMMISSION_RATE;
?>
示例#16
0
function replace_status_email($oID, $comments, $email_template_id)
{
    require_once 'includes/classes/currencies.php';
    $currencies = new currencies();
    //オーダー情報の取得
    require_once 'includes/classes/order.php';
    $order = new order($oID);
    //============ 以下、予約語を置換 ============
    $comments = str_replace('[CUSTOMER_NAME]', stripslashes($order->customer['name']), $comments);
    $comments = str_replace('[ORDER_ID]', stripslashes($oID), $comments);
    if ($email_template_id != MODULE_EMAIL_TEMPLATE_CHECKOUT_SUCCESS_VISITOR_MAIL_ID) {
        if (function_exists('zen_visitors_purchase_is_visitors_order') && zen_visitors_purchase_is_visitors_order($oID)) {
            $invoice_url = '';
        } elseif (function_exists('zen_catalog_href_link')) {
            $invoice_url = zen_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL');
            $invoice_url = MODULE_EMAIL_TEMPLATE_INVOICE_TEXT . "\n" . $invoice_url;
        } else {
            $invoice_url = zen_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL', false);
        }
        $comments = str_replace('[INVOICE_URL]', $invoice_url, $comments);
    }
    // insert comments if status changed
    if ($email_template_id != MODULE_EMAIL_TEMPLATE_CHECKOUT_SUCCESS_MAIL_ID && $email_template_id != MODULE_EMAIL_TEMPLATE_CHECKOUT_SUCCESS_VISITOR_MAIL_ID) {
        if ($_POST['notify_comments'] == 'on') {
            $notify_comments = stripslashes($_POST['comments']);
        } else {
            $notify_comments = '';
        }
        $comments = str_replace('[COMMENTS]', $notify_comments, $comments);
    }
    // products
    $products_ordered = "";
    for ($i = 0, $n = count($order->products); $i < $n; $i++) {
        $products_ordered_attributes = '';
        for ($j = 0; $j < count($order->products[$i]['attributes']); $j++) {
            $products_ordered_attributes .= "\n\t" . $order->products[$i]['attributes'][$j]['option'] . ' ' . $order->products[$i]['attributes'][$j]['value'];
        }
        $products_ordered .= $order->products[$i]['name'] . ($order->products[$i]['model'] != '' ? ' (' . $order->products[$i]['model'] . ') ' : '') . $order->products[$i]['qty'] . '点 ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . ($order->products[$i]['onetime_charges'] != 0 ? "\n" . TEXT_ONETIME_CHARGES_EMAIL . $currencies->display_price($order->products[$i]['onetime_charges'], $order->products[$i]['tax'], 1) : '') . $products_ordered_attributes . "\n";
    }
    $comments = str_replace('[PRODUCTS_ORDERED]', stripslashes($products_ordered), $comments);
    // totals
    $totals = '';
    for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
        $totals .= strip_tags($order->totals[$i]['title']) . ' ' . strip_tags($order->totals[$i]['text']) . "\n";
    }
    $comments = str_replace('[TOTALS]', stripslashes($totals), $comments);
    $billing_address = zen_address_format($order->billing['format_id'], $order->billing, 0, '', "\n");
    $comments = str_replace('[BILLING_ADDRESS]', stripslashes($billing_address), $comments);
    if (isset($GLOBALS['phpmailer']['content_type']) && $GLOBALS['phpmailer']['content_type'] != 'virtual') {
        $delivery_address = stripslashes(zen_address_format($order->delivery['format_id'], $order->delivery, 0, '', "\n"));
    } else {
        $delivery_address = MODULE_EMAIL_TEMPLATE_NOT_DELIVERY;
    }
    $comments = str_replace('[DELIVERY_ADDRESS]', $delivery_address, $comments);
    $comments = str_replace('[PAYMENT_METHOD]', stripslashes($order->info['payment_method']), $comments);
    $date_ordered = strftime(MODULE_EMAIL_TEMPLATE_DATE_FORMAT_LONG, strtotime($order->info['date_purchased']));
    $weekday = array(MODULE_EMAIL_TEMPLATE_SUN, MODULE_EMAIL_TEMPLATE_MON, MODULE_EMAIL_TEMPLATE_TUE, MODULE_EMAIL_TEMPLATE_WED, MODULE_EMAIL_TEMPLATE_THU, MODULE_EMAIL_TEMPLATE_FRI, MODULE_EMAIL_TEMPLATE_SAT);
    $date_ordered .= $weekday[strftime('%w', strtotime($order->info['date_purchased']))];
    $comments = str_replace('[DATE_ORDERED]', $date_ordered, $comments);
    // insert orderd comment
    if ($email_template_id == MODULE_EMAIL_TEMPLATE_CHECKOUT_SUCCESS_MAIL_ID || $email_template_id == MODULE_EMAIL_TEMPLATE_CHECKOUT_SUCCESS_VISITOR_MAIL_ID) {
        if (!empty($GLOBALS['phpmailer']['comments'])) {
            $order_comments = stripslashes($GLOBALS['phpmailer']['comments']);
        } else {
            $order_comments = '';
        }
        $comments = str_replace('[COMMENT]', $order_comments, $comments);
    }
    return $comments;
}
示例#17
0
 // # Send Confirmation
 if (isset($_POST['send_confirmation'])) {
     $order = new order($oID);
     $products_ordered = '';
     $products_ordered_html = '';
     $attributes_exist = '0';
     $products_ordered_attributes = '';
     foreach ($order->products as $product) {
         //$products_ordered.=sprintf("%2d x %s\n",$product['qty'],$product['name']);
         if (isset($product['attributes'])) {
             $attributes_exist = '1';
             for ($j = 0, $n2 = sizeof($product['attributes']); $j < $n2; $j++) {
                 $products_ordered_attributes .= "\n\t" . $product['attributes'][$j]['option'] . ' ' . $product['attributes'][$j]['value'];
             }
         }
         $products_ordered .= $product['qty'] . ' x ' . $product['name'] . ' (' . $product['model'] . ') = ' . $currencies->display_price($product['final_price'], $product['tax'], $product['qty']) . $products_ordered_attributes . "\n";
         $products_ordered_html .= '<table width="100%"><tr><td align="center" style="width:40px; font:normal 12px arial; text-align:center;">x' . $product['qty'] . '</td><td align="left" style="width:235px; padding-left:10px; font:normal 12px arial;">' . $product['name'] . '</td><td style="width:68px; font:normal 12px arial;">' . $product['model'] . '</td><td align="left" style="width:63px; font:normal 12px arial;">' . $products_ordered_attributes . '</td><td align="left" style="width:69px; font:normal 12px arial;">' . $currencies->display_price($product['final_price'], $product['tax'], $product['qty']) . '</td></tr></table><br>' . "\n";
     }
     // # Order Total label
     $ot_title_wd = 0;
     $ot_text_wd = 0;
     $ot_label_text = array();
     $ot_label_html = array();
     $order_totals = array();
     $ot_query = tep_db_query("SELECT * FROM " . TABLE_ORDERS_TOTAL . " WHERE orders_id='{$oID}' ORDER BY sort_order");
     while ($order_totals_row = tep_db_fetch_array($ot_query)) {
         $order_totals[] = $order_totals_row;
     }
     foreach ($order_totals as $idx => $ot) {
         $ot_txt = array();
         $ot_title_wd = max($ot_title_wd, strlen($order_totals[$idx]['strip_title'] = preg_replace('/<.*?>/', '', $ot['title'])));
示例#18
0
    ?>
">
						<img src="<?php 
    echo DIR_WS_IMAGES . $data[$i]['products_image'];
    ?>
" class="img-responsive img-thumbnail" alt="<?php 
    echo $data[$i]['products_name'];
    ?>
">
					</a>
					<a href="<?php 
    echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $data[$i]['products_id']);
    ?>
">
						<h4><?php 
    echo $data[$i]['products_name'];
    ?>
</h4>
					</a>
					<span class="text-center">
						<?php 
    echo $currencies->display_price($data[$i]['products_price'], tep_get_tax_rate($data[$i]['products_tax_class_id']));
    ?>
					</span>
				</div>
			<?php 
}
?>
		</div>
	</div>
</div>
            ?>
&nbsp;</td>

                      <td class="dataTableContent" align="center" valign="middle">
                        <label onmouseover="this.style.cursor='pointer'; this.style.cursor='hand'">
                        <input onmouseover="this.style.cursor='pointer'; this.style.cursor='hand'" checked="checked" size="20" name="xsell_id[]" type="checkbox" value="<?php 
            echo $PRODUCTS_id[0];
            ?>
">Cross-sell</label>
                      </td>
					  <td class="dataTableContent"><?php 
            echo $PRODUCTS_name[0];
            ?>
</td>
					  <td class="dataTableContent"><?php 
            echo $currencies->display_price($PRODUCTS_price[0], olc_get_tax_rate($product_info_values['products_tax_class_id']));
            ?>
</td>
                    </tr>
<?php 
        }
    }
    $query = 'select distinct b.language_id, a.products_id, b.products_name, b.products_description,
                     a.products_quantity, a.products_model, a.products_image, b.products_url, a.products_price FROM ' . TABLE_PRODUCTS . ' a, ' . TABLE_PRODUCTS_DESCRIPTION . ' b, products_to_categories p2c WHERE b.products_id=a.products_id and b.language_id = "' . $languages_id . '" AND a.products_id=p2c.products_id ' . ($CATEGORIES_id ? ' and p2c.categories_id="' . $CATEGORIES_id . '" ' : '') . ($MANUFACTURES_id ? ' and a.manufacturers_id="' . $MANUFACTURES_id . '" ' : '') . ' and a.products_id != "' . $add_related_product_ID . '" ORDER BY b.products_name';
    list($language_id, $PRODUCTS_id, $PRODUCTS_name, $PRODUCTS_description, $PRODUCTS_quantity, $PRODUCTS_model, $PRODUCTS_image, $PRODUCTS_url, $PRODUCTS_price) = general_db_conct($query);
    if ($PRODUCTS_id) {
        ?>
                    <tr bgcolor='#FFFFFF'><td colspan=6>List of products for adding in Cross-Sell (X-Sell). Please check it...</td></tr>
<?php 
        $num_of_products = sizeof($PRODUCTS_id);
        for ($i = 0; $i < $num_of_products; $i++) {
            break;
        default:
            if (is_object($aInfo)) {
                $heading[] = array('text' => '<b>' . $aInfo->affiliate_firstname . ' ' . $aInfo->affiliate_lastname . '</b>');
                $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_AFFILIATE, tep_get_all_get_params(array('acID', 'action')) . 'acID=' . $aInfo->affiliate_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE, tep_get_all_get_params(array('acID', 'action')) . 'acID=' . $aInfo->affiliate_id . '&action=confirm') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT, 'selected_box=affiliate&affiliate=' . $aInfo->affiliate_email_address) . '">' . tep_image_button('button_email.gif', IMAGE_EMAIL) . '</a>');
                $affiliate_sales_raw = "select count(*) as count, sum(affiliate_value) as total, sum(affiliate_payment) as payment from " . TABLE_AFFILIATE_SALES . " a left join " . TABLE_ORDERS . " o on (a.affiliate_orders_id=o.orders_id) where o.orders_status >= " . AFFILIATE_PAYMENT_ORDER_MIN_STATUS . " and  affiliate_id = '" . $aInfo->affiliate_id . "'";
                $affiliate_sales_values = tep_db_query($affiliate_sales_raw);
                $affiliate_sales = tep_db_fetch_array($affiliate_sales_values);
                $contents[] = array('text' => '<br>' . TEXT_DATE_ACCOUNT_CREATED . ' ' . tep_date_short($aInfo->date_account_created));
                $contents[] = array('text' => '' . TEXT_DATE_ACCOUNT_LAST_MODIFIED . ' ' . tep_date_short($aInfo->date_account_last_modified));
                $contents[] = array('text' => '' . TEXT_INFO_DATE_LAST_LOGON . ' ' . tep_date_short($aInfo->date_last_logon));
                $contents[] = array('text' => '' . TEXT_INFO_NUMBER_OF_LOGONS . ' ' . $aInfo->number_of_logons);
                $contents[] = array('text' => '' . TEXT_INFO_COMMISSION . ' ' . $aInfo->affiliate_commission_percent . ' %');
                $contents[] = array('text' => '' . TEXT_INFO_COUNTRY . ' ' . $aInfo->countries_name);
                $contents[] = array('text' => '' . TEXT_INFO_NUMBER_OF_SALES . ' ' . $affiliate_sales['count'], '');
                $contents[] = array('text' => '' . TEXT_INFO_SALES_TOTAL . ' ' . $currencies->display_price($affiliate_sales['total'], ''));
                $contents[] = array('text' => '' . TEXT_INFO_AFFILIATE_TOTAL . ' ' . $currencies->display_price($affiliate_sales['payment'], ''));
            }
            break;
    }
    if (tep_not_null($heading) && tep_not_null($contents)) {
        echo '            <td width="25%" valign="top">' . "\n";
        $box = new box();
        echo $box->infoBox($heading, $contents);
        echo '            </td>' . "\n";
    }
    ?>
          </tr>
        </table></td>
      </tr>
<?php 
echo '<a href="javascript:popupWindow(\'' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_HELP_4) . '\')">' . TEXT_SUMMARY_HELP . '</a>';
?>
</td>
                  <td width="15%" class="dataTableContent"><?php 
echo $affiliate_conversions . ' %';
?>
</td>
                </tr>
                <tr>
                  <td width="35%" align="right" class="dataTableContent"><?php 
echo TEXT_AMOUNT;
echo '<a href="javascript:popupWindow(\'' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_HELP_5) . '\')">' . TEXT_SUMMARY_HELP . '</a>';
?>
</td>
                  <td width="15%" class="dataTableContent"><?php 
echo $currencies->display_price($affiliate_sales['total'], '');
?>
</td>
                  <td width="35%" align="right" class="dataTableContent"><?php 
echo TEXT_AVERAGE;
echo '<a href="javascript:popupWindow(\'' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_HELP_6) . '\')">' . TEXT_SUMMARY_HELP . '</a>';
?>
</td>
                  <td width="15%" class="dataTableContent"><?php 
echo $currencies->display_price($affiliate_average, '');
?>
</td>
                </tr>
                <tr>
                  <td width="35%" align="right" class="dataTableContent"><?php 
echo TEXT_COMMISSION_RATE;
示例#22
0
<?php

$lang = getSiteLanguage();
$currencies = new currencies();
$query = "select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . $lang['id'] . "' and s.status = '1' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS;
if ($random_product = tep_random_select($query)) {
    if (USE_PRICES_TO_QTY == 'false' && PRICE_BOOK == 'true') {
        //added here so this can be used add the whole page
        $discount_price = tep_get_discountprice($random_product['products_price'], $customer_id, $customer_group, $random_product['products_id'], $cPath, $random_product['manufacturers_id']);
    }
    $oldPrice = 0;
    $newPrice = 0;
    if ($discount_price['lowest']['discount'] > 0 && PRICE_BOOK == 'true') {
        if ($new_price = tep_get_products_special_price($random_product['products_id'])) {
            if ($new_price < $discount_price['lowest']['price']) {
                $oldPrice = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));
                $newPrice = $currencies->display_price($new_price, tep_get_tax_rate($random_product['products_tax_class_id']));
            } else {
                $oldPrice = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));
                $newPrice = $currencies->display_price($discount_price['lowest']['price'], tep_get_tax_rate($random_product['products_tax_class_id']));
            }
        } else {
            $oldPrice = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));
            $newPrice = $currencies->display_price($discount_price['lowest']['price'], tep_get_tax_rate($random_product['products_tax_class_id']));
        }
    } else {
        if ($new_price = tep_get_products_special_price($random_product['products_id'])) {
            $oldPrice = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));
            $newPrice = $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id']));
        } else {
            $newPrice = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));