function olc_get_products_attribute_price($attribute_price, $tax_class, $price_special, $quantity, $prefix, $calculate_currencies = TRUE_STRING_S)
{
    if ($_SESSION['customers_status']['customers_status_show_price'] == '1') {
        $attribute_tax = olc_get_tax_rate($tax_class);
        // check if user is allowed to see tax rates
        if ($_SESSION['customers_status']['customers_status_show_price_tax'] == '0') {
            $attribute_tax = '';
        }
        // add tax
        $price_string = olc_add_tax($attribute_price, $attribute_tax) * $quantity;
        if ($_SESSION['customers_status']['customers_status_discount_attributes'] == '0') {
            // format price & calculate currency
            $price_string = olc_format_price($price_string, $price_special, $calculate_currencies);
            if ($price_special == '1') {
                $price_string = BLANK . $prefix . BLANK . $price_string . BLANK;
            }
        } else {
            $discount = $_SESSION['customers_status']['customers_status_discount'];
            $rabatt_string = $price_string - $price_string / 100 * $discount;
            $price_string = olc_format_price($price_string, $price_special, $calculate_currencies);
            $rabatt_string = olc_format_price($rabatt_string, $price_special, $calculate_currencies);
            if ($price_special == '1' && $price_string != $rabatt_string) {
                $price_string = BLANK . $prefix . '<font color="ff0000"><s>' . $price_string . '</s></font> ' . $rabatt_string . BLANK;
            } else {
                $price_string = $rabatt_string;
                if ($price_special == '1') {
                    $price_string = BLANK . $prefix . BLANK . $price_string;
                }
            }
        }
    } else {
        $price_string = '  ' . NOT_ALLOWED_TO_SEE_PRICES;
    }
    return $price_string;
}
コード例 #2
0
 function quote($method = '')
 {
     // W. Kaiser - Show missing amount for free shipping
     $CurrentAmount = $_SESSION['cart']->show_total();
     //	W. Kaiser - Free shipping national/international
     require_once DIR_FS_INC . 'olc_get_free_shipping_amount.inc.php';
     olc_get_free_shipping_amount();
     if (FREE_AMOUNT > 0) {
         $MissingAmount = FREE_AMOUNT - $CurrentAmount;
         if ($MissingAmount > 0 && MODULE_SHIPPING_FREECOUNT_DISPLAY == FALSE_STRING_L) {
             return;
         }
         //	W. Kaiser - Free shipping national/international
         $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_FREECOUNT_TEXT_TITLE);
         if ($MissingAmount > 0) {
             $this->quotes['error'] = MODULE_SHIPPING_FREECOUNT_TEXT_WAY . HTML_B_START . olc_format_price($MissingAmount, 1, 1, 1) . '</b>)';
         } else {
             $this->quotes['methods'] = array(array('id' => $this->code, 'title' => MODULE_SHIPPING_FREECOUNT_TEXT_WAY, 'cost' => 0));
             if (olc_not_null($this->icon)) {
                 $this->quotes['icon'] = olc_image($this->icon, $this->title);
             }
         }
     }
     return $this->quotes;
     //W. Kaiser - Show missing amount for free shippin
 }
コード例 #3
0
 function process()
 {
     global $order, $currencies;
     $this->title = $_SESSION['customers_status']['customers_status_ot_discount'] . ' % ' . SUB_TITLE_OT_DISCOUNT;
     if ($_SESSION['customers_status']['customers_status_ot_discount_flag'] == '1' && $_SESSION['customers_status']['customers_status_ot_discount'] != '0.00') {
         $discount_price = olc_format_price($order->info['subtotal'], $price_special = 0, $calculate_currencies = false) / 100 * $_SESSION['customers_status']['customers_status_ot_discount'] * -1;
         $this->output[] = array('title' => $this->title . ':', 'text' => '<font color="ff0000">' . olc_format_price($discount_price, $price_special = 1, $calculate_currencies = false) . '</font>', 'value' => $discount_price);
     }
 }
コード例 #4
0
 function process()
 {
     global $order, $currencies;
     $od_amount = $this->calculate_credit($this->get_order_total());
     if ($od_amount > 0) {
         $this->deduction = $od_amount;
         $this->output[] = array('title' => $this->title . ':', 'text' => olc_format_price($currencies->format($od_amount), 1, false), 'value' => $od_amount);
         $order->info['total'] = $order->info['total'] - $od_amount;
     }
 }
コード例 #5
0
 function process()
 {
     global $order, $currencies;
     $title = $this->title;
     if (!CUSTOMER_SHOW_PRICE_TAX) {
         if ($_SESSION['customers_status']['customers_status_add_tax_ot'] == 0) {
             $title = MODULE_ORDER_TOTAL_SUBTOTAL_TITLE_NO_TAX;
         }
     }
     $subtotal = $order->info['subtotal'];
     $this->output[] = array('title' => $title . COLON, 'text' => olc_format_price($subtotal, 1, false), 'value' => $subtotal);
 }
コード例 #6
0
 function process()
 {
     global $order, $currencies;
     if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 0 && $_SESSION['customers_status']['customers_status_add_tax_ot'] == 1) {
         if ($_SESSION['customers_status']['customers_status_ot_discount_flag'] == 1) {
             $sub_total_price = $order->info['subtotal'] - $order->info['subtotal'] / 100 * $_SESSION['customers_status']['customers_status_ot_discount'];
         } else {
             $sub_total_price = $order->info['subtotal'];
         }
         $this->output[] = array('title' => $this->title . ':', 'text' => HTML_B_START . olc_format_price($sub_total_price + olc_format_price($order->info['shipping_cost'], $price_special = 0, $calculate_currencies = false), $price_special = 1, $calculate_currencies = false) . HTML_B_END, 'value' => olc_format_price($sub_total_price + olc_format_price($order->info['shipping_cost'], $price_special = 0, $calculate_currencies = false), $price_special = 0, $calculate_currencies = false));
     }
 }
コード例 #7
0
 function process()
 {
     global $order, $currencies;
     if (MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE == TRUE_STRING_S) {
         $pass = false;
         if ($_SESSION['shipping']['id'] != 'selfpickup_selfpickup') {
             $country = $order->delivery['country_id'];
             switch (MODULE_ORDER_TOTAL_LOWORDERFEE_DESTINATION) {
                 case 'national':
                     if ($country == STORE_COUNTRY) {
                         $pass = true;
                     }
                     break;
                 case 'international':
                     if ($country != STORE_COUNTRY) {
                         $pass = true;
                     }
                     break;
                 case 'both':
                     $pass = true;
                     break;
             }
         }
         if ($pass) {
             if ($order->info['total'] - $order->info['shipping_cost'] < MODULE_ORDER_TOTAL_LOWORDERFEE_ORDER_UNDER) {
                 $delivery_country = $order->delivery['country']['id'];
                 $delivery_zone_id = $order->delivery['zone_id'];
                 $tax = olc_get_tax_rate(MODULE_ORDER_TOTAL_LOWORDERFEE_TAX_CLASS, $delivery_country, $delivery_zone_id);
                 $tax_description = olc_get_tax_description(MODULE_ORDER_TOTAL_LOWORDERFEE_TAX_CLASS, $delivery_country, $delivery_zone_id);
                 $low_order_fee = MODULE_ORDER_TOTAL_LOWORDERFEE_FEE;
                 $low_order_fee_tax = olc_calculate_tax($low_order_fee, $tax);
                 $low_order_fee = olc_add_tax($low_order_fee, $tax);
                 if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 1) {
                     $order->info['tax'] += $low_order_fee_tax;
                     $order->info['tax_groups'][TAX_ADD_TAX . "{$tax_description}"] += $low_order_fee_tax;
                     $order->info['total'] += $low_order_fee;
                 } else {
                     if ($_SESSION['customers_status']['customers_status_add_tax_ot'] == 1) {
                         $order->info['tax'] += $low_order_fee_tax;
                         $order->info['tax_groups'][TAX_NO_TAX . "{$tax_description}"] += $low_order_fee_tax;
                     }
                     $order->info['subtotal'] += $low_order_fee;
                     $order->info['total'] += $low_order_fee;
                 }
                 $this->output[] = array('title' => $this->title . ':', 'text' => olc_format_price($low_order_fee, 1, 1, 1), 'value' => $low_order_fee);
             }
         }
     }
 }
