コード例 #1
0
 public function makeAttributeOrder($order_item_id = 0, $is_accessory = 0, $parent_section_id = 0, $stock = 0, $export = 0, $data = '')
 {
     $stockroomhelper = new rsstockroomhelper();
     $order_functions = new order_functions();
     $displayattribute = "";
     $chktag = $this->getApplyattributeVatOrNot($data);
     $product_attribute = "";
     $quantity = 0;
     $stockroom_id = "0";
     $orderItemdata = $order_functions->getOrderItemDetail(0, 0, $order_item_id);
     $products = $this->getProductById($orderItemdata[0]->product_id);
     if (count($orderItemdata) > 0 && $is_accessory != 1) {
         $product_attribute = $orderItemdata[0]->product_attribute;
         $quantity = $orderItemdata[0]->product_quantity;
         $stockroom_id = $orderItemdata[0]->stockroom_id;
     }
     $orderItemAttdata = $order_functions->getOrderItemAttributeDetail($order_item_id, $is_accessory, "attribute", $parent_section_id);
     // Get Attribute middle template
     $attribute_middle_template = $this->getAttributeTemplateLoop($data);
     $attribute_final_template = '';
     if (count($orderItemAttdata) > 0) {
         for ($i = 0; $i < count($orderItemAttdata); $i++) {
             $attribute = $this->getProductAttribute(0, 0, $orderItemAttdata[$i]->section_id);
             $hide_attribute_price = 0;
             if (count($attribute) > 0) {
                 $hide_attribute_price = $attribute[0]->hide_attribute_price;
             }
             if (!strstr($data, '{remove_product_attribute_title}')) {
                 $displayattribute .= "<div class='checkout_attribute_title'>" . urldecode($orderItemAttdata[$i]->section_name) . "</div>";
             }
             // Assign Attribute middle template in tmp variable
             $tmp_attribute_middle_template = $attribute_middle_template;
             $tmp_attribute_middle_template = str_replace("{product_attribute_name}", urldecode($orderItemAttdata[$i]->section_name), $tmp_attribute_middle_template);
             $orderPropdata = $order_functions->getOrderItemAttributeDetail($order_item_id, $is_accessory, "property", $orderItemAttdata[$i]->section_id);
             for ($p = 0; $p < count($orderPropdata); $p++) {
                 $property_price = $orderPropdata[$p]->section_price;
                 if ($stock == 1) {
                     $stockroomhelper->manageStockAmount($orderPropdata[$p]->section_id, $quantity, $orderPropdata[$p]->stockroom_id, "property");
                 }
                 $property = $this->getAttibuteProperty($orderPropdata[$p]->section_id);
                 $virtualNumber = "";
                 if (count($property) > 0 && $property[0]->property_number) {
                     $virtualNumber = "<div class='checkout_attribute_number'>" . $property[0]->property_number . "</div>";
                 }
                 if (!empty($chktag)) {
                     $property_price = $orderPropdata[$p]->section_price + $orderPropdata[$p]->section_vat;
                 }
                 if ($export == 1) {
                     $disPrice = " (" . $orderPropdata[$p]->section_oprand . REDCURRENCY_SYMBOL . $property_price . ")";
                 } else {
                     $disPrice = "";
                     if (!$hide_attribute_price) {
                         $disPrice = " (" . $orderPropdata[$p]->section_oprand . $this->getProductFormattedPrice($property_price) . ")";
                     }
                     if (!strstr($data, '{product_attribute_price}')) {
                         $disPrice = '';
                     }
                     if (!strstr($data, '{product_attribute_number}')) {
                         $virtualNumber = '';
                     }
                 }
                 $displayattribute .= "<div class='checkout_attribute_wrapper'><div class='checkout_attribute_price'>" . urldecode($orderPropdata[$p]->section_name) . $disPrice . "</div>" . $virtualNumber . "</div>";
                 // Replace attribute property price and value
                 $tmp_attribute_middle_template = str_replace("{product_attribute_value}", urldecode($orderPropdata[$p]->section_name), $tmp_attribute_middle_template);
                 $tmp_attribute_middle_template = str_replace("{product_attribute_value_price}", $disPrice, $tmp_attribute_middle_template);
                 // Assign tmp variable to looping variable to get copy of all texts
                 $attribute_final_template .= $tmp_attribute_middle_template;
                 $orderSubpropdata = $order_functions->getOrderItemAttributeDetail($order_item_id, $is_accessory, "subproperty", $orderPropdata[$p]->section_id);
                 for ($sp = 0; $sp < count($orderSubpropdata); $sp++) {
                     $subproperty_price = $orderSubpropdata[$sp]->section_price;
                     if ($stock == 1) {
                         $stockroomhelper->manageStockAmount($orderSubpropdata[$sp]->section_id, $quantity, $orderSubpropdata[$sp]->stockroom_id, "subproperty");
                     }
                     $subproperty = $this->getAttibuteSubProperty($orderSubpropdata[$sp]->section_id);
                     $virtualNumber = "";
                     if (count($subproperty) > 0 && $subproperty[0]->subattribute_color_number) {
                         $virtualNumber = "<div class='checkout_subattribute_number'>[" . $subproperty[0]->subattribute_color_number . "]</div>";
                     }
                     if (!empty($chktag)) {
                         $subproperty_price = $orderSubpropdata[$sp]->section_price + $orderSubpropdata[$sp]->section_vat;
                     }
                     if ($export == 1) {
                         $disPrice = " (" . $orderSubpropdata[$sp]->section_oprand . REDCURRENCY_SYMBOL . $subproperty_price . ")";
                     } else {
                         $disPrice = "";
                         if (!$hide_attribute_price) {
                             $disPrice = " (" . $orderSubpropdata[$sp]->section_oprand . $this->getProductFormattedPrice($subproperty_price) . ")";
                         }
                         if (!strstr($data, '{product_attribute_price}')) {
                             $disPrice = '';
                         }
                         if (!strstr($data, '{product_attribute_number}')) {
                             $virtualNumber = '';
                         }
                     }
                     if (!strstr($data, '{remove_product_subattribute_title}')) {
                         $displayattribute .= "<div class='checkout_subattribute_title'>" . urldecode($subproperty[0]->subattribute_color_title) . " : </div>";
                     }
                     $displayattribute .= "<div class='checkout_subattribute_wrapper'><div class='checkout_subattribute_price'>" . urldecode($orderSubpropdata[$sp]->section_name) . $disPrice . "</div>" . $virtualNumber . "</div>";
                 }
             }
         }
     } else {
         $displayattribute = $product_attribute;
     }
     if ($products->use_discount_calc == 1) {
         $displayattribute = $displayattribute . $orderItemdata[0]->discount_calc_data;
     }
     $data = new stdClass();
     $data->product_attribute = $displayattribute;
     $data->attribute_middle_template = $attribute_final_template;
     $data->attribute_middle_template_core = $attribute_middle_template;
     return $data;
 }
