public function SetPanelSettings() { // Are we using a text or image-based logo? $loadLogo = true; if($GLOBALS['ISC_CLASS_TEMPLATE']->getIsMobileDevice()) { if(getConfig('mobileTemplateLogo')) { $GLOBALS['ISC_CLASS_TEMPLATE']->assign('StoreLogo', getConfig('mobileTemplateLogo')); $GLOBALS['ISC_CLASS_TEMPLATE']->assign('HeaderLogo', $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('LogoImage')); $loadLogo = false; } } if($loadLogo) { $GLOBALS['HeaderLogo'] = FetchHeaderLogo(); } }
function SetPanelSettings() { // Are we using a text or image-based logo? $GLOBALS['HeaderLogo'] = FetchHeaderLogo(); }
/** * Print an invoice for the selected order using the invoice_print template */ public function PrintInvoice() { $numProds = 0; $numDL = 0; $numPhy = 0; if (isset($_GET['order_id']) && is_numeric($_GET['order_id'])) { $GLOBALS['HeaderLogo'] = FetchHeaderLogo(); $order_id = (int) $_GET['order_id']; $GLOBALS['StoreAddressFormatted'] = nl2br(GetConfig('StoreAddress')); $query = "SELECT o.*, CONCAT(c.custconfirstname, ' ', c.custconlastname) AS ordcustname, c.custconemail AS ordcustemail, c.custconphone AS ordcustphone\n\t\t\t\t\t\t FROM [|PREFIX|]orders o\n\t\t\t\t\t\t JOIN [|PREFIX|]customers c ON o.ordcustid = c.customerid\n\t\t\t\t\t\t WHERE o.orderid = '" . $GLOBALS['ISC_CLASS_DB']->Quote($order_id) . "' AND o.ordcustid='" . $GLOBALS['ISC_CLASS_DB']->Quote($GLOBALS['ISC_CLASS_CUSTOMER']->GetCustomerId()) . "'"; $result = $GLOBALS['ISC_CLASS_DB']->Query($query); if ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) { $GLOBALS['InvoiceTitle'] = sprintf(GetLang('InvoiceTitle'), $order_id); $GLOBALS['ItemCost'] = CurrencyConvertFormatPrice($row['ordsubtotal'], $row['ordcurrencyid'], $row['ordcurrencyexchangerate']); $GLOBALS['ShippingCost'] = CurrencyConvertFormatPrice($row['ordshipcost'], $row['ordcurrencyid'], $row['ordcurrencyexchangerate']); // Is there a handling fee? if ($row['ordhandlingcost'] > 0) { $GLOBALS['HandlingCost'] = CurrencyConvertFormatPrice($row['ordhandlingcost'], $row['ordcurrencyid'], $row['ordcurrencyexchangerate']); } else { $GLOBALS['HideHandlingCost'] = "none"; } // Is there any sales tax? if ($row['ordtaxtotal'] > 0) { if ($row['ordtaxname']) { $GLOBALS['SalesTaxName'] = isc_html_escape($row['ordtaxname']); } else { $GLOBALS['SalesTaxName'] = GetLang('InvoiceSalesTax'); } if ($row['ordtotalincludestax']) { $GLOBALS['HideSalesTax'] = 'none'; $GLOBALS['SalesTaxName'] .= ' ' . GetLang('IncludedInTotal'); } else { $GLOBALS['HideSalesTaxIncluded'] = 'none'; } $GLOBALS['SalesTax'] = CurrencyConvertFormatPrice($row['ordtaxtotal'], $row['ordcurrencyid'], $row['ordcurrencyexchangerate']); } else { $GLOBALS['HideSalesTax'] = "none"; $GLOBALS['HideSalesTaxIncluded'] = 'none'; } $GLOBALS['TotalCost'] = CurrencyConvertFormatPrice($row['ordtotalamount'], $row['ordcurrencyid'], $row['ordcurrencyexchangerate']); // Format the customer details $GLOBALS['CustomerName'] = isc_html_escape($row['ordcustname']); $GLOBALS['CustomerEmail'] = ''; $GLOBALS['CustomerPhone'] = ''; if ($row['ordcustemail'] != '') { $GLOBALS['CustomerEmail'] = '<span style="width: 55px; float:left;">' . GetLang('OrderInvoiceEmail') . ':</span> ' . isc_html_escape($row['ordcustemail']); } if ($row['ordcustphone'] != '') { $GLOBALS['CustomerPhone'] = '<span style="width: 55px; float:left;">' . GetLang('OrderInvoicePhone') . ':</span> ' . isc_html_escape($row['ordcustphone']); } $GLOBALS['CustomerDetails'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("InvoiceCustomerDetails"); // Format the billing address $GLOBALS['ShipFullName'] = isc_html_escape($row['ordbillfirstname'] . ' ' . $row['ordbilllastname']); $GLOBALS['ShipCompany'] = ''; if ($row['ordbillcompany']) { $GLOBALS['ShipCompany'] = '<br />' . isc_html_escape($row['ordbillcompany']); } $GLOBALS['ShipAddressLine1'] = isc_html_escape($row['ordbillstreet1']); if ($row['ordbillstreet2'] != "") { $GLOBALS['ShipAddressLine2'] = isc_html_escape($row['ordbillstreet2']); } else { $GLOBALS['ShipAddressLine2'] = ''; } $GLOBALS['ShipSuburb'] = isc_html_escape($row['ordbillsuburb']); $GLOBALS['ShipState'] = isc_html_escape($row['ordbillstate']); $GLOBALS['ShipZip'] = isc_html_escape($row['ordbillzip']); $GLOBALS['ShipCountry'] = isc_html_escape($row['ordbillcountry']); $GLOBALS['ShipPhone'] = ""; $GLOBALS['BillingAddress'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("AddressLabel"); // Is there a shipping address, or is it a digital download? if ($row['ordshipfirstname'] == "") { $GLOBALS['ShippingAddress'] = GetLang('NA'); } else { $GLOBALS['ShipFullName'] = isc_html_escape($row['ordshipfirstname'] . ' ' . $row['ordshiplastname']); $GLOBALS['ShipCompany'] = ''; if ($row['ordshipcompany']) { $GLOBALS['ShipCompany'] = '<br />' . isc_html_escape($row['ordshipcompany']); } $GLOBALS['ShipAddressLine1'] = isc_html_escape($row['ordshipstreet1']); if ($row['ordshipstreet2'] != "") { $GLOBALS['ShipAddressLine2'] = isc_html_escape($row['ordshipstreet2']); } else { $GLOBALS['ShipAddressLine2'] = ''; } $GLOBALS['ShipSuburb'] = isc_html_escape($row['ordshipsuburb']); $GLOBALS['ShipState'] = isc_html_escape($row['ordshipstate']); $GLOBALS['ShipZip'] = isc_html_escape($row['ordshipzip']); $GLOBALS['ShipCountry'] = isc_html_escape($row['ordshipcountry']); $GLOBALS['ShipPhone'] = ""; $GLOBALS['ShippingAddress'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("AddressLabel"); } // Get the products in the order $query = sprintf("select * from [|PREFIX|]order_products where orderorderid='%s'", $GLOBALS['ISC_CLASS_DB']->Quote($order_id)); $pResult = $GLOBALS['ISC_CLASS_DB']->Query($query); $GLOBALS['ProductsTable'] = ""; $wrappingTotal = 0; while ($pRow = $GLOBALS['ISC_CLASS_DB']->Fetch($pResult)) { $numProds++; if ($pRow['ordprodtype'] == 2) { $numDL++; } else { $numPhy++; if ($pRow['ordprodsku'] != "") { $sku = $pRow['ordprodsku']; } else { $sku = GetLang('NA'); } $pOptions = ''; if ($pRow['ordprodoptions'] != '') { $options = @unserialize($pRow['ordprodoptions']); if (!empty($options)) { $pOptions = "<br /><small>("; $comma = ''; foreach ($options as $name => $value) { $pOptions .= $comma . isc_html_escape($name) . ": " . isc_html_escape($value); $comma = ', '; } $pOptions .= ")</small>"; } } $prodCost = CurrencyConvertFormatPrice($pRow['ordprodcost'], $row['ordcurrencyid'], $row['ordcurrencyexchangerate']); if ($pRow['ordprodwrapcost'] > 0) { $wrappingTotal += $pRow['ordprodwrapcost'] * $pRow['ordprodqty']; } $giftOptions = ''; if ($pRow['ordprodwrapname']) { $giftOptions .= "<br /><small>" . GetLang('GiftWrapping') . ": " . isc_html_escape($pRow['ordprodwrapname']) . "</small>"; } $GLOBALS['ProductsTable'] .= sprintf("\n\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>%s</td>\n\t\t\t\t\t\t\t\t\t<td>%s</td>\n\t\t\t\t\t\t\t\t\t<td>%s</td>\n\t\t\t\t\t\t\t\t\t<td>%s</td>\n\t\t\t\t\t\t\t\t</tr>\n\n\t\t\t\t\t\t\t", $pRow['ordprodqty'], $sku, isc_html_escape($pRow['ordprodname']) . $pOptions . $giftOptions, $prodCost); } } if ($wrappingTotal > 0) { $GLOBALS['GiftWrappingTotal'] = CurrencyConvertFormatPrice($wrappingTotal, $row['ordcurrencyid'], $row['ordcurrencyexchangerate']); } else { $GLOBALS['HideGiftwrappingTotal'] = 'display: none'; } if ($numDL == $numProds) { $GLOBALS['CloseWindow'] = "1"; } $GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("invoice_print"); $GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate(); } else { echo "<script type=\"text/javascript\">window.close();</script>"; } } else { echo "<script type=\"text/javascript\">window.close();</script>"; } }