コード例 #8
0
 function process()
 {
     global $order, $currencies, $customer_id;
     //      if (MODULE_ORDER_TOTAL_HANDLING_HANDLING == TRUE_STRING_S) {
     $freequery = olc_db_query("SELECT SUM(cb.customers_basket_quantity) AS total FROM " . TABLE_CUSTOMERS_BASKET . " cb LEFT JOIN " . TABLE_PRODUCTS . " p ON cb.products_id = p.products_id WHERE cb.customers_id =  '" . $customer_id . "' AND cb.final_price <  '0.01' AND p.products_price <  '0.01'");
     $freestuff = olc_db_fetch_array($freequery);
     $freeitems = $freestuff['total'];
     $handlingfree = $order->info['subtotal'] / 100 * 0.85;
     $tax = olc_get_tax_rate(MODULE_ORDER_TOTAL_HANDLING_TAX_CLASS, $order->delivery['country']['id'], $order->delivery['zone_id']);
     $tax_description = olc_get_tax_description(MODULE_ORDER_TOTAL_HANDLING_TAX_CLASS, $order->delivery['country']['id'], $order->delivery['zone_id']);
     $order->info['tax'] += olc_calculate_tax($handlingfree, $tax);
     $order->info['tax_groups']["{$tax_description}"] += olc_calculate_tax($handlingfree, $tax);
     $order->info['total'] += $handlingfree + olc_calculate_tax($handlingfree, $tax);
     $this->output[] = array('title' => $this->title . ':', 'text' => olc_format_price(olc_add_tax($handlingfree, $tax), true, $order->info['currency'], $order->info['currency_value']), 'value' => olc_add_tax($handlingfree, $tax));
 }
コード例 #9
0
 function process()
 {
     global $order, $currencies;
     reset($order->info['tax_groups']);
     while (list($key, $value) = each($order->info['tax_groups'])) {
         if ($value > 0) {
             if ($_SESSION['customers_status']['customers_status_show_price_tax'] != 0) {
                 $this->output[] = array('title' => $key . ':', 'text' => olc_format_price($value, $price_special = 1, $calculate_currencies = false), 'value' => olc_format_price($value, $price_special = 0, $calculate_currencies = false));
             }
             if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 0 && $_SESSION['customers_status']['customers_status_add_tax_ot'] == 1) {
                 $this->output[] = array('title' => $key . ':', 'text' => olc_format_price($value, $price_special = 1, $calculate_currencies = false), 'value' => olc_format_price($value, $price_special = 0, $calculate_currencies = false));
             }
         }
     }
 }
コード例 #10
0
 function process()
 {
     global $order, $currencies;
     $total = $order->info['total'];
     $tax = $order->info['tax'];
     if (CUSTOMER_SHOW_PRICE_TAX) {
         $title = $this->title;
     } else {
         if ($_SESSION['customers_status']['customers_status_add_tax_ot'] == 1) {
             $total += $tax;
             $title = MODULE_ORDER_TOTAL_TOTAL_TITLE_NO_TAX_BRUTTO;
         } else {
             $title = MODULE_ORDER_TOTAL_TOTAL_TITLE_NO_TAX;
         }
     }
     $this->output[] = array('title' => $title . ':', 'text' => HTML_B_START . olc_format_price($total, $price_special = 1, $calculate_currencies = false) . HTML_B_END, 'value' => olc_format_price($total, $price_special = 0, $calculate_currencies = false));
 }
コード例 #11
0
 function process()
 {
     global $order, $currencies;
     //      if ($_SESSION['cot_gv']) {  // old code Strider
     if (isset($_SESSION['cot_gv']) && $_SESSION['cot_gv'] == true) {
         $order_total = $this->get_order_total();
         $od_amount = $this->calculate_credit($order_total);
         if ($this->calculate_tax != "None") {
             $tod_amount = $this->calculate_tax_deduction($order_total, $od_amount, $this->calculate_tax);
             $od_amount = $this->calculate_credit($order_total);
         }
         $this->deduction = $od_amount;
         //        if (($this->calculate_tax == "Credit Note") && (DISPLAY_PRICE_WITH_TAX != TRUE_STRING_S)) {
         //          $od_amount -= $tod_amount;
         //          $order->info['total'] -= $tod_amount;
         //        }
         $order->info['total'] = $order->info['total'] - $od_amount;
         if ($od_amount > 0) {
             $this->output[] = array('title' => $this->title . ':', 'text' => '<b><font color="ff0000">-' . olc_format_price($od_amount, $price_special = 1, $calculate_currencies = false) . '</font></b>', 'value' => olc_format_price($od_amount, $price_special = 0, $calculate_currencies = false));
         }
     }
 }
function olc_oe_get_products_attribute_price($attribute_price, $tax_class, $price_special, $quantity, $prefix, $calculate_currencies = TRUE_STRING_S, $customer_status)
{
    $customers_status_query = olc_db_query("select * from " . TABLE_CUSTOMERS_STATUS . " where customers_status_id = '" . $customer_status . "' ");
    $customers_status = olc_db_fetch_array($customers_status_query);
    if ($customers_status['customers_status_show_price'] == '1') {
        $attribute_tax = olc_get_tax_rate($tax_class);
        // check if user is allowed to see tax rates
        if ($customers_status['customers_status_show_price_tax'] == '0') {
            $attribute_tax = '';
        }
        // add tax
        $price_string = olc_add_tax($attribute_price, $attribute_tax) * $quantity;
        if ($customers_status['customers_status_discount_attributes'] == '0') {
            // format price & calculate currency
            $price_string = olc_format_price($price_string, $price_special, $calculate_currencies);
            if ($price_special == '1') {
                $price_string = BLANK . $prefix . BLANK . $price_string . BLANK;
            }
        } else {
            $discount = $customers_status['customers_status_discount'];
            $rabatt_string = $price_string - $price_string / 100 * $discount;
            $price_string = olc_format_price($price_string, $price_special, $calculate_currencies);
            $rabatt_string = olc_format_price($rabatt_string, $price_special, $calculate_currencies);
            if ($price_special == '1' && $price_string != $rabatt_string) {
                $price_string = BLANK . $prefix . '<font color="ff0000"><s>' . $price_string . '</s></font> ' . $rabatt_string . BLANK;
            } else {
                $price_string = $rabatt_string;
                if ($price_special == '1') {
                    $price_string = BLANK . $prefix . BLANK . $price_string;
                }
            }
        }
    } else {
        $price_string = '  ' . NOT_ALLOWED_TO_SEE_PRICES;
    }
    return $price_string;
}
コード例 #13
0
  	  						      					</td>
							  					      </tr>
							  					    </table>
 						      					</td>
				  					      </tr>
';
            }
        }
    }
    if ($session_change) {
        // restore old session data
        $_SESSION = array();
        $_SESSION = $old_session;
    }
    if ($cart_total > 0) {
        $main_content .= str_replace(HASH, TEXT_VALUE_OF_CARTS . olc_format_price($cart_total, true, true), $whos_online_end_row);
    }
}
$main_content .= str_replace(HASH, sprintf(TEXT_NUMBER_OF_CUSTOMERS, $visitors), $whos_online_end_row);
$main_content .= '
						            </table>
						          </td>
	  		        		</tr>
					        </table>
			    	    </td>
			      	</tr>
			      </table>
	        </td>
	      </tr>
		  </table>
';
コード例 #14
0
    Released under the GNU General Public License
   -----------------------------------------------------------------------------------------
   Third Party contributions:
   freeamountv2-p1         	Autor:	dwk
   (c) 2004      XT - Commerce; www.xt-commerce.com

    Released under the GNU General Public License
   ---------------------------------------------------------------------------------------*/