コード例 #2
0
ファイル: order.php プロジェクト: jaanusnurmoja/redjoomla
 public function business_gls_export($cid)
 {
     $app = JFactory::getApplication();
     $oids = implode(',', $cid);
     $where = "";
     $redhelper = new redhelper();
     $order_helper = new order_functions();
     $shipping = new shipping();
     $exportfilename = 'redshop_gls_order_export.csv';
     /* Start output to the browser */
     if (ereg('Opera(/| )([0-9].[0-9]{1,2})', $_SERVER['HTTP_USER_AGENT'])) {
         $UserBrowser = "Opera";
     } elseif (ereg('MSIE ([0-9].[0-9]{1,2})', $_SERVER['HTTP_USER_AGENT'])) {
         $UserBrowser = "IE";
     } else {
         $UserBrowser = '';
     }
     $mime_type = $UserBrowser == 'IE' || $UserBrowser == 'Opera' ? 'application/octetstream' : 'application/octet-stream';
     /* Clean the buffer */
     while (@ob_end_clean()) {
     }
     header('Content-Type: ' . $mime_type);
     header('Content-Encoding: UTF-8');
     header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
     if ($UserBrowser == 'IE') {
         header('Content-Disposition: inline; filename="' . $exportfilename . '"');
         header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
         header('Pragma: public');
     } else {
         header('Content-Disposition: attachment; filename="' . $exportfilename . '"');
         header('Pragma: no-cache');
     }
     if ($cid[0] != 0) {
         $where = " WHERE order_id IN (" . $oids . ")";
     }
     $db = JFactory::getDbo();
     $q = "SELECT * FROM #__redshop_orders " . $where . " ORDER BY order_id asc";
     $db->setQuery($q);
     $gls_arr = $db->loadObjectList();
     echo "Order_number,Quantity,Create_date,total_weight,reciever_firstName,reciever_lastname,Customer_note";
     echo "\r\n";
     for ($i = 0; $i < count($gls_arr); $i++) {
         $details = explode("|", $shipping->decryptShipping(str_replace(" ", "+", $gls_arr[$i]->ship_method_id)));
         if ($details[0] == 'shipper') {
             $orderproducts = $order_helper->getOrderItemDetail($gls_arr[$i]->order_id);
             $shippingDetails = $order_helper->getOrderShippingUserInfo($gls_arr[$i]->order_id);
             $billingDetails = $order_helper->getOrderBillingUserInfo($gls_arr[$i]->order_id);
             $totalWeight = "";
             $qty = "";
             for ($c = 0; $c < count($orderproducts); $c++) {
                 $product_id[] = $orderproducts[$c]->product_id;
                 $qty += $orderproducts[$c]->product_quantity;
                 $content_products[] = $orderproducts[$c]->order_item_name;
                 $sql = "SELECT weight FROM #__redshop_product WHERE product_id ='" . $orderproducts[$c]->product_id . "'";
                 $db->setQuery($sql);
                 $weight = $db->loadResult();
                 $totalWeight += $weight * $orderproducts[$c]->product_quantity;
             }
             $userDetail = ',"' . $shippingDetails->firstname . ' ' . $shippingDetails->lastname . '","' . $gls_arr[$i]->customer_note;
             echo '"' . $gls_arr[$i]->order_number . '","' . $qty . '","' . date("d-m-Y", $gls_arr[$i]->cdate) . '","' . $totalWeight . '","' . $userDetail . '"';
             echo "\r\n";
         }
     }
     exit;
 }
コード例 #3
0
    function display($tpl = null)
    {
        $config = new Redconfiguration();
        $redTemplate = new Redtemplate();
        $order_functions = new order_functions();
        $producthelper = new producthelper();
        $model = $this->getModel();
        $redTemplate = new Redtemplate();
        $detail = $this->get('data');
        $carthelper = new rsCarthelper();
        $shippinghelper = new shipping();
        $products = $order_functions->getOrderItemDetail($detail->order_id);
        $template = $model->getStockNoteTemplate();
        if (count($template) > 0 && $template->template_desc != "") {
            $html_template = $template->template_desc;
        } else {
            $html_template = '<table border="0" cellspacing="2" cellpadding="2" width="100%"><tr><td>{order_id_lbl} : {order_id}</td><td> {order_date_lbl} : {order_date}</td></tr></table>
                       <table border="1" cellspacing="0" cellpadding="0" width="100%"><tbody><tr style="background-color: #d7d7d4"><th align="center">{product_name_lbl}</th> <th align="center">{product_number_lbl}</th> <th align="center">{product_quantity_lbl}</th></tr>
						{product_loop_start}
						<tr>
						<td  align="center">
							<table>
							<tr><td>{product_name}</td></tr>
							<tr><td>{product_attribute}</td></tr>
							</table>
						</td>
						<td  align="center">{product_number}</td>
						<td  align="center">{product_quantity}</td>
						</tr>
						{product_loop_end}
						</tbody>
						</table>';
        }
        ob_start();
        if (strstr($html_template, "{product_loop_start}") && strstr($html_template, "{product_loop_end}")) {
            $template_sdata = explode('{product_loop_start}', $html_template);
            $template_start = $template_sdata[0];
            $template_edata = explode('{product_loop_end}', $template_sdata[1]);
            $template_end = $template_edata[1];
            $template_middle = $template_edata[0];
            $middle_data = '';
            for ($p = 0; $p < count($products); $p++) {
                $middle_data .= $template_middle;
                $product_detail = $producthelper->getProductById($products[$p]->product_id);
                $middle_data = str_replace("{product_number}", $product_detail->product_number, $middle_data);
                $middle_data = str_replace("{product_name}", $products[$p]->order_item_name, $middle_data);
                $middle_data = str_replace("{product_attribute}", $products[$p]->product_attribute, $middle_data);
                $middle_data = str_replace("{product_quantity}", $products[$p]->product_quantity, $middle_data);
            }
            $html_template = $template_start . $middle_data . $template_end;
        }
        $html_template = str_replace("{order_id_lbl}", JText::_('COM_REDSHOP_ORDER_ID'), $html_template);
        $html_template = str_replace("{order_id}", $detail->order_id, $html_template);
        $html_template = str_replace("{order_date_lbl}", JText::_('COM_REDSHOP_ORDER_DATE'), $html_template);
        $html_template = str_replace("{order_date}", $config->convertDateFormat($detail->cdate), $html_template);
        $html_template = str_replace("{product_name_lbl}", JText::_('COM_REDSHOP_PRODUCT_NAME'), $html_template);
        $html_template = str_replace("{product_number_lbl}", JText::_('COM_REDSHOP_PRODUCT_NUMBER'), $html_template);
        $html_template = str_replace("{product_quantity_lbl}", JText::_('COM_REDSHOP_QUANTITY'), $html_template);
        $billing = $order_functions->getOrderBillingUserInfo($detail->order_id);
        $html_template = $carthelper->replaceBillingAddress($html_template, $billing);
        $shipping = $order_functions->getOrderShippingUserInfo($detail->order_id);
        $html_template = $carthelper->replaceShippingAddress($html_template, $shipping);
        $html_template = str_replace("{requisition_number}", $detail->requisition_number, $html_template);
        $html_template = str_replace("{requisition_number_lbl}", JText::_('COM_REDSHOP_REQUISITION_NUMBER'), $html_template);
        // start pdf code
        $pdfObj = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, 'A5', true, 'UTF-8', false);
        $pdfObj->SetTitle("Order StockNote: " . $detail->order_id);
        $pdfObj->SetAuthor('redSHOP');
        $pdfObj->SetCreator('redSHOP');
        $pdfObj->SetMargins(15, 15, 15);
        $font = 'times';
        $pdfObj->SetHeaderData('', '', '', "Order " . $detail->order_id);
        $pdfObj->setHeaderFont(array($font, '', 10));
        //$pdfObj->setFooterFont(array($font, '', 8));
        $pdfObj->SetFont($font, "", 10);
        //$pdfObj->AliasNbPages();
        $pdfObj->AddPage();
        $pdfObj->WriteHTML($html_template);
        $pdfObj->Output("StocNoteOrder_" . $detail->order_id . ".pdf", "D");
        exit;
    }
