require_once JPATH_COMPONENT . '/helpers/google_analytics.php'; $googleanalytics = new googleanalytics(); $analytics_status = $order->analytics_status; if ($analytics_status == 0 && GOOGLE_ANA_TRACKER_KEY != "") { $orderTrans = array(); $orderTrans['order_id'] = $order->order_id; $orderTrans['shopname'] = SHOP_NAME; $orderTrans['order_total'] = $order->order_total; $orderTrans['order_tax'] = $order->order_tax; $orderTrans['order_shipping'] = $order->order_shipping; $orderTrans['city'] = $billingaddresses->city; if (isset($billingaddresses->country_code)) { $orderTrans['state'] = $order_functions->getStateName($billingaddresses->state_code, $billingaddresses->country_code); } if (isset($billingaddresses->country_code)) { $orderTrans['country'] = $order_functions->getCountryName($billingaddresses->country_code); } // Collect data for google analytics // Initiallize variable $analyticsData = array(); // Collect data to add transaction = order $analyticsData['addtrans'] = $orderTrans; // Start array to collect data to addItems $analyticsData['addItem'] = array(); for ($k = 0; $k < count($orderitem); $k++) { $orderaddItem = array(); $orderaddItem['order_id'] = $orderitem[$k]->order_id; $orderaddItem['product_number'] = $orderitem[$k]->order_item_sku; $orderaddItem['product_name'] = $orderitem[$k]->order_item_name; $orderaddItem['product_category'] = $model->getCategoryNameByProductId($orderitem[$k]->product_id); $orderaddItem['product_price'] = $orderitem[$k]->product_item_price;
$customer_state = ''; if (trim($this->userdata->state_code) != "-" && trim($this->userdata->state_code) != "") { $customer_state_lbl = JText::_('COM_REDSHOP_CUSTOMER_STATE'); $customer_state = $order_functions->getStateName($this->userdata->state_code, $this->userdata->country_code); if (trim($customer_state == '')) { $customer_state_lbl = ''; $customer_state = ''; } } $template_desc = str_replace('{state_lbl}', $customer_state_lbl, $template_desc); $template_desc = str_replace('{state}', $customer_state, $template_desc); $customer_country_lbl = ''; $customer_country = ''; if ($this->userdata->country_code) { $customer_country_lbl = JText::_('COM_REDSHOP_CUSTOMER_COUNTRY'); $customer_country = $order_functions->getCountryName($this->userdata->country_code, $this->userdata->country_code); if (trim($customer_country == '')) { $customer_country_lbl = ''; $customer_country = ''; } } $template_desc = str_replace('{country_lbl}', $customer_country_lbl, $template_desc); $template_desc = str_replace('{country}', $customer_country, $template_desc); $customer_vatnumber_lbl = ''; $customer_vatnumber = ''; if ($this->userdata->is_company == 1 && $this->userdata->vat_number != "") { $customer_vatnumber_lbl = JText::_('COM_REDSHOP_CUSTOMER_VATNUMBER'); $customer_vatnumber = $this->userdata->vat_number; } $ean_number_lbl = ''; $ean_number = '';
<td><?php echo $billingaddresses->city; ?> </td> </tr> <?php } if (trim($billingaddresses->country_code) != "" && trim($billingaddresses->country_code)) { ?> <tr> <td width="100" align="left"><label for="contact_info"><?php echo JText::_('COM_REDSHOP_COUNTRY'); ?> :</label></td> <td><?php echo JText::_($order_functions->getCountryName($billingaddresses->country_code)); ?> </td> </tr> <?php } $state = $order_functions->getStateName($billingaddresses->state_code, $billingaddresses->country_code); if ($state != "") { ?> <tr> <td width="100" align="left"><label for="address"><?php echo JText::_('COM_REDSHOP_STATE'); ?> :</label></td> <td><?php echo $state;
echo JText::_('COM_REDSHOP_CITY'); ?> :</td> <td><?php echo $billing->city; ?> </td> </tr> <tr> <td width="100" align="right"><?php echo JText::_('COM_REDSHOP_COUNTRY'); ?> :</td> <td><?php echo $billing->country_code ? JTEXT::_($order_functions->getCountryName($billing->country_code)) : ''; ?> </td> </tr> <tr> <td width="100" align="right"><?php echo JText::_('COM_REDSHOP_STATE'); ?> :</td> <td><?php echo $billing->state_code ? $order_functions->getStateName($billing->state_code, $billing->country_code) : ''; ?> </td> </tr> <tr> <td width="100" align="right"><?php
function display($tpl = null) { $config = new Redconfiguration(); $redTemplate = new Redtemplate(); $order_functions = new order_functions(); $model = $this->getModel(); $detail = $this->get('data'); $billing = $order_functions->getBillingAddress($detail->user_id); $shipping = $order_functions->getOrderShippingUserInfo($detail->order_id); if (!$shipping) { $shipping = $billing; } $template = $redTemplate->getTemplate("shipping_pdf"); $html_template = $template[0]->template_desc; ob_start(); $order_status = $order_functions->getOrderStatusTitle($detail->order_status); $html_template = str_replace("{order_information_lbl}", JText::_('COM_REDSHOP_ORDER_INFORMATION'), $html_template); $html_template = str_replace("{order_id_lbl}", JText::_('COM_REDSHOP_ORDER_ID'), $html_template); $html_template = str_replace("{order_number_lbl}", JText::_('COM_REDSHOP_ORDER_NUMBER'), $html_template); $html_template = str_replace("{order_date_lbl}", JText::_('COM_REDSHOP_ORDER_DATE'), $html_template); $html_template = str_replace("{order_status_lbl}", JText::_('COM_REDSHOP_ORDER_STATUS'), $html_template); $html_template = str_replace("{shipping_address_info_lbl}", JText::_('COM_REDSHOP_SHIPPING_ADDRESS_INFORMATION'), $html_template); $html_template = str_replace("{shipping_firstname_lbl}", JText::_('COM_REDSHOP_FIRSTNAME'), $html_template); $html_template = str_replace("{shipping_lastname_lbl}", JText::_('COM_REDSHOP_LASTNAME'), $html_template); $html_template = str_replace("{shipping_address_lbl}", JText::_('COM_REDSHOP_ADDRESS'), $html_template); $html_template = str_replace("{shipping_zip_lbl}", JText::_('COM_REDSHOP_ZIP'), $html_template); $html_template = str_replace("{shipping_city_lbl}", JText::_('COM_REDSHOP_CITY'), $html_template); $html_template = str_replace("{shipping_country_lbl}", JText::_('COM_REDSHOP_COUNTRY'), $html_template); $html_template = str_replace("{shipping_state_lbl}", JText::_('COM_REDSHOP_STATE'), $html_template); $html_template = str_replace("{shipping_phone_lbl}", JText::_('COM_REDSHOP_PHONE'), $html_template); $html_template = str_replace("{order_id}", $detail->order_id, $html_template); $html_template = str_replace("{order_number}", $detail->order_number, $html_template); $html_template = str_replace("{order_date}", $config->convertDateFormat($detail->cdate), $html_template); $html_template = str_replace("{order_status}", $order_status, $html_template); $html_template = str_replace("{shipping_firstname}", $shipping->firstname, $html_template); $html_template = str_replace("{shipping_lastname}", $shipping->lastname, $html_template); $html_template = str_replace("{shipping_address}", $shipping->address, $html_template); $html_template = str_replace("{shipping_zip}", $shipping->zipcode, $html_template); $html_template = str_replace("{shipping_city}", $shipping->city, $html_template); $html_template = str_replace("{shipping_country}", JTEXT::_($order_functions->getCountryName($shipping->country_code)), $html_template); $html_template = str_replace("{shipping_state}", $order_functions->getStateName($shipping->state_code, $shipping->country_code), $html_template); $html_template = str_replace("{shipping_phone}", $shipping->zipcode, $html_template); // if user is company than if ($billing->is_company && $billing->company_name != "") { $html_template = str_replace("{company_name}", $billing->company_name, $html_template); $html_template = str_replace("{company_name_lbl}", JText::_('COM_REDSHOP_COMPANY_NAME'), $html_template); } else { $html_template = str_replace("{company_name}", "", $html_template); $html_template = str_replace("{company_name_lbl}", "", $html_template); } $pdfObj = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, 'A5', true, 'UTF-8', false); $pdfObj->SetTitle("Order :" . $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, "", 12); //$pdfObj->AliasNbPages(); $pdfObj->AddPage(); $pdfObj->WriteHTML($html_template); $pdfObj->Output("Order_" . $detail->order_id . ".pdf", "D"); exit; }
if ($quotationDetail->firstname != "") { $billadd .= JText::_("COM_REDSHOP_FIRSTNAME") . ' : ' . $quotationDetail->firstname . '<br>'; } if ($quotationDetail->lastname != "") { $billadd .= JText::_("COM_REDSHOP_LASTNAME") . ' : ' . $quotationDetail->lastname . '<br>'; } if ($quotationDetail->address != "") { $billadd .= JText::_("COM_REDSHOP_ADDRESS") . ' : ' . $quotationDetail->address . '<br>'; } if ($quotationDetail->zipcode != "") { $billadd .= JText::_("COM_REDSHOP_ZIP") . ' : ' . $quotationDetail->zipcode . '<br>'; } if ($quotationDetail->city != "") { $billadd .= JText::_("COM_REDSHOP_CITY") . ' : ' . $quotationDetail->city . '<br>'; } if ($order_functions->getCountryName($quotationDetail->country_code) != "") { $billadd .= JText::_("COM_REDSHOP_COUNTRY") . ' : ' . JText::_($order_functions->getCountryName($quotationDetail->country_code)) . '<br>'; } if ($order_functions->getStateName($quotationDetail->state_code, $quotationDetail->country_code) != "") { $billadd .= JText::_("COM_REDSHOP_STATE") . ' : ' . $order_functions->getStateName($quotationDetail->state_code, $quotationDetail->country_code) . '<br>'; } if ($quotationDetail->phone != "") { $billadd .= JText::_("COM_REDSHOP_PHONE") . ' : ' . $quotationDetail->phone . '<br>'; } if ($quotationDetail->user_email != "") { $billadd .= JText::_("COM_REDSHOP_EMAIL") . ' : ' . $quotationDetail->user_email . '<br>'; } if ($quotationDetail->is_company == 1) { if ($quotationDetail->vat_number != "") { $billadd .= JText::_("COM_REDSHOP_VAT_NUMBER") . ' : ' . $quotationDetail->vat_number . '<br>'; }
<td><?php echo JText::_('COM_REDSHOP_CITY'); ?> :</td> <td><?php echo $this->quotationuser->city; ?> </td> </tr> <tr> <td><?php echo JText::_('COM_REDSHOP_COUNTRY'); ?> :</td> <td><?php echo JText::_($order_functions->getCountryName($this->quotationuser->country_code)); ?> </td> </tr> <tr> <td><?php echo JText::_('COM_REDSHOP_STATE'); ?> :</td> <td><?php echo $order_functions->getStateName($this->quotationuser->state_code, $this->quotationuser->country_code); ?> </td> </tr> <tr> <td><?php
JHTML::_('behavior.tooltip'); require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/order.php'; $order_functions = new order_functions(); $url = JURI::base(); $redconfig = new Redconfiguration(); $Itemid = JRequest::getInt('Itemid'); $return = JRequest::getString('return'); $jinput = JFactory::getApplication()->input; $post = $jinput->getArray($_POST); $detail = $this->detail; $firstname = $detail->firstname; $lastname = $detail->lastname; $address = $detail->address; $zipcode = $detail->zipcode; $city = $detail->city; $country = JText::_($order_functions->getCountryName($detail->country_code)); $state = $order_functions->getStateName($detail->state_code, $detail->country_code); $phone = $detail->phone; $user_email = $detail->user_email; $field = new extra_field(); if (DEFAULT_CUSTOMER_REGISTER_TYPE == 1 || !DEFAULT_CUSTOMER_REGISTER_TYPE) { $regtype = 0; } else { $regtype = 1; } $link = 'index.php?option=com_redshop&view=cart&Itemid=' . $Itemid; ?> <script> function validateInfo() { var frm = document.adminForm;