define('MODULE_SHIPPING_FREECOUNT_TEXT_TITLE', 'Free Shipping');
define('MODULE_SHIPPING_FREECOUNT_TEXT_DESCRIPTION', 'Free Shipping w/ Minimum Order Amount');
//define('MODULE_SHIPPING_FREECOUNT_TEXT_WAY', 'w/ $' . MODULE_SHIPPING_FREECOUNT_AMOUNT . ' minimum order');
//W. Kaiser
require_once DIR_FS_INC . 'olc_format_price.inc.php';
//	W. Kaiser - Free shipping national/international
require_once DIR_FS_INC . 'olc_get_free_shipping_amount.inc.php';
olc_get_free_shipping_amount();
//	W. Kaiser - Free shipping national/international
define('MODULE_SHIPPING_FREECOUNT_TEXT_WAY', 'From <b>' . olc_format_price(FREE_AMOUNT, $price_special = 1, $calculate_currencies = false) . '</b> order value onwardswie ship your order <b>without</b> shipping cost!<br/>' . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<font color="red"><b>Missing order amount for free shipment:&nbsp;</b></font>');
//W. Kaiser
define('MODULE_SHIPPING_FREECOUNT_SORT_ORDER', 'Sort Order');
define('MODULE_SHIPPING_FREEAMOUNT_ALLOWED_TITLE', 'Allowed Zones');
define('MODULE_SHIPPING_FREEAMOUNT_ALLOWED_DESC', 'Please enter the zones <b>separately</b> which should be allowed to use this modul (e. g. AT,DE (leave empty if you want to allow all zones))');
define('MODULE_SHIPPING_FREECOUNT_STATUS_TITLE', 'Enable Free Shipping with Minimum Purchase');
define('MODULE_SHIPPING_FREECOUNT_STATUS_DESC', 'Do you want to offer free shipping?');
define('MODULE_SHIPPING_FREECOUNT_DISPLAY_TITLE', 'Enable Display');
define('MODULE_SHIPPING_FREECOUNT_DISPLAY_DESC', 'Do you want to display text way if the minimum amount is not reached?');
define('MODULE_SHIPPING_FREECOUNT_AMOUNT_TITLE', 'Minimum Cost');
define('MODULE_SHIPPING_FREECOUNT_AMOUNT_DESC', 'Minimum order amount purchased before shipping is free?');
define('MODULE_SHIPPING_FREECOUNT_SORT_ORDER_TITLE', 'Display order');
define('MODULE_SHIPPING_FREECOUNT_SORT_ORDER_DESC', 'Lowest will be displayed first.');
コード例 #15
0
    $data_products .= '
					<tr>
						<td class="main" nowrap="nowrap" align="left" valign="top" width="">' . $products_qty . ' x ' . $order_products['name'] . '						</td>
						<td class="main" align="right" valign="top">' . $single_price . '</td>
						<td class="main" align="right" valign="top">' . $total_price . '</td>
					</tr>
';
    $products_attributes = $order_products['attributes'];
    if (sizeof($products_attributes) > 0) {
        for ($j = 0, $n2 = sizeof($products_attributes); $j < $n2; $j++) {
            $products_attribute = $products_attributes[$j];
            $products_attribute_price = $products_attribute['price'];
            if ($products_attribute_price != 0) {
                $products_attribute_price_single = olc_get_products_attribute_price_checkout($products_attribute_price, $order_products['tax'], 1, $products_qty, $products_attribute['prefix']);
                if ($products_qty != 1) {
                    $products_attribute_price_total = olc_format_price($products_attribute_price * $products_qty, true, true);
                } else {
                    $products_attribute_price_total = $products_attribute_price_single;
                }
            } else {
                $products_attribute_price = EMPTY_STRING;
            }
            $data_products .= '					<tr>
						<td class="main" align="left" valign="top">
							<nobr><small>&nbsp;<i> - ' . $products_attribute['option'] . COLON_BLANK . $products_attribute['value'] . '
							</i></small>
						</td>
						<td class="main" align="right" valign="top"><i><small>' . $products_attribute_price_single . '							</i></small></nobr>
						</td>
						<td class="main" align="right" valign="top"><i><small>' . $products_attribute_price_single . '							</i></small></nobr>
						</td>
コード例 #16
0
 function ProductsDataSheet($languages_id, $products_id)
 {
     global $currencies;
     global $docfilename;
     //Convertion pixels -> mm
     $this->pdf_to_mm_faktor = 1 / $this->k;
     $imagewidth = PRODUCT_IMAGE_INFO_WIDTH * $this->pdf_to_mm_faktor;
     $imageheight = PRODUCT_IMAGE_INFO_HEIGHT * $this->pdf_to_mm_faktor;
     //W. Kaiser -- AJAX
     //Use 'product_info.php' also for printing!!
     $isprint_version = true;
     $is_pdf = true;
     include DIR_WS_MODULES . 'product_info.php';
     //W. Kaiser -- AJAX
     global $products_data;
     //Get Data fram Smarty
     $products_data = array();
     $products_data[] = $imagewidth;
     $products_data[] = $imageheight;
     while (list($key, $value) = each($info_smarty->_tpl_vars)) {
         $products_data[$key] = $value;
     }
     require_once DIR_FS_INC . 'olc_get_smarty_config_variable.inc.php';
     $products_data['SHIPPING_DESC'] = olc_get_smarty_config_variable($info_smarty, 'product_info', 'text_shippingtime');
     $this->AddPage();
     $this->DrawCells($products_data);
     $this->SetY(max($this->y_after_description, $this->y_after_image) + $this->cells_height);
     if (PDF_SHOW_OPTIONS) {
         $products_options_name_sql = "\n\t\t\t\tselect distinct\n\t\t\t\tpopt.products_options_id,\n\t\t\t\tpopt.products_options_name\n\t\t\t\tfrom " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib\n\t\t\t\twhere\n\t\t\t\tpatrib.products_id='" . $products_id . "' and\n\t\t\t\tpatrib.options_id = popt.products_options_id and\n\t\t\t\tpopt.language_id = '" . SESSION_LANGUAGE_ID . APOS;
         $products_options_name = olc_db_query($products_options_name_sql);
         if (olc_db_num_rows($products_options_name)) {
             $this->DrawSeparatorLine();
             //pov.products_options_values_thumbnail,
             $products_options_sql0 = "\n\t\t\t\tselect\n\t\t\t\tpov.products_options_values_id,\n\t\t\t\tpov.products_options_values_name,\n\t\t\t\tpa.options_values_price,\n\t\t\t\tpa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where\n\t\t\t\tpa.products_id = '" . $products_id . "'\n\t\t\t\tand pa.options_id = '#'\n\t\t\t\tand pa.options_values_id = pov.products_options_values_id\n\t\t\t\tand pov.language_id = '" . SESSION_LANGUAGE_ID . "'\n\t\t\t\torder by pov.products_options_values_name";
             $this->SetFont($this->font, BOLD, 10);
             $special_price_color_text = explode(COMMA, PDF_SPECIAL_PRICE_COLOR_TEXT);
             $this->SetTextColor($special_price_color_text[0], $special_price_color_text[1], $special_price_color_text[2]);
             $this->MultiCell(0, 8, TEXT_PRODUCTS_OPTIONS . $print_catalog_array['name'], 0, LEFT, 0);
             $this->SetFont($this->font, EMPTY_STRING, 8);
             $options_color_text = explode(COMMA, PDF_OPTIONS_COLOR);
             $this->SetTextColor($options_color_text[0], $options_color_text[1], $options_color_text[2]);
             $options_color_text = explode(COMMA, PDF_OPTIONS_BG_COLOR);
             $this->SetFillColor($options_color_text[0], $options_color_text[1], $options_color_text[2]);
             if (PDF_OPTIONS_AS_IMAGES_ENABLED == TRUE_STRING_S) {
                 //OAI query
                 if (PDF_SHOW_OPTIONS_VERTICAL != 0) {
                     while ($products_options_name_values = olc_db_fetch_array($products_options_name)) {
                         $this->Ln(6);
                         $this->SetFont($this->font, BOLD, 11);
                         $this->Cell(190, $this->cells_height, $products_options_name_values['products_options_name'], 0, 0, LEFT);
                         $this->Ln();
                         $products_options_sql = str_replace(HASH, $products_options_name_values['products_options_id'], $products_options_sql0);
                         $products_options = olc_db_query($products_options_sql);
                         $count_options_values = olc_db_num_rows($products_options);
                         $count_options = 0;
                         $largest_y = $this->GetY();
                         //OAI query
                         $products_options_query = olc_db_query($products_options_query_sql);
                         while ($products_options_values = olc_db_fetch_array($products_options_query)) {
                             $products_options_values_name = $products_options_values['products_options_values_name'];
                             $w = $this->GetStringWidth($products_options_values_name) + 2;
                             $this->SetFont($this->font, EMPTY_STRING, 10);
                             $this->SetTextColor($body_color_text[0], $body_color_text[1], $body_color_text[2]);
                             $option_string = $products_options_values_name;
                             $current_x = $this->GetX();
                             if (PDF_SHOW_OPTIONS_PRICE) {
                                 $options_values_price = $products_options_values['options_values_price'];
                                 if ($options_values_price != ' 0.0000') {
                                     $option_string .= LPAREN . $products_options_values['price_prefix'] . olc_format_price($options_values_price, true, true, true) . RPAREN;
                                 }
                             }
                             $count_options++;
                             $add_to = $count_options_values != $count_options ? ',' : '.';
                             $this->Write($this->cells_height, $option_string . $add_to);
                             $largest_y = $this->GetY();
                             $next_x = $this->GetX();
                             if ($products_options_name_values['products_options_images_enabled'] == TRUE_STRING_S) {
                                 $path_to_image = DIR_IMAGE . 'options/' . $products_options_values['products_options_values_thumbnail'];
                                 $img_size = GetImageSize($path_to_image);
                                 $img_h = $img_size[1] * $this->pdf_to_mm_faktor;
                                 $img_w = $img_size[0] * $this->pdf_to_mm_faktor;
                                 if ($next_x < $current_x + $img_w) {
                                     $next_x = $current_x + $img_w;
                                 }
                                 $current_y = $this->GetY();
                                 $image_y = $this->GetY() + $this->cells_height;
                                 $largest_y = $image_y + $img_h;
                                 $this->SetY($image_y);
                                 $this->SetX($current_x);
                                 $this->ShowImage($img_w, $img_h, $path_to_image);
                                 //, false, 0);
                                 $this->SetY($current_y);
                                 $this->SetX($next_x);
                             }
                             $this->Cell(3, 6, EMPTY_STRING, 0, 0, CENTER);
                             $this->SetTextColor('Black');
                         }
                         $this->SetY($largest_y);
                     }
                 } else {
                     // Option values are displayed vertically
                     while ($products_options_name_values = olc_db_fetch_array($products_options_name)) {
                         $this->Ln(6);
                         $this->SetFont($this->font, BOLD, 11);
                         $this->Cell(190, $this->cells_height, $products_options_name_values['products_options_name'], 0, 0, LEFT);
                         $this->Ln();
                         $products_options_sql = str_replace(HASH, $products_options_name_values['products_options_id'], $products_options_sql0);
                         $products_options = olc_db_query($products_options_sql);
                         $count_options_values = olc_db_num_rows($products_options);
                         //OAI query
                         $products_options_query = olc_db_query($products_options_query_sql);
                         // Loop on all option values
                         while ($products_options_values = olc_db_fetch_array($products_options_query)) {
                             $this->SetFont($this->font, EMPTY_STRING, 9);
                             $this->SetTextColor($body_color_text[0], $body_color_text[1], $body_color_text[2]);
                             $option_string = $products_options_values['products_options_values_name'];
                             if (PDF_SHOW_OPTIONS_PRICE) {
                                 $options_values_price = $products_options_values['options_values_price'];
                                 if ($options_values_price != ' 0.0000') {
                                     $option_string .= LPAREN . $products_options_values['price_prefix'] . olc_format_price($options_values_price, true, true, true) . RPAREN;
                                 }
                             }
                             $count_options++;
                             $add_to = $count_options_values != $count_options ? ',' : '.';
                             $this->Write($this->cells_height, $option_string . $add_to);
                             if ($products_options_name_values['products_options_images_enabled'] == TRUE_STRING_S) {
                                 $path_to_image = DIR_IMAGE . 'options/' . $products_options_values['products_options_values_thumbnail'];
                                 $img_size = GetImageSize($path_to_image);
                                 $img_h = $img_size[1] * $this->pdf_to_mm_faktor;
                                 $img_w = $img_size[0] * $this->pdf_to_mm_faktor;
                                 $this->SetX(50);
                                 $this->ShowImage($img_w, $img_h, $path_to_image);
                                 //, false, 0);
                                 $this->SetX(0);
                             }
                             $this->Ln();
                         }
                         // end loop on options values
                     }
                     // end loop on options
                 }
             } else {
                 $this->Ln(-$this->cells_height);
                 while ($products_options_name_values = olc_db_fetch_array($products_options_name)) {
                     $this->Ln($this->cells_height);
                     $this->SetFont($this->font, BOLD, 11);
                     $this->Cell($this->w, $this->cells_height, $products_options_name_values['products_options_name'], 0, 0, LEFT);
                     $this->Ln();
                     $products_options_sql = str_replace(HASH, $products_options_name_values['products_options_id'], $products_options_sql0);
                     $products_options = olc_db_query($products_options_sql);
                     $option_string = EMPTY_STRING;
                     $count_options_values = olc_db_num_rows($products_options);
                     $count_options = 0;
                     while ($products_options_values = olc_db_fetch_array($products_options)) {
                         $option_string .= $products_options_values['products_options_values_name'];
                         //. $option_value;
                         if (PDF_SHOW_OPTIONS_PRICE) {
                             $options_values_price = $products_options_values['options_values_price'];
                             if ($options_values_price != ' 0.0000') {
                                 $option_string .= LPAREN . $products_options_values['price_prefix'] . olc_format_price($options_values_price, true, true, true) . RPAREN;
                             }
                         }
                         $count_options++;
                         $option_string .= $count_options_values != $count_options ? COMMA_BLANK : DOT;
                     }
                     $this->SetFont($this->font, EMPTY_STRING, 8);
                     $w = $this->w - $this->lMargin - $this->rMargin;
                     $this->SetX($this->lMargin);
                     $this->MultiCell($w, $this->cells_height, $option_string, 0, LEFT, 1);
                 }
             }
         }
     }
     $s = $products_data['PRODUCTS_SOLD_OUT'];
     if ($s) {
         $this->Ln($this->cells_height * 2);
         $y = $this->GetY();
         $this->SetTextColor('red');
         $this->SetFont($this->font, BOLD, $this->FontSizePt);
         $s = strip_tags($s);
         $this->Text($this->lMargin, $y, $s);
         $s1 = $products_data['PRODUCTS_DATE_AVAILABLE'];
         if ($s1) {
             $this->SetTextColor('Darkgreen');
             $this->Text($this->lMargin + $this->GetStringWidth($s), $y, BLANK . strip_tags($s1));
         }
         $this->Ln($this->cells_height);
     }
     if (PDF_SHOW_DATE_ADDED_AVAILABLE) {
         //Date available
         $s = $products_data['PRODUCTS_DATE_ADDED'];
         if ($s) {
             $x = $this->GetX();
             $y = $this->GetY();
             $this->SetFont($this->font, ITALIC, 9);
             $this->Ln($this->cells_height);
             $new_color_table = explode(COMMA, PDF_HEADER_COLOR_TABLE);
             $this->SetFillColor($new_color_table[0], $new_color_table[1], $new_color_table[2]);
             $product_name_color_text = explode(COMMA, PDF_PRODUCT_NAME_COLOR_TEXT);
             $this->SetTextColor($product_name_color_text[0], $product_name_color_text[1], $product_name_color_text[2]);
             $this->MultiCell(0, $this->cells_height, sprintf(TEXT_DATE_ADDED, olc_date_short($s)), 0, LEFT, 1);
         }
     }
 }
コード例 #17
0
//get all auction templates
$auctionssql = SELECT . "predef_id, quantity, title, subtitle, c.name catname, cat1, startprice, binprice, duration,\n\tt.name typename FROM " . TABLE_AUCTION_PREDEFINITION . " p, " . TABLE_EBAY_CATEGORIES . " c, " . TABLE_EBAY_AUCTIONTYPE . " t\n\twhere\n\tp.cat1 = c.id and\n\tp.auction_type = t.id " . $ordersql;
$myauctions = olc_db_query($auctionssql);
/* define Table Heading */
$heading = array(array($name_text => AUCTIONS_TEXT_AUCTION_PREDEF_ID, $attributes_text => $align_right_text, $sort_text => str_replace(HASH, $predef_id_text, $sort0), $link_text => $file . $predef_id_text), array($name_text => AUCTIONS_TEXT_AUCTION_AMOUNT, $attributes_text => $align_right_text, $sort_text => str_replace(HASH, $product_id_text, $sort0), $link_text => $file . $product_id_text), array($name_text => AUCTIONS_TEXT_AUCTION_CAT, $attributes_text => $align_right_text, $sort_text => str_replace(HASH, $cat1_text, $sort0), $link_text => $file . $cat1_text), array($name_text => AUCTIONS_TEXT_AUCTION_START_PRICE, $attributes_text => $align_right_text, $sort_text => str_replace(HASH, $startprice_text, $sort0), $link_text => $file . $startprice_text), array($name_text => AUCTIONS_TEXT_AUCTION_BUYNOW_PRICE, $attributes_text => $align_right_text, $sort_text => str_replace(HASH, $binprice_text, $sort0), $link_text => $file . $binprice_text), array($name_text => AUCTIONS_TEXT_AUCTION_PREDEF_DURATION, $attributes_text => $align_right_text, $sort_text => str_replace(HASH, $duration_text, $sort0), $link_text => $file . $duration_text), array($name_text => AUCTIONS_TEXT_AUCTION_PREDEF_TYPE, $attributes_text => $align_right_text, $sort_text => str_replace(HASH, $typename_text, $sort0), $link_text => $file . $typename_text, array($name_text => HTML_NBSP)));
/* print table heading */
$main_content .= tableheading($heading);
$i = 0;
while ($auctions_values = olc_db_fetch_array($myauctions)) {
    /* define content array */
    $i++;
    if ($i % 2 == 0) {
        $class = $dataTableRow_1_text;
    } else {
        $class = $dataTableRow_text;
    }
    $startprice = $auctions_values[$startprice_text];
    $startprice = $startprice == 0 ? DASH : olc_format_price($startprice, 1, 1, 1);
    $binprice = $auctions_values[$binprice_text];
    $binprice = $binprice == 0 ? DASH : olc_format_price($binprice, 1, 1, 1);
    $content = array($cssclass_text => $class, $values_text => array(array($value_text => $auctions_values[$predef_id_text], $link_text => $getItem_text . $auctions_values[$predef_id_text], $linkattribute_text => $target_blank_text), array($value_text => $auctions_values[$quantity_text] . $x_text . $auctions_values[$title_text] . HTML_BR . $auctions_values[$subtitle_text]), array($value_text => $auctions_values[$catname_text] . HTML_BR . "(" . $auctions_values[$cat1_text] . RPAREN, $attributes_text => $align_right_text), array($value_text => $startprice, $attributes_text => $align_right_text), array($value_text => $binprice, $attributes_text => $align_right_text), array($value_text => $auctions_values[$duration_text] . AUCTIONS_TEXT_AUCTION_DURATION_DAYS), array($value_text => $auctions_values[$typename_text], $attributes_text => $align_right_text), array($value_text => olc_draw_form('edit_form', FILENAME_AUCTIONS_NEW) . olc_draw_hidden_field('id', $auctions_values[$predef_id_text]) . olc_draw_submit_button('edit', AUCTIONS_TEXT_AUCTION_PREDEF_ACCEPT) . '
		</form>', $attributes_text => $align_right_text)));
    /* print content table */
    $main_content .= tablecontent($content);
}
$page_header_title = AUCTIONS_TEXT_HEADER;
$page_header_subtitle = AUCTIONS_TEXT_SUB_HEADER_PREDEF;
$page_header_icon_image = HEADING_MODULES_ICON;
$show_column_right = true;
$no_left_menu = false;
require PROGRAM_FRAME;
コード例 #18
0
function olc_price_adjust($price, $faktor)
{
    $price = $price * $faktor;
    return olc_format_price($price, true, true, true);
}
コード例 #19
0
                <td nowrap="nowrap" width="142" class="main" style="border: 1px solid;">
<?php 
            $personal_offer0 = $staffel_values['personal_offer'];
            $personal_offer = $personal_offer0;
            if ($is_brutto) {
                /*
                $tax_query = olc_db_query("select tax_rate from " . TABLE_TAX_RATES . " where tax_class_id = '" .
                	$pInfo->products_tax_class_id . "' ");
                $tax = olc_db_fetch_array($tax_query);
                */
                $personal_offer = $personal_offer * $tax_rate;
            }
            $products_price = olc_round($personal_offer, PRICE_PRECISION);
            echo $products_price;
            if ($is_brutto) {
                echo ' <br/>' . TEXT_NETTO . HTML_B_START . olc_format_price(olc_round($personal_offer0, PRICE_PRECISION), 1, 1) . '</b>  ';
            }
            ?>
 </td>
                <td width="80" align="left"><?php 
            echo olc_draw_separator('pixel_trans.gif', '1', '10');
            ?>
                	<a href="<?php 
            echo olc_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&function=delete&quantity=' . $staffel_values['quantity'] . '&statusID=' . $products_id . '&action=new_product&pID=' . $_GET['pID']);
            ?>
">
                	<?php 
            echo olc_image_button('button_delete.gif', IMAGE_DELETE);
            ?>
</a>
                </td>
コード例 #20
0
/* print table heading */
$main_content = tableheading($heading);
$i = 0;
while ($auctions_values = olc_db_fetch_array($myauctions)) {
    $mybidcount = $auctions_values[$bidcount_text];
    if ($mybidcount == 0) {
        $currentprice = DASH;
    } else {
        $currentprice = olc_format_price($auctions_values[$bidprice_text], 1, 1, 1);
    }
    /* define content array */
    $i++;
    if ($i % 2 == 0) {
        $class = $dataTableRow_1_text;
    } else {
        $class = $dataTableRow_text;
    }
    $startprice = $auctions_values[$startprice_text];
    $startprice = $startprice == 0 ? DASH : olc_format_price($startprice, 1, 1, 1);
    $buynowprice = $auctions_values[$buynowprice_text];
    $buynowprice = $buynowprice == 0 ? DASH : olc_format_price($buynowprice, 1, 1, 1);
    $auction_title = $auctions_values[$auction_title_text];
    $auction_id = $auctions_values[$auction_id_text];
    $content = array($cssclass_text => $class, $values_text => array(array($value_text => $auctions_values[$quantity_text] . $x_text . $auction_title, $link_text => EBAY_SERVER . EBAY_VIEWITEM . $auction_title . APOS, $linkattribute_text => $target_blank_text, $attributes_text => $align_right_text), array($value_text => $auction_id, $link_text => $getItem_text . $auction_id, $linkattribute_text => $target_blank_text, $attributes_text => $align_right_text), array($value_text => $startprice, $attributes_text => $align_right_text), array($value_text => $buynowprice, $attributes_text => $align_right_text), array($value_text => GMT1($auctions_values[$starttime_text]), $attributes_text => $align_right_text), array($value_text => GMT1($auctions_values[$endtime_text]), $attributes_text => $align_right_text), array($value_text => $mybidcount, $attributes_text => $align_right_text), array($value_text => $currentprice, $attributes_text => $align_right_text)));
    /* print content table */
    $main_content .= tablecontent($content);
}
$page_header_subtitle = AUCTIONS_TEXT_SUB_HEADER_AUCTION_LIST;
$show_column_right = true;
$no_left_menu = false;
require PROGRAM_FRAME;
コード例 #21
0
                    }
                    $shipping_block .= '
											<tr class="moduleRow' . $id . ' onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)"
												onclick="javascript:selectRowEffect(this, ' . $radio_buttons . ')">' . NEW_LINE;
                    if ($OptionBoxRight) {
                        $shipping_block .= '
												<td class="main" width="75%">' . $current_quotes_methods['title'] . '</td>';
                    } else {
                        $shipping_block .= '
												<td class="main" align="left" width="10">' . olc_draw_radio_field('shipping', $current_id, $checked) . '
												</td>';
                    }
                    if (!CUSTOMER_SHOW_PRICE_TAX) {
                        $current_quotes['tax'] = 0;
                    }
                    $cost = olc_format_price(olc_add_tax($current_quotes_methods['cost'], $current_quotes['tax']), $price_special = 1, $calculate_currencies = true);
                    if ($n > 1 || $n2 > 1) {
                        $radio = olc_draw_radio_field('shipping', $current_id, $checked);
                        if ($OptionBoxRight) {
                            $shipping_block .= '
											<td class="main">' . $cost . '</td>
											<td class="main" align="right">' . $radio . '</td>';
                        } else {
                            $shipping_block .= '
											<td class="main" width="75%" align="left">' . $current_quotes_methods['title'] . '</td>
											<td class="main">' . $cost . '</td>';
                        }
                    } else {
                        $shipping_block .= '
											<td class="main" align="right" colspan="2">' . $cost . $radio . '</td>';
                    }
コード例 #22
0
 $smarty->assign('FAX', $customer['customers_fax']);
 //
 // Kunden-Faxnummer
 //
 // get products data
 $order_query = olc_db_query("SELECT\n        \t\t\t\tproducts_id,\n        \t\t\t\torders_products_id,\n        \t\t\t\tproducts_model,\n        \t\t\t\tproducts_name,\n        \t\t\t\tproducts_price,\n        \t\t\t\tfinal_price,\n        \t\t\t\tproducts_quantity\n        \t\t\t\tFROM " . TABLE_ORDERS_PRODUCTS . "\n        \t\t\t\tWHERE orders_id='" . $oID . APOS);
 $order_data = array();
 while ($order_data_values = olc_db_fetch_array($order_query)) {
     $attributes_query = olc_db_query("SELECT\n        \t\t\t\tproducts_options,\n        \t\t\t\tproducts_options_values,\n        \t\t\t\tprice_prefix,\n        \t\t\t\toptions_values_price\n        \t\t\t\tFROM " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . "\n        \t\t\t\tWHERE orders_products_id='" . $order_data_values['orders_products_id'] . APOS);
     $attributes_data = EMPTY_STRING;
     $attributes_model = EMPTY_STRING;
     while ($attributes_data_values = olc_db_fetch_array($attributes_query)) {
         $attributes_data .= HTML_BR . $attributes_data_values['products_options'] . ': ' . $attributes_data_values['products_options_values'];
         $attributes_model .= HTML_BR . olc_get_attributes_model($order_data_values['products_id'], $attributes_data_values['products_options_values']);
     }
     $order_data[] = array('PRODUCTS_MODEL' => $order_data_values['products_model'], 'PRODUCTS_NAME' => $order_data_values['products_name'], 'PRODUCTS_ATTRIBUTES' => $attributes_data, 'PRODUCTS_ATTRIBUTES_MODEL' => $attributes_model, 'PRODUCTS_PRICE' => olc_format_price_order($order_data_values['final_price'], 1, $order->info['currency']), 'PRODUCTS_SINGLE_PRICE' => olc_format_price($order_data_values['products_price'], $price_special = 1, $calculate_currencies = 0, $show_currencies = 1), 'PRODUCTS_QTY' => $order_data_values['products_quantity']);
 }
 // get order_total data
 $oder_total_query = olc_db_query("SELECT\n  \t\t\t\t\ttitle,\n  \t\t\t\t\ttext,\n            class,\n            value,\n  \t\t\t\t\tsort_order\n  \t\t\t\t\tFROM " . TABLE_ORDERS_TOTAL . "\n  \t\t\t\t\tWHERE orders_id='" . $oID . "'\n  \t\t\t\t\tORDER BY sort_order ASC");
 $order_total = array();
 while ($oder_total_values = olc_db_fetch_array($oder_total_query)) {
     $order_total[] = array('TITLE' => $oder_total_values['title'], 'CLASS' => $oder_total_values['class'], 'VALUE' => $oder_total_values['value'], 'TEXT' => $oder_total_values['text']);
     if ($oder_total_values['class'] = 'ot_total') {
         $total = $oder_total_values['value'];
     }
 }
 // assign language to template for caching
 $smarty->assign('oID', $oID);
 if ($order->info['payment_method'] != EMPTY_STRING && $order->info['payment_method'] != 'no_payment') {
     include DIR_WS_LANGUAGES . SESSION_LANGUAGE . '/modules/payment/' . $order->info['payment_method'] . PHP;
     $payment_method = constant(strtoupper('MODULE_PAYMENT_' . $order->info['payment_method'] . '_TEXT_TITLE'));
コード例 #23
0
             } else {
                 require_once DIR_FS_INC . 'olc_date_short.inc.php';
                 $products_date_available = sprintf(TEXT_DATE_AVAILABLE, olc_date_short($products_date_available));
                 $products_status = EMPTY_STRING;
             }
         } else {
             $products_date_available = EMPTY_STRING;
         }
     }
     if ($products_date_available == EMPTY_STRING) {
         $products_price = str_replace(CURRENCY_DECIMAL_POINT, DOT, $products_price);
         $products_price = -$products_price;
         $products_price = olc_format_price($products_price, true, true);
         $products_price_real = str_replace(CURRENCY_DECIMAL_POINT, DOT, $products_price_real);
         $products_price_real = -$products_price_real;
         $products_price_real = olc_format_price($products_price_real, true, true);
     } else {
         require_once DIR_FS_INC . 'olc_get_smarty_config_variable.inc.php';
         $info_smarty->assign('PRODUCTS_SOLD_OUT', olc_get_smarty_config_variable($info_smarty, 'product_info', 'product_not_in_stock'));
         $products_price = str_replace(DASH, EMPTY_STRING, $products_price);
     }
 } else {
     $products_date_available = EMPTY_STRING;
 }
 //W. Kaiser - Baseprice
 require_once DIR_FS_INC . 'olc_get_vpe_and_baseprice_info.inc.php';
 olc_get_vpe_and_baseprice_info($info_smarty, $product_info, $products_price);
 //W. Kaiser - Baseprice
 $info_smarty->assign('PRODUCTS_MODEL', $product_info['products_model']);
 $info_smarty->assign('PRODUCTS_DATE_AVAILABLE', $products_date_available);
 $info_smarty->assign('PRODUCTS_ADDED', sprintf(TEXT_DATE_ADDED, olc_date_short($product_info['products_date_added'])));
コード例 #24
0
}
//W. Kaiser - AJAX
if (CUSTOMER_SHOW_PRICE) {
    if ($not_show_saved_cart) {
        $price_raw = $_SESSION['cart']->show_total();
        $span_price_start = '<span id="cart_total_price_1">';
    }
    $price = olc_format_price($price_raw, $price_special = 1, $calculate_currencies = false);
    if (IS_AJAX_PROCESSING) {
        $price = $span_price_start . $price . $span_end;
    }
    $total_content = EMPTY_STRING;
    if (CUSTOMER_SHOW_OT_DISCOUNT) {
        if (CUSTOMER_OT_DISCOUNT != '0.00') {
            $price_discounted = olc_recalculate_price($price_raw, CUSTOMER_OT_DISCOUNT);
            $price = ltrim(olc_format_price(price_discounted, $price_special = 1, $calculate_currencies = false));
            if (IS_AJAX_PROCESSING) {
                $price = $span_price_start . $price . $span_end;
                $price = olc_draw_hidden_field("total_discount_value", CUSTOMER_OT_DISCOUNT) . '<span id="cart_total_discount">' . $price . $span_end;
            }
            $total_content = CUSTOMER_OT_DISCOUNT . ' % ' . SUB_TITLE_OT_DISCOUNT . ' - ' . $price . HTML_BR;
        }
    }
    $total_content .= SUB_TITLE_TOTAL . $price;
} else {
    $total_content .= TEXT_INFO_SHOW_PRICE_NO;
}
$total_content .= HTML_BR;
// display only if there is an ot_discount
if (CUSTOMER_OT_DISCOUNT != 0) {
    $total_content .= TEXT_CART_OT_DISCOUNT . CUSTOMER_OT_DISCOUNT . ' %';
コード例 #25
0
                 //$main_content.=$new_table_line;
                 $current_row = $new_table_line;
                 $line++;
             }
             $current_image++;
             $products_id = $product['products_id'];
             $link = olc_href_link(FILENAME_DEFAULT, str_replace(HASH, $products_id, $parameters));
             $products_min_order_quantity = max(1, $product['products_min_order_quantity']);
             if ($products_min_order_quantity > 1) {
                 $trailer = str_replace(ONE_STRING, $products_min_order_quantity, $trailer0);
             } else {
                 $trailer = $trailer0;
             }
             $buy_now = str_replace(ATSIGN, $products_name, $header . $link . $trailer);
             $products_price = olc_get_products_price_specials($products_id, $price_special = 1, $quantity = 1, $price_special_info, $products_price_real);
             $buy_now = str_replace(TILDE, olc_format_price(abs($products_price_real), 1, 0, 0), $buy_now);
             $buy_now = str_replace(PARA, $line, $buy_now);
             if ($current_image == 1) {
                 $s = PRODUCTS_LINE_IMAGE . $line;
             } else {
                 $s = EMPTY_STRING;
             }
             //$main_content .=
             $current_row .= $td_start . olc_image($products_image, $title, $width, PRODUCT_IMAGE_THUMBNAIL_HEIGHT, str_replace(ATSIGN, $s, $parameter)) . NEW_LINE . $buy_now . NEW_LINE . $td_end;
         }
     }
 }
 if ($main_content) {
     $current_row = str_replace('100%', EMPTY_STRING, $current_row);
     //$main_content= $table_start.$main_content.$table_end;
     $main_content .= $current_row . $table_end;
コード例 #26
0
 function LoadData($column_width)
 {
     $this->dash_array = array(HTML_MDASH, HTML_NDASH);
     if (DO_GROUP_CHECK) {
         $group_check = " c." . $this->group_check_group . SQL_AND;
     }
     if (!$this->fsk18_check_condition) {
         $fsk_lock = ' p.products_fsk18!=1 ' . SQL_AND;
     }
     $query = "language_id='" . $this->_pdf_lang . APOS;
     $query = SELECT . "\n\t\t\t\t\tp.products_id,\n\t\t\t\t\tp.products_model,\n\t\t\t\t\tp.products_image,\n\t\t\t\t\tp.products_fsk18,\n\t\t\t\t\tp.products_shippingtime,\n\t\t\t\t\tp.products_price,\n          p.products_uvp,\n          p.products_vpe,\n          p.products_vpe_status,\n          p.products_vpe_value,\n          p.products_baseprice_show,\n          p.products_baseprice_value,\n\t\t\t\t\tp.products_min_order_quantity,\n\t\t\t\t\tp.products_min_order_vpe,\n          p.products_uvp,\n\t\t\t\t\tpd.products_name,\n\t\t\t\t\tpd.products_short_description,\n\t\t\t\t\tcd.categories_name\n\t\t\t\t\tFROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd\n\t\t\t\t\tWHERE\n\t\t\t\t\tc.categories_status=1 " . SQL_AND . $group_check . $fsk_lock . "\n\t\t\t\t\tp.products_status=1 AND\n\t\t\t\t\t(cd.categories_id=c.categories_id AND cd." . $query . ") AND\n\t\t\t\t\t(pd.products_id=p.products_id AND pd." . $query . ") AND\n\t\t\t\t\tptc.categories_id=c.categories_id AND\n\t\t\t\t\tp.products_id=ptc.products_id AND\n\t\t\t\t\tp.products_price > 0 AND\n\t\t\t\t\tpd.products_name <> ''\n\t\t\t\t\tORDER BY cd.categories_name, pd.products_name";
     $product_query = olc_db_query($query);
     $this->data = EMPTY_STRING;
     if (olc_db_num_rows($product_query)) {
         $show_shipping = ACTIVATE_SHIPPING_STATUS == TRUE_STRING_S;
         if ($show_shipping) {
             if (!$this->shipping_status_name) {
                 $this->shipping_status_name = array();
                 $this->shipping_status_name[] = EMPTY_STRING;
                 $shipping_status_query = olc_db_query(SELECT . "shipping_status_name" . SQL_FROM . TABLE_SHIPPING_STATUS . " where language_id='" . $this->_pdf_lang . APOS);
                 while ($shipping_status = olc_db_fetch_array($shipping_status_query)) {
                     $this->shipping_status_name[] = $shipping_status['shipping_status_name'];
                 }
             }
         }
         $this->two_lines = $this->descr_lines_height + $this->descr_lines_height;
         $this->spalte = $this->columns;
         $this->last_header = EMPTY_STRING;
         $this->new_page = true;
         $this->new_height = 0;
         if (NO_STORE) {
             $this->data_sets = 1;
         }
         $lparen = LPAREN;
         $rparen = RPAREN;
         $blank_apos = " '";
         $xx = 0;
         while ($product = olc_db_fetch_array($product_query)) {
             //W. Kaiser - AJAX
             $data[$xx][$this->item_name] = prepare_string_item($product['products_name'], 2, $column_width);
             $data[$xx][$this->item_image] = $product['products_image'];
             $products_id = $product[products_id];
             $data[$xx][$this->item_id] = $products_id;
             $olPrice = $this->olcCheckSpecial($products_id);
             if (!$olPrice) {
                 $olPrice = $product['products_price'];
             }
             $this_array = array();
             olc_get_vpe_and_baseprice_info($this_array, $product, $olPrice);
             $vpe = $this_array['PRODUCTS_BASEPRICE'];
             if ($vpe) {
                 $vpe = BLANK . prepare_string_item($vpe, 1, 1000);
             }
             $data[$xx][$this->item_price] = TEXT_PRICE . olc_format_price($olPrice, true, true, true, true) . $vpe;
             $vpe = $this_array['PRODUCTS_UVP'];
             if ($vpe) {
                 $data[$xx][$this->item_uvp] = strip_tags($vpe);
                 $this->have_uvp = true;
             }
             $data[$xx][$this->item_cat_name] = TEXT_PRODUCT_GROUP . $blank_apos . trim($product['categories_name']) . APOS;
             $vpe = $this_array['PRODUCTS_VPE'];
             if ($vpe) {
                 $vpe = $lparen . $vpe . $rparen;
             }
             $data[$xx][$this->item_model] = TEXT_MODEL_NUMBER . $product['products_model'] . $vpe;
             $products_short_description = str_replace(HTML_NBSP, BLANK, $product['products_short_description']);
             $data[$xx][$this->item_sd_1] = prepare_string_item($products_short_description, 1, $column_width);
             $data[$xx][$this->item_sd_2] = prepare_string_item($products_short_description, 2, $column_width);
             if ($show_shipping) {
                 $data[$xx][$this->item_shippingtime] = TEXT_SHIPPING_TIME . $this->shipping_status_name[$product['products_shippingtime']];
             }
             $data[$xx][$this->item_pict_disc] = TEXT_PICTURE_DISCLAIMER;
             $min_qty = $this_array['PRODUCTS_MIN_ORDER_QTY'];
             if ($min_qty) {
                 $data[$xx][$this->item_min_qty] = $min_qty;
             }
             //W. Kaiser - AJAX
             if (STORE) {
                 $xx++;
             } else {
                 $this->data = $data;
                 $this->format();
             }
         }
         if (STORE) {
             $this->data = $data;
         }
     }
 }
コード例 #27
0
        if ($show_date_range) {
            $text .= HTML_BR . ltrim($lparen . strftime($date_format_1, $from_date)) . $sep . ltrim(strftime($date_format_1, $to_date)) . $rparen;
        }
        $conv_query = str_replace($param1, $date_from, $conv_query_raw);
        $conv_query = str_replace($param2, $date_to, $conv_query);
        $conv_query = olc_db_query($conv_query);
        if (olc_db_num_rows($conv_query)) {
            $have_no_entry = true;
            $current_content .= '
  <tr>
' . str_replace(HASH, $text, $line);
            while ($conv = olc_db_fetch_array($conv_query)) {
                $count = $conv[$count_text];
                if ($count) {
                    $have_no_entry = false;
                    $current_content .= str_replace(HASH, olc_format_price($conv[$value_text], 1, 1), $line_right) . str_replace(HASH, olc_format_price($conv[$avg_text], 1, 1), $line_right) . str_replace(HASH, $count, $line_right);
                } else {
                    break;
                }
            }
            if ($have_no_entry) {
                $current_content .= $no_entry_line;
            }
            $current_content .= '
  </tr>
';
        }
    }
    if ($current_content) {
        $current_content .= '
</table>
コード例 #28
0
function olc_get_products_price($products_id, $price_special, $quantity, &$price_real)
{
    global $price_data;
    // check if customer is allowed to see prices (if not -> no price calculations , show error message)
    if (CUSTOMER_SHOW_PRICE) {
        // load price data into array for further use!
        $product_price_query = olc_db_query(SELECT . "\n\t  products_price,\n\t\tproducts_discount_allowed,\n\t\tproducts_tax_class_id\n\t\tFROM " . TABLE_PRODUCTS . "\n\t\tWHERE\n\t\tproducts_id = '" . $products_id . APOS);
        $product_price = olc_db_fetch_array($product_price_query);
        $price_real = $product_price['products_price'];
        $price_data = array('PRODUCTS_PRICE' => $price_real, 'PRODUCTS_UVP' => $price_uvp, 'PRODUCTS_DISCOUNT_ALLOWED' => $product_price['products_discount_allowed'], 'PRODUCT_TAX_CLASS_ID' => $product_price['products_tax_class_id']);
        // check if user is allowed to see tax rates
        if (CUSTOMER_SHOW_PRICE_TAX) {
            // get tax rate for tax class
            $products_tax = olc_get_tax_rate($price_data['PRODUCT_TAX_CLASS_ID']);
        } else {
            $products_tax = 0;
        }
        // end !CUSTOMER_SHOW_PRICE_TAX
        $price_data['PRODUCTS_TAX_VALUE'] = $products_tax . ' %';
        // check if special price is aviable for product (no product discount on special prices!)
        //W. Kaiser - AJAX
        $special_price = olc_get_products_special_price($products_id);
        if ($special_price) {
            //W. Kaiser - AJAX
            $special_price = olc_add_tax($special_price, $products_tax);
            $price = olc_add_tax($price_data['PRODUCTS_PRICE'], $products_tax);
            $price_data['PRODUCTS_PRICE'] = $price;
            $price_string = olc_format_special_price($special_price, $price, $price_special, true, $quantity, $products_tax);
        } else {
            // if ($special_price=olc_get_products_special_price($products_id))
            // Check if there is another price for customers_group (if not, take norm price and calculte discounts (NOTE: no discount on group PRICES(only OT DISCOUNT!)!
            $table_personal_offers = TABLE_PERSONAL_OFFERS_BY_CUSTOMERS_STATUS . CUSTOMER_STATUS_ID;
            $group_price_query = olc_db_query(SELECT . "\n\t\t\tpersonal_offer\n      FROM " . $table_personal_offers . "\n      WHERE products_id='" . $products_id . APOS);
            $group_price_data = olc_db_fetch_array($group_price_query);
            // if we found a price, everything is ok. If not, we will use normal price
            if ($group_price_data['personal_offer'] and $group_price_data['personal_offer'] != '0.0000') {
                $price_string = $group_price_data['personal_offer'];
                // check if customer is allowed to get graduated prices
                if (CUSTOMER_SHOW_GRADUATED_PRICE) {
                    // check if there are graduated prices in db
                    // get quantity for products
                    // modifikations for new graduated prices
                    $qty = olc_get_qty($products_id);
                    if (!olc_get_qty($products_id)) {
                        $qty = $quantity;
                    }
                    $graduated_price_query = olc_db_query(SELECT . "\n\t\t\t\t\t\t\t\tmax(quantity)\n                FROM " . $table_personal_offers . "\n                WHERE products_id='" . $products_id . "'\n                AND quantity<='" . $qty . APOS);
                    $graduated_price_data = olc_db_fetch_array($graduated_price_query);
                    // get singleprice
                    $graduated_price_query = olc_db_query(SELECT . "\n\t\t\t\t\t\tpersonal_offer\n\t          FROM " . $table_personal_offers . "\n            WHERE products_id='" . $products_id . "'\n            AND quantity='" . $graduated_price_data['max(quantity)'] . APOS);
                    $graduated_price_data = olc_db_fetch_array($graduated_price_query);
                    $price_string = $graduated_price_data['personal_offer'];
                }
                $price_string = olc_add_tax($price_string, $products_tax);
                //*$quantity;
            } else {
                // if 	($group_price_data['personal_offer']!=EMPTY_STRING and $group_price_data['personal_offer']!='0.0000')
                $price_string = olc_add_tax($price_data['PRODUCTS_PRICE'], $products_tax);
                //*$quantity;
                // check if product allows discount
                if ($price_data['PRODUCTS_DISCOUNT_ALLOWED'] != '0.00') {
                    $discount = $price_data['PRODUCTS_DISCOUNT_ALLOWED'];
                    // check if group discount > max. discount on product
                    if ($discount > CUSTOMER_DISCOUNT) {
                        $discount = CUSTOMER_DISCOUNT;
                    }
                    // calculate price with rabatt
                    $rabatt_string = $price_string - $price_string / 100 * $discount;
                    if ($price_string == $rabatt_string) {
                        $price_string = olc_format_price($price_string * $quantity, $price_special, true);
                    } else {
                        $price_string = olc_format_special_price($rabatt_string, $price_string, $price_special, false, $quantity, $products_tax);
                    }
                    return $price_string;
                    break;
                }
            }
            // format price & calculate currency
            $price_string = olc_format_price($price_string * $quantity, $price_special, $calculate_currencies = true);
        }
    } else {
        // return message, if not allowed to see prices
        $price_string = NOT_ALLOWED_TO_SEE_PRICES;
    }
    return $price_string;
}
コード例 #29
0
/* print table heading */
$main_content .= tableheading($heading);
$auction_endprice_text = 'auction_endprice';
$order_number_text = 'order_number';
$order_icon = olc_image(DIR_WS_ICONS . 'order.gif', BOX_ORDERS) . BLANK;
$link = olc_href_link(FILENAME_ORDERS, 'oID=#&action=edit');
$i = 0;
while ($auctions_values = olc_db_fetch_array($myauctions)) {
    $i++;
    if ($i % 2 == 0) {
        $class = $dataTableRow_1_text;
    } else {
        $class = $dataTableRow_text;
    }
    /* define content array */
    $quantity = $auctions_values[$quantity_text];
    $auction_id = $auctions_values[$auction_id_text];
    $buyer_id = $auctions_values[$buyer_id_text];
    $buyer_land = $auctions_values[$buyer_land_text];
    $auction_endprice = $auctions_values[$auction_endprice_text];
    $auction_endprice = olc_format_price($auction_endprice, 1, 1, 1);
    $endtime = $auctions_values[$endtime_text];
    $order_number = $auctions_values[$order_number_text];
    $content = array($cssclass_text => $class, $values_text => array(array($value_text => $quantity . $x_text . BLANK . $auctions_values[$auction_title_text], $link_text => EBAY_SERVER . EBAY_VIEWITEM . $auction_id . APOS, $linkattribute_text => $target_blank_text, $attributes_text => $align_right_text), array($value_text => $auction_id, $link_text => $getItem_text . $auction_id, $linkattribute_text => $target_blank_text, $attributes_text => $align_right_text), array($value_text => $buyer_id . $comma_blank_text . $auctions_values[$buyer_name_text] . HTML_BR . $auctions_values[$buyer_email_text]), array($value_text => $buyer_land . DASH . $auctions_values[$buyer_zip_text] . BLANK . $auctions_values[$buyer_city_text] . HTML_BR . $auctions_values[$buyer_street_text], $attributes_text => $align_right_text), array($value_text => $auction_endprice, $attributes_text => $align_right_text), array($value_text => GMT1($endtime), array($value_text => olc_image . $order_number, $link_text => str_replace(HASH, $order_number, $link), $attributes_text => $align_right_text))));
    /* print content table */
    $main_content .= tablecontent($content);
}
$page_header_subtitle = AUCTIONS_TEXT_SUB_HEADER_AUCTION_SOLD_ORDER;
$show_column_right = true;
$no_left_menu = false;
require PROGRAM_FRAME;
コード例 #30
0
 function process()
 {
     global $order, $currencies, $cod_cost, $cod_country, $shipping;
     if (strtolower(MODULE_ORDER_TOTAL_COD_STATUS) == TRUE_STRING_S) {
         //Will become true, if cod can be processed.
         $cod_country = false;
         //check if payment method is cod. If yes, check if cod is possible.
         if ($_SESSION['payment'] == 'cod') {
             //process installed shipping modules
             $shipping_id = $_SESSION['shipping']['id'];
             $split_text = "[:,]";
             if ($shipping_id == 'flat_flat') {
                 $cod_zones = split($split_text, MODULE_ORDER_TOTAL_COD_FEE_FLAT);
             } elseif ($shipping_id == 'item_item') {
                 $cod_zones = split($split_text, MODULE_ORDER_TOTAL_COD_FEE_ITEM);
             } elseif ($shipping_id == 'table_table') {
                 $cod_zones = split($split_text, MODULE_ORDER_TOTAL_COD_FEE_TABLE);
             } elseif ($shipping_id == 'zones_zones') {
                 $cod_zones = split($split_text, MODULE_ORDER_TOTAL_COD_FEE_ZONES);
             } elseif ($shipping_id == 'ap_ap') {
                 $cod_zones = split($split_text, MODULE_ORDER_TOTAL_COD_FEE_AP);
             } elseif ($shipping_id == 'dp_dp') {
                 $cod_zones = split($split_text, MODULE_ORDER_TOTAL_COD_FEE_DP);
             } elseif ($shipping_id == 'dpd_dpd') {
                 $cod_zones = split($split_text, MODULE_ORDER_TOTAL_COD_FEE_DPD);
             } elseif ($shipping_id == 'ups_ups') {
                 $cod_zones = split($split_text, MODULE_ORDER_TOTAL_COD_FEE_UPS);
             } elseif ($shipping_id == 'upse_upse') {
                 $cod_zones = split($split_text, MODULE_ORDER_TOTAL_COD_FEE_UPSE);
             } elseif ($shipping_id == 'freeamountausl_freeamountausl') {
                 $cod_zones = split($split_text, MODULE_ORDER_TOTAL_COD_FEE_FREEAMOUNTAUSL);
             } elseif ($shipping_id == 'freeamount_freeamount') {
                 $cod_zones = split($split_text, MODULE_ORDER_TOTAL_COD_FEE_FREEAMOUNT);
             }
             $country_iso_code_2 = $order->billing['country']['iso_code_2'];
             for ($i = 0; $i < count($cod_zones); $i++) {
                 if ($cod_zones[$i] == $country_iso_code_2) {
                     $cod_cost = $cod_zones[$i + 1];
                     $cod_country = true;
                     //print('match' . $cod_zones[$i] . ': ' . $cod_cost);
                     break;
                 } elseif ($cod_zones[$i] == '00') {
                     $cod_cost = $cod_zones[$i + 1];
                     $cod_country = true;
                     //print('match' . $i . ': ' . $cod_cost);
                     break;
                 } else {
                     //print('no match');
                 }
                 $i++;
             }
         } else {
             //COD selected, but no shipping module which offers COD
         }
         if ($cod_country) {
             $cod_tax = olc_get_tax_rate(MODULE_ORDER_TOTAL_COD_TAX_CLASS, $order->delivery['country']['id'], $order->delivery['zone_id']);
             $cod_tax_description = olc_get_tax_description(MODULE_ORDER_TOTAL_COD_TAX_CLASS, $order->delivery['country']['id'], $order->delivery['zone_id']);
             if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 1) {
                 $order->info['tax'] += olc_add_tax($cod_cost, $cod_tax) - $cod_cost;
                 $order->info['tax_groups'][TAX_ADD_TAX . "{$cod_tax_description}"] += olc_add_tax($cod_cost, $cod_tax) - $cod_cost;
                 $order->info['total'] += $cod_cost + (olc_add_tax($cod_cost, $cod_tax) - $cod_cost);
                 $cod_cost_value = olc_add_tax($cod_cost, $cod_tax);
                 $cod_cost = olc_format_price($cod_cost_value, $price_special = 1, $calculate_currencies = true);
             }
             if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 0 && $_SESSION['customers_status']['customers_status_add_tax_ot'] == 1) {
                 $order->info['tax'] += olc_add_tax($cod_cost, $cod_tax) - $cod_cost;
                 $order->info['tax_groups'][TAX_NO_TAX . "{$cod_tax_description}"] += olc_add_tax($cod_cost, $cod_tax) - $cod_cost;
                 $cod_cost_value = $cod_cost;
                 $cod_cost = olc_format_price($cod_cost, $price_special = 1, $calculate_currencies = true);
                 $order->info['subtotal'] += $cod_cost_value;
                 $order->info['total'] += $cod_cost_value;
             }
             if (!$cod_cost_value) {
                 $cod_cost_value = $cod_cost;
                 $cod_cost = olc_format_price($cod_cost, $price_special = 1, $calculate_currencies = true);
                 $order->info['total'] += $cod_cost_value;
             }
             $this->output[] = array('title' => $this->title . ':', 'text' => $cod_cost, 'value' => $cod_cost_value);
         } else {
             //Following code should be improved if we can't get the shipping modules disabled, who don't allow COD
             // as well as countries who do not have cod
             //          $this->output[] = array('title' => $this->title . ':',
             //                                  'text' => 'No COD for this module.',
             //                                  'value' => '');
         }
     }
 }