コード例 #4
0
">
		<?php 
    echo $this->escape(JText::_('COM_REDSHOP_ORDER_DETAILS'));
    ?>
</div>
<?php 
}
?>
	<div><?php 
echo ORDER_DETAIL_INTROTEXT;
?>
</div>
<?php 
$model = $this->getModel('order_detail');
$OrdersDetail = $this->OrdersDetail;
$OrderProducts = $order_functions->getOrderItemDetail($oid);
$partialpayment = $order_functions->getOrderPartialPayment($oid);
// Get order Payment method information
if (USE_AS_CATALOG) {
    $orderslist_template = $redTemplate->getTemplate("catalogue_order_detail");
    $orderslist_template = $orderslist_template[0]->template_desc;
} else {
    $orderslist_template = $redTemplate->getTemplate("order_detail");
    if (count($orderslist_template) > 0 && $orderslist_template[0]->template_desc) {
        $orderslist_template = $orderslist_template[0]->template_desc;
    } else {
        $orderslist_template = '<div class="product_print">{print}</div><table style="width: 100%;" border="0" cellspacing="0" cellpadding="5"><tbody><tr><td colspan="2"><table style="width: 100%;" border="0" cellspacing="0" cellpadding="2"><tbody><tr style="background-color: #cccccc"><th align="left">{discount_type_lbl}</th></tr><tr><td>{discount_type}</td></tr><tr style="background-color: #cccccc;"><th align="left">{order_information_lbl}</th></tr><tr></tr><tr><td>{order_id_lbl} : {order_id}</td></tr><tr><td>{order_number_lbl} : {order_number}</td></tr><tr><td>{order_date_lbl} : {order_date}</td></tr><tr><td>{order_status_lbl} : {order_status}</td></tr></tbody></table></td></tr><tr><td colspan="2"><table style="width: 100%;" border="0" cellspacing="0" cellpadding="2"><tbody><tr style="background-color: #cccccc;"><th align="left">{billing_address_information_lbl}</th></tr><tr></tr><tr><td>{billing_address}</td></tr></tbody></table></td></tr><tr><td colspan="2"><table style="width: 100%;" border="0" cellspacing="0" cellpadding="2"><tbody><tr style="background-color: #cccccc;"><th align="left">{shipping_address_information_lbl}</th></tr><tr></tr><tr><td>{shipping_address}</td></tr></tbody></table></td></tr><tr><td colspan="2"><table style="width: 100%;" border="0" cellspacing="0" cellpadding="2"><tbody><tr style="background-color: #cccccc;"><th align="left">{order_detail_lbl}</th></tr><tr></tr><tr><td><table style="width: 100%;" border="0" cellspacing="2" cellpadding="2"><tbody><tr><td>{copy_orderitem_lbl}</td><td>{product_name_lbl}</td><td>{note_lbl}</td><td>{price_lbl}</td><td>{quantity_lbl}</td><td align="right">{total_price_lbl}</td></tr>{product_loop_start}<tr><td>{copy_orderitem}</td><td>{product_name}<br />{product_attribute}{product_accessory}{product_userfields}</td><td>{product_wrapper}</td><td>{product_price}</td><td>{product_quantity}</td><td align="right">{product_total_price}</td></tr>{product_loop_end}</tbody></table></td></tr><tr><td>{customer_note_lbl}: {customer_note}</td></tr><tr><td>{requisition_number_lbl}: {requisition_number}</td></tr><tr><td><table class="cart_calculations" border="1"><tbody><tr class="tdborder"><td><b>Product Subtotal:</b></td><td width="100">{product_subtotal}</td><td><b>Product Subtotal excl vat:</b></td><td width="100">{product_subtotal_excl_vat}</td></tr><tr><td><b>Shipping with vat:</b></td><td width="100">{shipping}</td><td><b>Shipping excl vat:</b></td><td width="100">{shipping_excl_vat}</td></tr>{if discount}<tr class="tdborder"><td>{discount_lbl}</td><td width="100">{discount}</td><td>{discount_lbl}</td><td width="100">{discount_excl_vat}</td></tr>{discount end if}<tr><td><b>{totalpurchase_lbl}:</b></td><td width="100">{order_subtotal}</td><td><b>{subtotal_excl_vat_lbl} :</b></td><td width="100">{order_subtotal_excl_vat}</td></tr>{if vat}<tr class="tdborder"><td>{vat_lbl}</td><td width="100">{tax}</td><td>{vat_lbl}</td><td width="100">{sub_total_vat}</td></tr>{vat end if}   {if payment_discount}<tr><td>{payment_discount_lbl}</td><td width="100">{payment_order_discount}</td></tr>{payment_discount end if}<tr class="tdborder"><td><b>{tax_with_shipping_lbl}</b></td><td width="100">{shipping}</td><td><b>{shipping_lbl}</b></td><td width="100">{shipping_excl_vat}</td></tr><tr><td><div class="singleline"><strong>{total_lbl}:</strong></div></td><td width="100"><div class="singleline">{order_total}</div></td><td><div class="singleline"><b>{total_lbl}:</b></div></td><td width="100"><div class="singleline">{total_excl_vat}</div></td></tr></tbody></table></td></tr><tr><td align="left">{reorder_button}</td></tr></tbody></table></td></tr></tbody></table>';
    }
}
if ($print) {
    $onclick = "onclick='window.print();'";
コード例 #5
0
 * @subpackage  Template
 *
 * @copyright   Copyright (C) 2005 - 2013 redCOMPONENT.com. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */
defined('_JEXEC') or die;
require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/order.php';
include_once JPATH_COMPONENT . '/helpers/helper.php';
$configobj = new Redconfiguration();
$order_functions = new order_functions();
$redhelper = new redhelper();
$url = JURI::base();
$Itemid = $redhelper->getCheckoutItemid();
$order_id = JRequest::getInt('oid');
$order = $order_functions->getOrderDetails($order_id);
$orderitem = $order_functions->getOrderItemDetail($order_id);
if ($order->order_total > 0 && !USE_AS_CATALOG) {
    $paymentmethod = $order_functions->getOrderPaymentDetail($order_id);
    $paymentmethod = $order_functions->getPaymentMethodInfo($paymentmethod[0]->payment_method_class);
    $paymentmethod = $paymentmethod[0];
    $paymentpath = JPATH_SITE . '/plugins/redshop_payment/' . $paymentmethod->element . '/' . $paymentmethod->element . '.xml';
    $paymentparams = new JRegistry($paymentmethod->params);
    echo '<div>';
    $is_creditcard = $paymentparams->get('is_creditcard', '');
    $is_redirected = $paymentparams->get('is_redirected', 0);
    if (!$is_creditcard || $is_redirected == 1) {
        $adminpath = JPATH_ADMINISTRATOR . '/components/com_redshop';
        $invalid_elements = $paymentparams->get('invalid_elements', '');
        // Send the order_id and orderpayment_id to the payment plugin so it knows which DB record to update upon successful payment
        $billingaddresses = $order_functions->getBillingAddress($order->user_id);
        if (isset($billingaddresses)) {
コード例 #6
0
 public function special_discount($data, $chk = false)
 {
     $redshopMail = new redshopMail();
     $orderdata = $this->getTable('order_detail');
     $orderdata->load($this->_id);
     $order_functions = new order_functions();
     $OrderItems = $order_functions->getOrderItemDetail($this->_id);
     if (!$orderdata->special_discount) {
         $orderdata->special_discount = 0;
     }
     if (!$orderdata->special_discount_amount) {
         $orderdata->special_discount_amount = 0;
     }
     if ($data['special_discount'] == $orderdata->special_discount && $chk != true) {
         return false;
     }
     $special_discount = $data['special_discount'];
     $subtotal = 0;
     $subtotal_excl_vat = 0;
     for ($i = 0; $i < count($OrderItems); $i++) {
         if ($order_item_id != $OrderItems[$i]->order_item_id) {
             $subtotal_excl_vat = $subtotal_excl_vat + $OrderItems[$i]->product_item_price_excl_vat * $OrderItems[$i]->product_quantity;
             $subtotal = $subtotal + $OrderItems[$i]->product_item_price * $OrderItems[$i]->product_quantity;
         }
     }
     $discount_price = $subtotal * $special_discount / 100;
     $orderdata->special_discount = $special_discount;
     $orderdata->special_discount_amount = $discount_price;
     $order_total = $subtotal + $orderdata->order_shipping - $discount_price - $orderdata->order_discount;
     $orderdata->order_total = $order_total;
     $orderdata->mdate = time();
     if (!$orderdata->store()) {
         return false;
     }
     if (ECONOMIC_INTEGRATION == 1) {
         $economic = new economic();
         $invoiceHandle = $economic->renewInvoiceInEconomic($orderdata);
     }
     // Send mail from template
     $redshopMail->sendOrderSpecialDiscountMail($this->_id);
     return true;
 }
コード例 #7
0
    $print_url = $url . "index.php?option=com_redshop&view=orders&print=1&tmpl=component&Itemid=" . $Itemid;
    $onclick = "onclick='window.open(\"{$print_url}\",\"mywindow\",\"scrollbars=1\",\"location=1\")'";
}
$print_tag = "<a " . $onclick . " title='" . JText::_('COM_REDSHOP_PRINT_LBL') . "'>";
$print_tag .= "<img src='" . JSYSTEM_IMAGES_PATH . "printButton.png' alt='" . JText::_('COM_REDSHOP_PRINT_LBL') . "' title='" . JText::_('COM_REDSHOP_PRINT_LBL') . "' />";
$print_tag .= "</a>";
$template_desc = str_replace("{print}", $print_tag, $template_desc);
if (strstr($template_desc, "{product_loop_start}") && strstr($template_desc, "{product_loop_end}")) {
    $template_sdata = explode('{product_loop_start}', $template_desc);
    $template_start = $template_sdata[0];
    $template_edata = explode('{product_loop_end}', $template_sdata[1]);
    $template_end = $template_edata[1];
    $template_middle = $template_edata[0];
    $cart_mdata = "";
    for ($i = 0; $i < count($this->detail); $i++) {
        $prolist = $order_function->getOrderItemDetail($this->detail[$i]->order_id);
        $statusname = $order_function->getOrderStatusTitle($this->detail[$i]->order_status);
        $order_item_name = array();
        for ($j = 0; $j < count($prolist); $j++) {
            $order_item_name[$j] = $prolist[$j]->order_item_name;
        }
        $orderdetailurl = JRoute::_('index.php?option=com_redshop&view=order_detail&oid=' . $this->detail[$i]->order_id);
        $reorderurl = JUri::root() . 'index.php?option=com_redshop&view=order_detail&order_id=' . $this->detail[$i]->order_id . '&task=reorder&tmpl=component';
        $order_number = "<div class='order_number'>" . $this->detail[$i]->order_number . "</div>";
        $order_id = "<div class='order_id'>" . $this->detail[$i]->order_id . "</div>";
        $order_products = "<div class='order_products'>" . implode(',<br/>', $order_item_name) . "</div>";
        $order_total = "<div class='order_total'>" . $producthelper->getProductFormattedPrice($this->detail[$i]->order_total) . "</div>";
        $order_date = "<div class='order_date'>" . $redconfig->convertDateFormat($this->detail[$i]->cdate) . "</div>";
        $order_status = "<div class='order_status'>" . $statusname . "</div>";
        $order_detail_link = "<div class='order_detail_link'><a href='" . $orderdetailurl . "'>" . JText::_('COM_REDSHOP_ORDER_DETAIL') . "</a></div>";
        $reorder_link = "<div class='reorder_link'><a href='javascript:if(confirm(\"" . JText::_('COM_REDSHOP_CONFIRM_CART_EMPTY') . "\")){window.location=\"" . $reorderurl . "\";}'>" . JText::_('COM_REDSHOP_REORDER') . "</a></div>";
コード例 #8
0
ファイル: order.php プロジェクト: jaanusnurmoja/redjoomla
 public function export_data()
 {
     /**
      * new order export for paid customer support
      */
     $extrafile = JPATH_SITE . '/administrator/components/com_redshop/extras/order_export.php';
     if (file_exists($extrafile)) {
         require_once JPATH_COMPONENT_ADMINISTRATOR . '/extras/order_export.php';
         $orderExport = new orderExport();
         $orderExport->createOrderExport();
         exit;
     }
     $producthelper = new producthelper();
     $order_function = new order_functions();
     $model = $this->getModel('order');
     $product_count = array();
     $db = JFactory::getDbo();
     $cid = JRequest::getVar('cid', array(0), 'method', 'array');
     $data = $model->export_data($cid);
     $order_id = implode(',', $cid);
     $where = "";
     if ($order_id != 0) {
         $where .= " where order_id IN (" . $order_id . ") ";
     }
     $sql = "SELECT order_id,count(order_item_id) as noproduct FROM `#__redshop_order_item`  " . $where . " GROUP BY order_id";
     header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
     header("Content-type: text/x-csv");
     header("Content-type: text/csv");
     header("Content-type: application/csv");
     header('Content-Disposition: attachment; filename=Order.csv');
     $db->setQuery($sql);
     $no_products = $db->loadObjectList();
     for ($i = 0; $i < count($data); $i++) {
         $product_count[] = $no_products[$i]->noproduct;
     }
     $no_products = max($product_count);
     echo "Order id,Buyer name,Email Id, PhoneNumber,Billing Address ,Billing City,Billing State,Billing Country,BillingPostcode,\n\t\tShipping Address,Shipping City,Shipping State,Shipping Country,ShippingPostCode,Order Status,Order Date,";
     for ($i = 1; $i <= $no_products; $i++) {
         echo JText::_('PRODUCT_NAME') . $i . ',';
         echo JText::_('PRODUCT') . ' ' . JText::_('PRODUCT_PRICE') . $i . ',';
         echo JText::_('PRODUCT_ATTRIBUTE') . $i . ',';
     }
     echo "Shipping Cost,Order Total\n";
     for ($i = 0; $i < count($data); $i++) {
         $shipping_address = $order_function->getOrderShippingUserInfo($data[$i]->order_id);
         echo $data[$i]->order_id . ",";
         echo $data[$i]->firstname . " " . $data[$i]->lastname . ",";
         echo $data[$i]->user_email . ",";
         echo $data[$i]->phone . ",";
         $user_address = str_replace(",", "<br/>", $data[$i]->address);
         $user_address = strip_tags($user_address);
         $user_shipping_address = str_replace(",", "<br/>", $shipping_address->address);
         $user_shipping_address = strip_tags($user_shipping_address);
         echo trim($user_address) . ",";
         echo $data[$i]->city . ",";
         echo $data[$i]->state_code . ",";
         echo $data[$i]->country_code . ",";
         echo $data[$i]->zipcode . ",";
         echo trim($user_shipping_address) . ",";
         echo $shipping_address->city . ",";
         echo $shipping_address->state_code . ",";
         echo $shipping_address->country_code . ",";
         echo $shipping_address->zipcode . ",";
         echo $order_function->getOrderStatusTitle($data[$i]->order_status) . ",";
         echo date('d-m-Y H:i', $data[$i]->cdate) . ",";
         $no_items = $order_function->getOrderItemDetail($data[$i]->order_id);
         for ($it = 0; $it < count($no_items); $it++) {
             echo $no_items[$it]->order_item_name . ",";
             echo REDCURRENCY_SYMBOL . $no_items[$it]->product_final_price . ",";
             $product_attribute = $producthelper->makeAttributeOrder($no_items[$it]->order_item_id, 0, $no_items[$it]->product_id, 0, 1);
             $product_attribute = strip_tags($product_attribute->product_attribute);
             echo trim($product_attribute) . ",";
         }
         $temp = $no_products - count($no_items);
         echo str_repeat(',', $temp * 3);
         if ($data[$i]->order_shipping != "") {
             $shippingcost = $data[$i]->order_shipping;
         } else {
             $shippingcost = 0;
         }
         echo REDCURRENCY_SYMBOL . $shippingcost . ",";
         echo REDCURRENCY_SYMBOL . $data[$i]->order_total . "\n";
     }
     exit;
 }
コード例 #9
0
$mycnt = '';
for ($k = 0; $k < count($mysplit); $k++) {
    $replace = '';
    if ($mysplit[$k] != '') {
        $mycnt = count($mysplit);
        //exit;
        //echo $mypost;exit;
        $option = JRequest::getVar('option');
        $config = new Redconfiguration();
        $model = $this->getModel('order_detail');
        $extra_field = new extra_field();
        $uri = JURI::getInstance();
        $url = $uri->root();
        $redTemplate = new Redtemplate();
        //$model = $this->getModel ( 'order_detail' );
        $OrderProducts = $order_functions->getOrderItemDetail($mysplit[$k]);
        $OrdersDetail = $order_functions->getmultiOrderDetails($mysplit[$k]);
        $billing = $order_functions->getOrderBillingUserInfo($OrdersDetail[0]->order_id);
        $shipping = $order_functions->getOrderShippingUserInfo($OrdersDetail[0]->order_id);
        $is_company = $billing->is_company;
        if (!$shipping) {
            $shipping = $billing;
        }
        //$partialpayment = $order_functions->getOrderPartialPayment ( $OrdersDetail->order_id );
        //// get order Payment method information
        $paymentmethod = $order_functions->getOrderPaymentDetail($mysplit[$k]);
        $paymentmethod = $paymentmethod[0];
        $order_print_template = $redTemplate->getTemplate("order_print");
        if (count($order_print_template) > 0 && $order_print_template[0]->template_desc != "") {
            $ordersprint_template = $order_print_template[0]->template_desc;
        } else {
コード例 #10
0
ファイル: mail.php プロジェクト: jaanusnurmoja/redjoomla
    public function createMultiprintInvoicePdf($oid)
    {
        require_once JPATH_SITE . '/components/com_redshop/helpers/tcpdf/config/lang/eng.php';
        require_once JPATH_SITE . '/components/com_redshop/helpers/tcpdf/tcpdf.php';
        $order_functions = new order_functions();
        $shippinghelper = new shipping();
        $carthelper = new rsCarthelper();
        $extra_field = new extra_field();
        $redconfig = new Redconfiguration();
        $redTemplate = new Redtemplate();
        $producthelper = new producthelper();
        $message = "";
        $pdfObj = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, 'A5', true, 'UTF-8', false);
        $pdfObj->SetTitle('Shipped');
        $pdfObj->SetAuthor('redSHOP');
        $pdfObj->SetCreator('redSHOP');
        $pdfObj->SetMargins(8, 8, 8);
        // Changed font to support Unicode Characters - Specially Polish Characters
        $font = 'freeserif';
        $pdfObj->setImageScale(PDF_IMAGE_SCALE_RATIO);
        $pdfObj->setHeaderFont(array($font, '', 8));
        // Set font
        $pdfObj->SetFont($font, "", 6);
        $order_id = "";
        for ($o = 0; $o < count($oid); $o++) {
            $body = "";
            $message = "";
            $order_id = $oid[$o];
            $OrderProducts = $order_functions->getOrderItemDetail($order_id);
            $OrdersDetail = $order_functions->getmultiOrderDetails($order_id);
            $billing = $order_functions->getOrderBillingUserInfo($OrdersDetail[0]->order_id);
            $shipping = $order_functions->getOrderShippingUserInfo($OrdersDetail[0]->order_id);
            $is_company = $billing->is_company;
            if (!$shipping) {
                $shipping = $billing;
            }
            $paymentmethod = $order_functions->getOrderPaymentDetail($order_id);
            $paymentmethod = $paymentmethod[0];
            $order_print_template = $redTemplate->getTemplate("order_print");
            if (count($order_print_template) > 0 && $order_print_template[0]->template_desc != "") {
                $ordersprint_template = $order_print_template[0]->template_desc;
            } else {
                $ordersprint_template = '<table style="width: 100%;" border="0" cellpadding="5" cellspacing="0">
				<tbody><tr><td colspan="2"><table style="width: 100%;" border="0" cellpadding="2" cellspacing="0"><tbody>
				<tr style="background-color: #cccccc;"><th align="left">{order_information_lbl}{print}</th></tr><tr></tr
				><tr><td>{order_id_lbl} : {order_id}</td></tr><tr><td>{order_number_lbl} : {order_number}</td></tr><tr>
				<td>{order_date_lbl} : {order_date}</td></tr><tr><td>{order_status_lbl} : {order_status}</td></tr><tr>
				<td>{shipping_method_lbl} : {shipping_method} : {shipping_rate_name}</td></tr><tr><td>{payment_lbl} : {payment_method}</td>
				</tr></tbody></table></td></tr><tr><td colspan="2"><table style="width: 100%;" border="0" cellpadding="2" cellspacing="0">
				<tbody><tr style="background-color: #cccccc;"><th align="left">{billing_address_information_lbl}</th>
				</tr><tr></tr><tr><td>{billing_address}</td></tr></tbody></table></td></tr><tr><td colspan="2">
				<table style="width: 100%;" border="0" cellpadding="2" cellspacing="0"><tbody><tr style="background-color: #cccccc;">
				<th align="left">{shipping_address_info_lbl}</th></tr><tr></tr><tr><td>{shipping_address}</td></tr></tbody>
				</table></td></tr><tr><td colspan="2"><table style="width: 100%;" border="0" cellpadding="2" cellspacing="0">
				<tbody><tr style="background-color: #cccccc;"><th align="left">{order_detail_lbl}</th></tr><tr></tr><tr><td>
				<table style="width: 100%;" border="0" cellpadding="2" cellspacing="2"><tbody><tr><td>{product_name_lbl}</td><td>{note_lbl}</td>
				<td>{price_lbl}</td><td>{quantity_lbl}</td><td align="right">Total Price</td></tr>{product_loop_start}<tr>
				<td><p>{product_name}<br />{product_attribute}{product_accessory}{product_userfields}</p></td>
				<td>{product_wrapper}{product_thumb_image}</td><td>{product_price}</td><td>{product_quantity}</td>
				<td align="right">{product_total_price}</td></tr>{product_loop_end}</tbody></table></td></tr><tr>
				<td></td></tr><tr><td><table style="width: 100%;" border="0" cellpadding="2" cellspacing="2"><tbody>
				<tr align="left"><td align="left"><strong>{order_subtotal_lbl} : </strong></td><td align="right">{order_subtotal}</td>
				</tr>{if vat}<tr align="left"><td align="left"><strong>{vat_lbl} : </strong></td><td align="right">{order_tax}</td>
				</tr>{vat end if}{if discount}<tr align="left"><td align="left"><strong>{discount_lbl} : </strong></td>
				<td align="right">{order_discount}</td></tr>{discount end if}<tr align="left"><td align="left">
				<strong>{shipping_lbl} : </strong></td><td align="right">{order_shipping}</td></tr><tr align="left">
				<td colspan="2" align="left"><hr /></td></tr><tr align="left"><td align="left"><strong>{total_lbl} :</strong>
				</td><td align="right">{order_total}</td></tr><tr align="left"><td colspan="2" align="left"><hr /><br />
				 <hr /></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>';
            }
            $print_tag = "<a onclick='window.print();' title='" . JText::_('COM_REDSHOP_PRINT') . "'>" . "<img src=" . JSYSTEM_IMAGES_PATH . "printButton.png  alt='" . JText::_('COM_REDSHOP_PRINT') . "' title='" . JText::_('COM_REDSHOP_PRINT') . "' /></a>";
            $search[] = "{print}";
            $replace[] = $print_tag;
            $search[] = "{order_id}";
            $replace[] = $OrdersDetail[0]->order_id;
            $search[] = "{order_number}";
            $replace[] = $OrdersDetail[0]->order_number;
            $search[] = "{order_date}";
            $replace[] = $redconfig->convertDateFormat($OrdersDetail[0]->cdate);
            $search[] = "{customer_note}";
            $replace[] = $OrdersDetail[0]->customer_note;
            // Set order paymethod name
            $search[] = "{payment_lbl}";
            $replace[] = JText::_('COM_REDSHOP_ORDER_PAYMENT_METHOD');
            $search[] = "{payment_method}";
            $replace[] = $paymentmethod->order_payment_name;
            $statustext = $order_functions->getOrderStatusTitle($OrdersDetail[0]->order_status);
            $issplit = $OrdersDetail[0]->split_payment;
            $search[] = "{order_status}";
            if (trim($OrdersDetail[0]->order_payment_status) == 'Paid') {
                $orderPaymentStatus = JText::_('COM_REDSHOP_PAYMENT_STA_PAID');
            } elseif (trim($OrdersDetail[0]->order_payment_status) == 'Unpaid') {
                $orderPaymentStatus = JText::_('COM_REDSHOP_PAYMENT_STA_UNPAID');
            } elseif (trim($OrdersDetail[0]->order_payment_status) == 'Partial Paid') {
                $orderPaymentStatus = JText::_('COM_REDSHOP_PAYMENT_STA_PARTIAL_PAID');
            } else {
                $orderPaymentStatus = $OrdersDetail[0]->order_payment_status;
            }
            $replace[] = $statustext . " - " . $orderPaymentStatus;
            $search[] = "{order_status_order_only}";
            $replace[] = $statustext;
            $search[] = "{order_status_payment_only}";
            $replace[] = $orderPaymentStatus;
            $search[] = "{customer_note_lbl}";
            $replace[] = JText::_('COM_REDSHOP_COMMENT');
            $search[] = "{customer_note}";
            $replace[] = $OrdersDetail->customer_note;
            $search[] = "{shipping_method_lbl}";
            $replace[] = JText::_('COM_REDSHOP_SHIPPING_METHOD_LBL');
            $shipping_method = '';
            $shipping_rate_name = '';
            if ($OrdersDetail[0]->ship_method_id != '') {
                $ship_method = explode("|", $shippinghelper->decryptShipping(str_replace(" ", "+", $OrdersDetail[0]->ship_method_id)));
                if (count($ship_method) <= 1) {
                    $ship_method = explode("|", $OrdersDetail[0]->ship_method_id);
                }
                $shipping_method = "";
                $shipping_rate_name = "";
                if (count($ship_method) > 0) {
                    if (array_key_exists(1, $ship_method)) {
                        $shipping_method = $ship_method[1];
                    }
                    if (array_key_exists(2, $ship_method)) {
                        $shipping_rate_name = $ship_method[2];
                    }
                }
            }
            $search[] = "{shipping_method}";
            $replace[] = $shipping_method;
            $search[] = "{shipping}";
            $replace[] = $producthelper->getProductFormattedPrice($OrdersDetail[0]->order_shipping);
            $search[] = "{shipping_rate_name}";
            $replace[] = $shipping_rate_name;
            $ordersprint_template = $carthelper->replaceBillingAddress($ordersprint_template, $billing);
            $ordersprint_template = $carthelper->replaceShippingAddress($ordersprint_template, $shipping);
            $product_name = "";
            $product_note = "";
            $product_price = "";
            $product_quantity = "";
            $product_total_price = "";
            $template_start = "";
            $template_middle = "";
            $template_end = "";
            if (strstr($ordersprint_template, "{product_loop_start}")) {
                $template_sdata = explode('{product_loop_start}', $ordersprint_template);
                $template_start = $template_sdata[0];
                $template_edata = explode('{product_loop_end}', $template_sdata[1]);
                $template_end = $template_edata[1];
                $template_middle = $template_edata[0];
            }
            $cart_tr = '';
            for ($i = 0; $i < count($OrderProducts); $i++) {
                $wrapper_name = "";
                if ($OrderProducts[$i]->wrapper_id) {
                    $wrapper = $producthelper->getWrapper($OrderProducts[$i]->product_id, $OrderProducts[$i]->wrapper_id);
                    if (count($wrapper) > 0) {
                        $wrapper_name = JText::_('COM_REDSHOP_WRAPPER') . ":<br/>" . $wrapper[0]->wrapper_name . "(" . $producthelper->getProductFormattedPrice($OrderProducts[$i]->wrapper_price) . ")";
                    }
                }
                if ($OrderProducts[$i]->is_giftcard == 1) {
                    $product_userfields = $producthelper->getuserfield($OrderProducts[$i]->order_item_id, 13);
                } else {
                    $product_userfields = $producthelper->getuserfield($OrderProducts[$i]->order_item_id);
                }
                $product_name = "<div  class='product_name'>" . $OrderProducts[$i]->order_item_name . "</div>";
                $product = $producthelper->getProductById($OrderProducts[$i]->product_id);
                $product_number = $OrderProducts[$i]->order_item_sku;
                $product_note = "<div  class='product_note'>" . $wrapper_name . "</div>";
                $product_total_price = "<div class='product_total_price'>" . $producthelper->getProductFormattedPrice($OrderProducts[$i]->product_final_price) . "</div>";
                $product_price = "<div class='product_price'>" . $producthelper->getProductFormattedPrice($OrderProducts[$i]->product_item_price) . "</div>";
                $product_quantity = '<div class="product_quantity">' . $OrderProducts[$i]->product_quantity . '</div>';
                $cart_mdata = '';
                $uri = JURI::getInstance();
                $url = $uri->root();
                if ($product->product_full_image) {
                    if (is_file(REDSHOP_FRONT_IMAGES_RELPATH . "product/" . $product->product_full_image)) {
                        $product_image_path = $product->product_full_image;
                    } else {
                        if (is_file(REDSHOP_FRONT_IMAGES_RELPATH . "product/" . PRODUCT_DEFAULT_IMAGE)) {
                            $product_image_path = PRODUCT_DEFAULT_IMAGE;
                        } else {
                            $product_image_path = "";
                        }
                    }
                } else {
                    if (is_file(REDSHOP_FRONT_IMAGES_RELPATH . "product/" . PRODUCT_DEFAULT_IMAGE)) {
                        $product_image_path = PRODUCT_DEFAULT_IMAGE;
                    } else {
                        $product_image_path = "";
                    }
                }
                if ($product_image_path) {
                    $thumbUrl = RedShopHelperImages::getImagePath($product_image_path, '', 'thumb', 'product', CART_THUMB_WIDTH, CART_THUMB_HEIGHT, USE_IMAGE_SIZE_SWAPPING);
                    $product_image = '<div  class="product_image"><img src="' . $thumbUrl . '"></div>';
                } else {
                    $product_image = "<div  class='product_image'></div>";
                }
                $cart_mdata = str_replace("{product_name}", $product_name, $template_middle);
                $cart_mdata = str_replace("{product_thumb_image}", $product_image, $cart_mdata);
                $cart_mdata = str_replace("{product_attribute}", $OrderProducts[$i]->product_attribute, $cart_mdata);
                $cart_mdata = str_replace("{product_accessory}", $OrderProducts[$i]->product_accessory, $cart_mdata);
                $cart_mdata = str_replace("{product_wrapper}", '', $cart_mdata);
                $cart_mdata = str_replace("{product_number}", $product_number, $cart_mdata);
                $cart_mdata = str_replace("{product_number_lbl}", JText::_('COM_REDSHOP_PRODUCT_NUMBER'), $cart_mdata);
                $user_subscribe_detail = $producthelper->getUserProductSubscriptionDetail($OrderProducts[$i]->order_item_id);
                if (count($user_subscribe_detail) > 0 && $user_subscribe_detail->subscription_id) {
                    $subscription_detail = $producthelper->getProductSubscriptionDetail($OrderProducts[$i]->product_id, $user_subscribe_detail->subscription_id);
                    $selected_subscription = $subscription_detail->subscription_period . " " . $subscription_detail->period_type;
                    $cart_mdata = str_replace("{product_subscription_lbl}", JText::_('COM_REDSHOP_SUBSCRIPTION'), $cart_mdata);
                    $cart_mdata = str_replace("{product_subscription}", $selected_subscription, $cart_mdata);
                } else {
                    $cart_mdata = str_replace("{product_subscription_lbl}", "", $cart_mdata);
                    $cart_mdata = str_replace("{product_subscription}", "", $cart_mdata);
                }
                $cart_mdata = str_replace("{product_userfields}", $product_userfields, $cart_mdata);
                $cart_mdata = str_replace("{product_wrapper}", $product_note, $cart_mdata);
                $cart_mdata = str_replace("{product_price}", $product_price, $cart_mdata);
                $cart_mdata = str_replace("{product_quantity}", $product_quantity, $cart_mdata);
                $cart_mdata = str_replace("{product_total_price}", $product_total_price, $cart_mdata);
                $cart_tr .= $cart_mdata;
            }
            $ordersprint_template = $template_start . $cart_tr . $template_end;
            $search[] = "{order_subtotal}";
            $replace[] = $producthelper->getProductFormattedPrice($OrdersDetail[0]->order_subtotal);
            if ($OrdersDetail[0]->order_tax <= 0) {
                $template_vat_sdata = explode('{if vat}', $ordersprint_template);
                $template_vat_start = $template_vat_sdata[0];
                $template_vat_edata = explode('{vat end if}', $template_vat_sdata[1]);
                $template_vat_end = $template_vat_edata[1];
                $template_vat_middle = $template_vat_edata[0];
                $ordersprint_template = $template_vat_start . $template_vat_end;
            } else {
                $search[] = "{if vat}";
                $replace[] = '';
                $search[] = "{order_tax}";
                $replace[] = $producthelper->getProductFormattedPrice($OrdersDetail[0]->order_tax);
                $search[] = "{tax}";
                $replace[] = $producthelper->getProductFormattedPrice($OrdersDetail[0]->order_tax);
                $search[] = "{vat_lbl}";
                $replace[] = JText::_('COM_REDSHOP_ORDER_TAX');
                $search[] = "{vat end if}";
                $replace[] = '';
            }
            if ($OrdersDetail[0]->payment_discount <= 0) {
                if (strstr($ordersprint_template, "{if payment_discount}")) {
                    $template_pd_sdata = explode('{if payment_discount}', $ordersprint_template);
                    $template_pd_start = $template_pd_sdata[0];
                    $template_pd_edata = explode('{payment_discount end if}', $template_pd_sdata[1]);
                    $template_pd_end = $template_pd_edata[1];
                    $template_pd_middle = $template_pd_edata[0];
                    $ordersprint_template = $template_pd_start . $template_pd_end;
                }
            } else {
                $OrdersDetail->order_discount = $OrdersDetail[0]->order_discount - $OrdersDetail[0]->payment_discount;
                $search[] = "{if payment_discount}";
                $replace[] = '';
                $search[] = "{payment_order_discount}";
                $replace[] = $producthelper->getProductFormattedPrice($OrdersDetail[0]->payment_discount);
                $search[] = "{payment_discount_lbl}";
                $replace[] = JText::_('COM_REDSHOP_PAYMENT_DISCOUNT_LBL');
                $search[] = "{payment_discount end if}";
                $replace[] = '';
            }
            if ($OrdersDetail->order_discount <= 0) {
                if (strstr($ordersprint_template, "{if discount}")) {
                    $template_discount_sdata = explode('{if discount}', $ordersprint_template);
                    $template_discount_start = $template_discount_sdata[0];
                    $template_discount_edata = explode('{discount end if}', $template_discount_sdata[1]);
                    $template_discount_end = $template_discount_edata[1];
                    $template_discount_middle = $template_discount_edata[0];
                    $ordersprint_template = $template_discount_start . $template_discount_end;
                }
            } else {
                $search[] = "{if discount}";
                $replace[] = '';
                $search[] = "{order_discount}";
                $replace[] = $producthelper->getProductFormattedPrice($OrdersDetail[0]->order_discount);
                $search[] = "{discount_lbl}";
                $replace[] = JText::_('COM_REDSHOP_ORDER_DISCOUNT');
                $search[] = "{discount end if}";
                $replace[] = '';
            }
            $search[] = "{order_id_lbl}";
            $replace[] = JText::_('COM_REDSHOP_ORDER_ID');
            $search[] = "{order_number_lbl}";
            $replace[] = JText::_('COM_REDSHOP_ORDER_NUMBER');
            $search[] = "{order_date_lbl}";
            $replace[] = JText::_('COM_REDSHOP_ORDER_DATE');
            $search[] = "{order_status_lbl}";
            $replace[] = JText::_('COM_REDSHOP_ORDER_STATUS');
            $search[] = "{shipping_lbl}";
            $replace[] = JText::_('COM_REDSHOP_ORDER_SHIPPING');
            $search[] = "{order_information_lbl}";
            $replace[] = JText::_('COM_REDSHOP_ORDER_INFORMATION');
            $search[] = "{billing_address_information_lbl}";
            $replace[] = JText::_('COM_REDSHOP_BILLING_ADDRESS_INFORMATION');
            $search[] = "{shipping_address_info_lbl}";
            $replace[] = JText::_('COM_REDSHOP_SHIPPING_ADDRESS_INFORMATION');
            $search[] = "{order_detail_lbl}";
            $replace[] = JText::_('COM_REDSHOP_ORDER_DETAILS');
            $search[] = "{product_name_lbl}";
            $replace[] = JText::_('COM_REDSHOP_PRODUCT_NAME');
            $search[] = "{note_lbl}";
            $replace[] = JText::_('COM_REDSHOP_NOTE');
            $search[] = "{price_lbl}";
            $replace[] = JText::_('COM_REDSHOP_PRICE');
            $search[] = "{quantity_lbl}";
            $replace[] = JText::_('COM_REDSHOP_QUANTITY');
            $search[] = "{total_price_lbl}";
            $replace[] = JText::_('COM_REDSHOP_TOTAL_PRICE');
            $search[] = "{order_subtotal_lbl}";
            $replace[] = JText::_('COM_REDSHOP_ORDER_SUBTOTAL');
            $search[] = "{product_number_lbl}";
            $replace[] = JText::_('COM_REDSHOP_PRODUCT_NUMBER');
            $search[] = "{total_lbl}";
            $replace[] = JText::_('COM_REDSHOP_ORDER_TOTAL');
            $search[] = "{order_shipping}";
            $replace[] = $producthelper->getProductFormattedPrice($OrdersDetail[0]->order_shipping);
            $search[] = "{shipping}";
            $replace[] = $producthelper->getProductFormattedPrice($OrdersDetail[0]->order_shipping);
            $search[] = "{order_total}";
            $replace[] = $producthelper->getProductFormattedPrice($OrdersDetail[0]->order_total);
            $message = str_replace($search, $replace, $ordersprint_template);
            $search = "";
            $replace = "";
            $body = $message;
            $pdfObj->AddPage();
            $pdfObj->WriteHTML($body, true, false, true, false, '');
        }
        $invoice_pdfName = "multiprintorder";
        $pdfObj->Output(JPATH_SITE . '/components/com_redshop/assets/document/invoice/' . $invoice_pdfName . ".pdf", "F");
        return $invoice_pdfName;
    }
コード例 #11
0
 public function delete_item()
 {
     $post = JRequest::get('post');
     $option = JRequest::getVar('option', '', 'request', 'string');
     $cid = JRequest::getVar('cid', array(0), 'post', 'array');
     $model = $this->getModel('order_detail');
     $order_functions = new order_functions();
     $orderItem = $order_functions->getOrderItemDetail($cid[0]);
     if (count($orderItem) == 1 && $orderItem[0]->order_item_id == $post['order_item_id']) {
         $model->delete($cid);
         $msg = JText::_('COM_REDSHOP_ORDER_DELETED_SUCCESSFULLY');
         $this->setRedirect('index.php?option=' . $option . '&view=order', $msg);
         return;
     }
     if ($model->delete_item($post)) {
         $msg = JText::_('COM_REDSHOP_ORDER_ITEM_DELETED');
     } else {
         $msg = JText::_('COM_REDSHOP_ERROR_DELETING_ORDER_ITEM');
     }
     $this->setRedirect('index.php?option=' . $option . '&view=order_detail&cid[]=' . $cid[0], $msg);
 }
コード例 #12
0
.value  ; "
						       name="order_status" value="<?php 
    echo JText::_('COM_REDSHOP_UPDATE_STATUS_BUTTON');
    ?>
"
						       type="button">
					</td>
				</tr>
			</table>
		</td>
		<?php 
    if (USE_STOCKROOM == 1) {
        ?>
			<td align="center">
				<?php 
        $order_items = $order_function->getOrderItemDetail($row->order_id);
        $stockroom_id = "";
        for ($st = 0; $st < count($order_items); $st++) {
            if ($order_items[$st]->stockroom_id != "") {
                $stockroom_id .= $order_items[$st]->stockroom_id . ",";
            }
        }
        if ($stockroom_id != "") {
            $stockroom_list = $stockroomhelper->getStockroom(substr_replace($stockroom_id, "", -1));
            for ($s = 0; $s < count($stockroom_list); $s++) {
                echo $stockroom_list[$s]->stockroom_name;
                echo "<br>";
                echo $delivery_time = $stockroom_list[$s]->min_del_time . "-" . $stockroom_list[$s]->max_del_time . " " . $stockroom_list[$s]->delivery_time;
                echo "<br>";
            }
        }