public function ShowPaymentForm() { // Was there an error validating the payment? If so, pre-fill the form fields with the already-submitted values if($this->HasErrors()) { $fields = array( "CreditCardNum" => 'creditcard_ccno' ); foreach($fields as $global => $post) { if(isset($_POST[$post])) { $GLOBALS[$global] = isc_html_escape($_POST[$post]); } } $errorMessage = implode("<br />", $this->GetErrors()); $GLOBALS['CreditCardErrorMessage'] = $errorMessage; } else { // Hide the error message box $GLOBALS['HideCreditCardError'] = "none"; } $pendingOrder = LoadPendingOrderByToken(); $GLOBALS['OrderAmount'] = CurrencyConvertFormatPrice($pendingOrder['total_inc_tax'], $pendingOrder['ordcurrencyid'], $pendingOrder['ordcurrencyexchangerate']); // Collect their details to send through to CreditCard $GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("valuteccard"); return $GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate(true); }
function SetPanelSettings() { $output = ""; $GLOBALS['ISC_CategoryBrandCache'] = GetClass('ISC_CACHECATEGORYBRANDS'); $cachedCategoryBrands = $GLOBALS['ISC_CategoryBrandCache']->getCategoryBrandsData(); $mybrands = $GLOBALS['ISC_CategoryBrandCache']->GetBrands($cachedCategoryBrands); /*// Get the number of brands $query = "select count(brandid) as num from [|PREFIX|]brands"; $result = $GLOBALS['ISC_CLASS_DB']->Query($query); $row = $GLOBALS['ISC_CLASS_DB']->Fetch($result);*/ $num_brands = count($mybrands); if ($num_brands > 0) { // Get the 5 most popular brands /*$query = "select b.brandid, b.brandname, (select count(productid) from [|PREFIX|]products p where p.prodbrandid=b.brandid and p.prodvisible='1') as num from [|PREFIX|]brands b order by b.brandname asc"; $result = $GLOBALS['ISC_CLASS_DB']->Query($query); */ foreach ($mybrands as $brand) { $GLOBALS['BrandLink'] = BrandLink($brand['brandname']); $GLOBALS['BrandName'] = isc_html_escape($brand['brandname']); $output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ShopByBrandItem"); } if ($num_brands > 5) { $GLOBALS['SNIPPETS']['ShopByBrandAllItem'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ShopByBrandAllItem"); } $output = $GLOBALS['ISC_CLASS_TEMPLATE']->ParseSnippets($output, $GLOBALS['SNIPPETS']); $GLOBALS['SNIPPETS']['SideShopByBrandFullList'] = $output; } else { // Hide the panel $this->DontDisplay = true; $GLOBALS['HideSideShopByBrandFullPanel'] = "none"; } }
public function SetPanelSettings() { $GLOBALS['SNIPPETS']['ShippingAddressList'] = ""; $GLOBALS['ShippingAddressRow'] = ""; $count = 0; $GLOBALS['ISC_CLASS_CUSTOMER'] = GetClass('ISC_CUSTOMER'); // Get a list of all shipping addresses for this customer and out them as radio buttons $shipping_addresses = $GLOBALS['ISC_CLASS_CUSTOMER']->GetCustomerShippingAddresses(); foreach ($shipping_addresses as $address) { $GLOBALS['ShippingAddressId'] = (int) $address['shipid']; $GLOBALS['ShipFullName'] = isc_html_escape($address['shipfirstname'] . ' ' . $address['shiplastname']); $GLOBALS['ShipCompany'] = ''; if ($address['shipcompany']) { $GLOBALS['ShipCompany'] = isc_html_escape($address['shipcompany']) . '<br />'; } $GLOBALS['ShipAddressLine1'] = isc_html_escape($address['shipaddress1']); if ($address['shipaddress2'] != "") { $GLOBALS['ShipAddressLine2'] = isc_html_escape($address['shipaddress2']); } else { $GLOBALS['ShipAddressLine2'] = ''; } $GLOBALS['ShipSuburb'] = isc_html_escape($address['shipcity']); $GLOBALS['ShipState'] = isc_html_escape($address['shipstate']); $GLOBALS['ShipZip'] = isc_html_escape($address['shipzip']); $GLOBALS['ShipCountry'] = isc_html_escape($address['shipcountry']); if ($address['shipphone'] != "") { $GLOBALS['ShipPhone'] = isc_html_escape(sprintf("%s: %s", GetLang('Phone'), $address['shipphone'])); } else { $GLOBALS['ShipPhone'] = ""; } $GLOBALS['SNIPPETS']['ShippingAddressList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("CheckoutShippingAddressItemOffer"); } }
public function SetPanelSettings() { if (!gzte11(ISC_HUGEPRINT)) { $this->DontDisplay = true; return false; } $output = ""; // Get the link to the 'all vendors' page $GLOBALS['AllVendorsLink'] = VendorLink(); // Get the 10 most popular vendors $query = "\n\t\t\tSELECT vendorid, vendorname, vendorfriendlyname\n\t\t\tFROM [|PREFIX|]vendors\n\t\t\tORDER BY vendornumsales DESC, vendorname ASC\n\t\t"; $query .= $GLOBALS['ISC_CLASS_DB']->AddLimit(0, 11); // Fetch 10 + 1 - so that way we can determine if we need the all vendors link $result = $GLOBALS['ISC_CLASS_DB']->Query($query); $x = 1; while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) { if ($x <= 10) { $GLOBALS['VendorLink'] = VendorLink($row); $GLOBALS['VendorName'] = isc_html_escape($row['vendorname']); $output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("PopularVendorsItem"); } ++$x; } if ($x == 11) { $GLOBALS['SNIPPETS']['ShopByVendorAllItem'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("PopularVendorsAllItem"); } if (!$output) { $this->DontDisplay = true; } $GLOBALS['SNIPPETS']['PopularVendorsList'] = $output; }
public function SetPanelSettings() { $output = ""; // If product ratings aren't enabled then we don't even need to load anything here if(!getProductReviewsEnabled()) { $this->DontDisplay = true; return; } $categorySql = $GLOBALS['ISC_CLASS_CATEGORY']->GetCategoryAssociationSQL(false); $query = $this->getProductQuery('prodratingtotal > 0 AND '.$categorySql, 'p.prodratingtotal DESC', 5); $result = $GLOBALS['ISC_CLASS_DB']->Query($query); if($GLOBALS['ISC_CLASS_DB']->CountResult($result) > 0) { $GLOBALS['AlternateClass'] = ''; while($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) { $this->setProductGlobals($row); $output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideCategoryPopularProducts"); } // Showing the syndication option? if(GetConfig('RSSPopularProducts') != 0 && GetConfig('RSSCategories') != 0 && GetConfig('RSSSyndicationIcons') != 0) { $GLOBALS['ISC_LANG']['CategoryPopularProductsFeed'] = sprintf(GetLang('CategoryPopularProductsFeed'), isc_html_escape($GLOBALS['CatName'])); $GLOBALS['SNIPPETS']['SideCategoryPopularProductsFeed'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideCategoryPopularProductsFeed"); } } else { $GLOBALS['HideSideCategoryPopularProductsPanel'] = "none"; $this->DontDisplay = true; } $GLOBALS['SNIPPETS']['SideCategoryPopularProducts'] = $output; }
/** * Set the settings for this panel. */ public function SetPanelSettings() { // How many tags do we have? $query = "\n\t\t\tSELECT COUNT(tagid) AS tagcount\n\t\t\tFROM [|PREFIX|]product_tags\n\t\t"; $tagCount = $GLOBALS['ISC_CLASS_DB']->FetchOne($query); // How many products does the most popular tag contain? $query = "\n\t\t\tSELECT MAX(tagcount) AS popularcount, MIN(tagcount) AS leastcount\n\t\t\tFROM [|PREFIX|]product_tags\n\t\t"; $result = $GLOBALS['ISC_CLASS_DB']->Query($query); $tagCounts = $GLOBALS['ISC_CLASS_DB']->Fetch($result); // Get a list of all of the tags $query = "\n\t\t\tSELECT *\n\t\t\tFROM [|PREFIX|]product_tags\n\t\t\tORDER BY tagname ASC\n\t\t"; $min = GetConfig('TagCloudMinSize'); $max = GetConfig('TagCloudMaxSize'); $GLOBALS['SNIPPETS']['TagList'] = ''; $result = $GLOBALS['ISC_CLASS_DB']->Query($query); while ($tag = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) { $weight = ceil($tag['tagcount'] / $tagCount * 100); if ($max > $min) { $fontSize = $weight / 100 * ($max - $min) + $min; } else { $fontSize = (100 - $weight) / 100 * ($max - $min) + $max; } $fontSize = (int) $fontSize; $GLOBALS['FontSize'] = $fontSize . '%'; $GLOBALS['TagName'] = isc_html_escape($tag['tagname']); $GLOBALS['TagLink'] = TagLink($tag['tagfriendlyname'], $tag['tagid']); $GLOBALS['TagProductCount'] = sprintf(GetLang('XProductsTaggedWith'), $tag['tagcount'], isc_html_escape($tag['tagname'])); $GLOBALS['SNIPPETS']['TagList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('ProductTagCloudItem'); } }
function SetPanelSettings() { $GLOBALS['ProductId'] = $GLOBALS['ISC_CLASS_PRODUCT']->GetProductId(); //temp script to shortern the product name $pid = $GLOBALS['ISC_CLASS_PRODUCT']->GetProductId(); $querytemp = "SELECT prodbrandid FROM [|PREFIX|]products where productid = " . $pid . " "; $resulttemp = $GLOBALS['ISC_CLASS_DB']->Query($querytemp); $brand = $GLOBALS['ISC_CLASS_DB']->Fetch($resulttemp); if ($brand['prodbrandid'] == 37) { $query = "SELECT c.catname, c.catcombine FROM [|PREFIX|]categories \tc left join [|PREFIX|]categoryassociations ca on c.categoryid = ca.categoryid left join [|PREFIX|]products p on ca.productid = p.productid where p.productid = '" . $GLOBALS['ISC_CLASS_PRODUCT']->GetProductId() . "' "; $result = $GLOBALS['ISC_CLASS_DB']->Query($query); $cat = $GLOBALS['ISC_CLASS_DB']->Fetch($result); if ($cat['catcombine'] != "") { $GLOBALS['ProductName'] = $cat['catcombine'] . " Part Number " . isc_html_escape($GLOBALS['ISC_CLASS_PRODUCT']->GetSKU()); } else { $GLOBALS['ProductName'] = $cat['catname'] . " Part Number " . isc_html_escape($GLOBALS['ISC_CLASS_PRODUCT']->GetSKU()); } } else { $GLOBALS['ProductName'] = isc_html_escape($GLOBALS['ISC_CLASS_PRODUCT']->GetProductName()); } //temp script to shortern the product name //$GLOBALS['ProductName'] = $GLOBALS['ISC_CLASS_PRODUCT']->GetProductName(); $wishLists = $this->LoadCustomerWishLists(); $GLOBALS['WishLists'] = ''; $i = 0; foreach ($wishLists as $wishlist) { if ($i == 0) { $checked = 'checked'; } else { $checked = ''; } $GLOBALS['WishLists'] .= '<input type="radio" name="wishlistid" id="wishlistid' . (int) $wishlist['wishlistid'] . '" value="' . (int) $wishlist['wishlistid'] . '" ' . $checked . ' /> <label for="wishlistid' . (int) $wishlist['wishlistid'] . '">' . isc_html_escape($wishlist['wishlistname']) . '</label><br />'; ++$i; } }
function SetPanelSettings() { $count = 0; $output = ""; $GLOBALS['SNIPPETS']['WishListItems'] = ""; $GLOBALS['HideCompareItems'] = "none"; if (GetConfig('EnableProductReviews') == 0) { $GLOBALS['HideProductRating'] = "display: none"; } if (!isset($GLOBALS['WishListItems'])) { return false; } $GLOBALS['AlternateClass'] = ''; foreach ($GLOBALS['WishListItems'] as $row) { if ($GLOBALS['AlternateClass'] == 'Odd') { $GLOBALS['AlternateClass'] = 'Even'; } else { $GLOBALS['AlternateClass'] = 'Odd'; } $GLOBALS['ProductCartQuantity'] = ''; if (isset($GLOBALS['CartQuantity' . $row['productid']])) { $GLOBALS['ProductCartQuantity'] = (int) $GLOBALS['CartQuantity' . $row['productid']]; } $GLOBALS['ItemId'] = (int) $row['wishlistitemid']; $GLOBALS['ProductId'] = (int) $row['productid']; $GLOBALS['ProductName'] = isc_html_escape($row['prodname']); $GLOBALS['ProductLink'] = ProdLink($row['prodname']); $GLOBALS['ProductRating'] = (int) $row['prodavgrating']; // Determine the price of this product $GLOBALS['ProductPrice'] = CalculateProductPrice($row); $GLOBALS['ProductThumb'] = ImageThumb($row['imagefile'], ProdLink($row['prodname'])); $GLOBALS['SNIPPETS']['WishListItems'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("WishListItem"); } }
public function SetPanelSettings() { $output = ""; // Get the number of brands $query = "select count(brandid) as num from [|PREFIX|]brands"; $result = $GLOBALS['ISC_CLASS_DB']->Query($query); $row = $GLOBALS['ISC_CLASS_DB']->Fetch($result); $num_brands = $row['num']; if($num_brands > 0) { // Get the 5 most popular brands $query = "select b.brandid, b.brandname, (select count(productid) from [|PREFIX|]products p where p.prodbrandid=b.brandid and p.prodvisible='1') as num from [|PREFIX|]brands b order by b.brandname asc"; $result = $GLOBALS['ISC_CLASS_DB']->Query($query); while($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) { $GLOBALS['BrandLink'] = BrandLink($row['brandname']); $GLOBALS['BrandName'] = isc_html_escape($row['brandname']); $output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ShopByBrandItem"); } if($num_brands > 5) { $GLOBALS['SNIPPETS']['ShopByBrandAllItem'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ShopByBrandAllItem"); } $output = $GLOBALS['ISC_CLASS_TEMPLATE']->ParseSnippets($output, $GLOBALS['SNIPPETS']); $GLOBALS['SNIPPETS']['SideShopByBrandFullList'] = $output; } else { // Hide the panel $this->DontDisplay = true; $GLOBALS['HideSideShopByBrandFullPanel'] = "none"; } }
public function SetPanelSettings() { $selectedCountry = GetConfig('CompanyCountry'); $selectedState = 0; if (isset($GLOBALS['SavedAddress']) && is_array($GLOBALS['SavedAddress'])) { $address = $GLOBALS['SavedAddress']; $selectedCountry = $address['shipcountry']; $addressVars = array('account_email' => 'AccountEmail', 'shipfirstname' => 'AddressFirstName', 'shiplastname' => 'AddressLastName', 'shipcompany' => 'AddressCompany', 'shipaddress1' => 'AddressLine1', 'shipaddress2' => 'AddressLine2', 'shipcity' => 'AddressCity', 'shipstate' => 'AddressState', 'shipzip' => 'AddressZip', 'shipphone' => 'AddressPhone'); if (isset($address['shipstateid'])) { $selectedState = $address['shipstateid']; } foreach ($addressVars as $addressField => $formField) { if (isset($address[$addressField])) { $GLOBALS[$formField] = isc_html_escape($address[$addressField]); } } } $country_id = GetCountryIdByName($selectedCountry); $GLOBALS['CountryList'] = GetCountryList(GetConfig('CompanyCountry'), true); $GLOBALS['StateList'] = GetStateListAsOptions($country_id, $selectedState); // If there are no states for the country then // hide the dropdown and show the textbox instead if (GetNumStatesInCountry($country_id) == 0) { $GLOBALS['HideStateList'] = "none"; } else { $GLOBALS['HideStateBox'] = "none"; } }
public function SetPanelSettings() { // Setup the cart values $total = $count = 0; $GLOBALS['SNIPPETS']['SideCartItems'] = ''; if (!isset($_SESSION['CART']['ITEMS']) || empty($_SESSION['CART']['ITEMS'])) { $this->DontDisplay = true; return; } if (isset($_SESSION['CART']['ITEMS'])) { foreach ($_SESSION['CART']['ITEMS'] as $item) { $total += $item['product_price'] * $item['quantity']; $count += $item['quantity']; if (!isset($item['type']) || $item['type'] != "giftcertificate") { $GLOBALS['ProductName'] = "<a href=\"" . ProdLink($item['product_name']) . "\">" . isc_html_escape($item['product_name']) . "</a>"; } else { $GLOBALS['ProductName'] = isc_html_escape($item['product_name']); } // Is this product a variation? $GLOBALS['ProductOptions'] = ''; if (isset($item['options']) && !empty($item['options'])) { $GLOBALS['ProductOptions'] .= "<br /><small>("; $comma = ''; foreach ($item['options'] as $name => $value) { if (!trim($name) || !trim($value)) { continue; } $GLOBALS['ProductOptions'] .= $comma . isc_html_escape($name) . ": " . isc_html_escape($value); $comma = ', '; } $GLOBALS['ProductOptions'] .= ")</small>"; } $GLOBALS['ProductPrice'] = CurrencyConvertFormatPrice($item['product_price'] * $item['quantity']); $GLOBALS['ProductQuantity'] = $item['quantity']; $GLOBALS['SNIPPETS']['SideCartItems'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideCartItem"); } } if ($count == 1) { $GLOBALS['SideCartItemCount'] = GetLang('SideCartYouHave1Item'); } else { $GLOBALS['SideCartItemCount'] = sprintf(GetLang('SideCartYouHaveXItems'), $count); } $GLOBALS['ISC_LANG']['SideCartTotalCost'] = sprintf(GetLang('SideCartTotalCost'), CurrencyConvertFormatPrice($total)); // Go through all the checkout modules looking for one with a GetSidePanelCheckoutButton function defined $GLOBALS['AdditionalCheckoutButtons'] = ''; $HideCheckout = false; foreach (GetAvailableModules('checkout', true, true) as $module) { if (method_exists($module['object'], 'GetSidePanelCheckoutButton')) { $GLOBALS['AdditionalCheckoutButtons'] .= $module['object']->GetSidePanelCheckoutButton(); } if ($module['object']->disableNonCartCheckoutButtons) { $HideCheckout = true; } } if ($HideCheckout) { $GLOBALS['SNIPPETS']['SideCartContentsCheckoutLink'] = ''; } else { $GLOBALS['SNIPPETS']['SideCartContentsCheckoutLink'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('SideCartContentsCheckoutLink'); } }
function SetPanelSettings() { $output = ""; if (GetConfig('HomeBlogPosts') > 0) { $query = "select newsid, newstitle from [|PREFIX|]news where newsvisible='1' order by newsid desc"; $query .= $GLOBALS['ISC_CLASS_DB']->AddLimit(0, GetConfig('HomeBlogPosts')); $result = $GLOBALS['ISC_CLASS_DB']->Query($query); if ($GLOBALS['ISC_CLASS_DB']->CountResult($result) > 0) { while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) { $GLOBALS['BlogText'] = isc_html_escape($row['newstitle']); $GLOBALS['BlogLink'] = BlogLink($row['newsid'], $row['newstitle']); $output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("RecentBlog"); } $GLOBALS['SNIPPETS']['RecentBlogs'] = $output; // Showing the syndication option? if (GetConfig('RSSLatestBlogEntries') != 0 && GetConfig('RSSSyndicationIcons') != 0) { $GLOBALS['SNIPPETS']['HomeRecentBlogsFeed'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("HomeRecentBlogsFeed"); } } else { $this->DontDisplay = true; $GLOBALS['HideHomeRecentBlogsPanel'] = "none"; } } else { $this->DontDisplay = true; $GLOBALS['HideHomeRecentBlogsPanel'] = "none"; } }
public function SetPanelSettings() { $GLOBALS['ISC_CLASS_CATEGORY'] = GetClass('ISC_CATEGORY'); // Output breadcrumb trail $GLOBALS['SNIPPETS']['CatTrail'] = ""; if ($GLOBALS['EnableSEOUrls'] == 1) { $baseLink = sprintf("%s/categories", $GLOBALS['ShopPath']); } else { $baseLink = sprintf("%s/categories.php?category=", $GLOBALS['ShopPath']); } $count = 0; $catPath = ''; foreach($GLOBALS['CatTrail'] as $trail) { // if it's the root category and not friendly url, don't add / in front if ($count==0 && $GLOBALS['EnableSEOUrls'] != 1) { $baseLink .= MakeURLSafe($trail[1]); } else { $baseLink .= "/" . MakeURLSafe($trail[1]); } $catPath = MakeURLSafe($trail[1]); $GLOBALS['CatTrailName'] = isc_html_escape($trail[1]); $GLOBALS['CatTrailLink'] = $baseLink."/"; if($count++ == count($GLOBALS['CatTrail'])-1) { $GLOBALS['SNIPPETS']['CatTrail'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("BreadcrumbItemCurrent"); } else { $GLOBALS['SNIPPETS']['CatTrail'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("BreadcrumbItem"); } } }
public function SetPanelSettings() { if(!isset($GLOBALS['BreadCrumbs'])) { $this->DontDisplay = true; return; } $GLOBALS['ISC_CLASS_TAGS'] = GetClass('ISC_TAGS'); $GLOBALS['SNIPPETS']['Trail'] = ''; $trailCount = count($GLOBALS['BreadCrumbs']); foreach($GLOBALS['BreadCrumbs'] as $k => $trail) { $GLOBALS['CatTrailName'] = isc_html_escape($trail['name']); $GLOBALS['CatTrailLink'] = ''; if(isset($trail['link'])) { $GLOBALS['CatTrailLink'] = isc_html_escape($trail['link']); } if($k == $trailCount-1) { $GLOBALS['SNIPPETS']['Trail'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("BreadcrumbItemCurrent"); } else { $GLOBALS['SNIPPETS']['Trail'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("BreadcrumbItem"); } } }
public function SetPanelSettings() { $count = 0; $GLOBALS['SNIPPETS']['HomeFeaturedCategories'] = ''; $categories = $GLOBALS['ISC_CLASS_DATA_STORE']->Read('RootCategories'); if (GetConfig('HomeFeaturedCategories') > 0) { if (GetConfig('EnableProductReviews') == 0) { $GLOBALS['HideProductRating'] = "display: none"; } //$query = " SELECT cat.categoryid, cat.catname, FROM [|PREFIX|]categories cat WHERE cat.catpopular = '1' ORDER BY RAND()"; // $query = " SELECT c.catname, c.catimagefile, c.categoryid, MIN(p.prodcalculatedprice) AS prodcalculatedprice, p.prodvisible RootVisible, sp.prodvisible SubVisible,\n MIN(sp.prodcalculatedprice) AS subprodcalculatedprice\n FROM isc_categories c \n LEFT JOIN isc_categoryassociations ca ON c.categoryid = ca.categoryid \n LEFT JOIN isc_products p ON ca.productid = p.productid AND p.prodvisible='1'\n LEFT JOIN isc_categories sc ON sc.catparentid = c.categoryid AND sc.catvisible = 1 \n LEFT JOIN isc_categoryassociations sca ON sc.categoryid = sca.categoryid \n LEFT JOIN isc_products sp ON sca.productid = sp.productid AND sp.prodvisible='1' \n WHERE 1=1 \n AND c.catvisible = 1\n AND (p.prodvisible='1' || sp.prodvisible='1' )\n AND c.catpopular = '1'\n GROUP BY c.categoryid ORDER BY c.catname "; $query .= $GLOBALS['ISC_CLASS_DB']->AddLimit(0, GetConfig('HomeFeaturedCategories')); $result = $GLOBALS['ISC_CLASS_DB']->Query($query); if ($GLOBALS['ISC_CLASS_DB']->CountResult($result) > 0) { $GLOBALS['AlternateClass'] = ''; while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) { if ($GLOBALS['AlternateClass'] == 'Odd') { $GLOBALS['AlternateClass'] = 'Even'; } else { $GLOBALS['AlternateClass'] = 'Odd'; } $path = GetConfig('ShopPath'); $CatLink = "{$path}/search.php?search_query=" . urlencode($row['catname']); $GLOBALS['CategoryName'] = isc_html_escape($row['catname']); $GLOBALS['CategoryLink'] = $CatLink; if ($row['SubVisible'] && $row['RootVisible']) { $DisStartPrice = number_format(min($row['prodcalculatedprice'], $row['subprodcalculatedprice']), 2, '.', ''); } else { if ($row['RootVisible']) { $DisStartPrice = number_format($row['prodcalculatedprice'], 2, '.', ''); } else { if ($row['SubVisible']) { $DisStartPrice = number_format($row['subprodcalculatedprice'], 2, '.', ''); } } } // Determine the price of this product $GLOBALS['CategoryPrice'] = "Price starting from \$" . $DisStartPrice; $imageThumb = ''; $GLOBALS['CategoryThumb'] = ''; if (file_exists(ISC_BASE_PATH . '/category_images/' . $row['catimagefile']) && $row['catimagefile'] != '') { //$GLOBALS['CategoryThumb'] = ImageThumb($row['catimagefile'], $CatLink); $imageThumb .= '<a href="' . $CatLink . '" >'; $imageThumb .= '<img src="' . $GLOBALS['ShopPath'] . '/category_images/' . $row['catimagefile'] . '" alt="" />'; $imageThumb .= '</a>'; $GLOBALS['CategoryThumb'] = $imageThumb; } $GLOBALS['SNIPPETS']['HomeFeaturedCategories'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("HomeFeaturedCategoriesItem"); } } else { $this->DontDisplay = true; $GLOBALS['HideHomeFeaturedProductsPanel'] = "none"; } } else { $this->DontDisplay = true; $GLOBALS['HideHomeFeaturedProductsPanel'] = "none"; } }
/** * Set the panel settings. */ public function SetPanelSettings() { $cVendor = GetClass('ISC_VENDORS'); $vendor = $cVendor->GetVendor(); $GLOBALS['VendorId'] = $vendor['vendorid']; $GLOBALS['VendorName'] = isc_html_escape($vendor['vendorname']); $GLOBALS['VendorBio'] = $vendor['vendorbio']; }
/** * Show the products associated with a particular tag. */ public function ShowTag() { $GLOBALS['HidePanels'][] = 'ProductTagCloud'; $GLOBALS['BreadCrumbs'] = array(array('name' => GetLang('ProductTagCloud'), 'link' => TagLink()), array('name' => $this->tag['tagname'])); $title = sprintf(GetLang('ProductsTaggedWith'), isc_html_escape($this->tag['tagname'])); $GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetConfig('StoreName') . ' - ' . $title); $GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("tags"); $GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate(); }
/** * Fetch the configuration form for this importer. * * @return string The HTML configuration page for this importer. */ function Configure() { $GLOBALS['Path'] = 'http://'; if (isset($_POST['path']) && $_POST['path'] != '') { $GLOBALS['Path'] = isc_html_escape($_POST['path']); } $GLOBALS['HelpTitle'] = str_replace("'", "\\'", GetLang('OsCommerceLocation')); return $this->ParseTemplate("oscommerce.configure", true); }
private function ShowSystemInfo() { // Server Information $GLOBALS['ProductVersion'] = isc_html_escape(PRODUCT_VERSION); $GLOBALS['PHPVersion'] = isc_html_escape(phpversion()); $GLOBALS['MySQLVersion'] = isc_html_escape(mysql_get_server_info()); $GLOBALS['ServerSoftware'] = isc_html_escape($_SERVER['SERVER_SOFTWARE']); if (GetConfig('DisableSystemInfoEdition')) { $GLOBALS['HideEdition'] = 'display: none'; } else { if (isset($GLOBALS['ProductEditionUpgrade'])) { $GLOBALS['ProductEdition'] .= " (<a href='" . GetConfig('SystemInfoEditionUpgradeLink') . "' target='_blank'>Upgrade</a>)"; } } if (GDEnabled()) { $php_mods = parsePHPModules(); $GLOBALS['GDVersion'] = isc_html_escape($php_mods['gd']['GD Version']); } else { $GLOBALS['GDVersion'] = GetLang('GDMissing'); } if ((bool) ini_get('safe_mode') == true) { $GLOBALS['SafeMode'] = GetLang('Enabled'); } else { $GLOBALS['SafeMode'] = GetLang('Disabled'); } $GLOBALS['MultiByteFunctions'] = array(); if (function_exists("mb_strpos")) { $GLOBALS['MultiByteFunctions'][] = "Multibyte"; } if (function_exists("iconv_strpos")) { $GLOBALS['MultiByteFunctions'][] = "iconv"; } $GLOBALS['MultiByteFunctions'] = implode("<br />", $GLOBALS['MultiByteFunctions']); if (!$GLOBALS['MultiByteFunctions']) { $GLOBALS['MultiByteFunctions'] = GetLang('NotSupported'); } $GLOBALS['RemoteConnections'] = array(); if (function_exists("curl_init")) { $GLOBALS['RemoteConnections'][] = "CURL"; } if (!(bool) ini_get('safe_mode') && ini_get('allow_url_fopen')) { $GLOBALS['RemoteConnections'][] = GetLang('RemoteFOpen'); } $GLOBALS['RemoteConnections'] = implode("<br />", $GLOBALS['RemoteConnections']); if (!$GLOBALS['RemoteConnections']) { $GLOBALS['RemoteConnections'] = GetLang('NoneSupported'); } if (function_exists('pspell_suggest')) { $GLOBALS['PSpell'] = GetLang('Enabled'); } else { $GLOBALS['PSpell'] = GetLang('NotSupported'); } $GLOBALS['OperatingSystem'] = isc_html_escape(php_uname()); $GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("sysinfo"); $GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate(); }
/** * Generate a TinyMCE based textarea for entering text on to a page. * * @param array An array of options (id, value, width, height). If not specified, uses defaults. * @return string The HTML for the generated WYSIWYG editor. */ public function DrawTinyMceEditor($options) { $this->template->Assign('WysiwygId', $options['id']); $this->template->Assign('WysiwygValue', isc_html_escape($options['value'])); $this->template->Assign('WysiwygWidth', $options['width']); $this->template->Assign('WysiwygHeight', $options['height']); $this->template->Assign('LoadFunctionName', 'LoadEditor_'.$options['id']); // Load a custom valid_elements set for TinyMCE if(!empty($options['validElementsSet'])) { $setName = $options['validElementsSet']; $setTemplateName = 'Snippets/EditorTinyMCE.validElements.'.$setName.'.tpl'; $validElements = $this->template->render($setTemplateName); $this->template->Assign('ValidElements', $validElements); } if(isset($options['delayLoad']) && $options['delayLoad'] == true) { $this->template->Assign('LoadFuntion', ''); } else { $this->template->Assign('LoadFunction', 'LoadEditor_'.$options['id'].'()'); } $common = $this->template->render('Snippets/EditorTinyMCECommon.html'); if(isset($options['editorOnly']) && $options['editorOnly'] == true) { return $common; } $this->template->Assign('EditorTinyMCECommon', $common); // Check to see if GZIp support can be enabled $encodings = array(); $supportsGzip = false; // Check if it supports gzip if (isset($_SERVER['HTTP_ACCEPT_ENCODING'])) $encodings = explode(',', strtolower(preg_replace("/\s+/", "", $_SERVER['HTTP_ACCEPT_ENCODING']))); if ((in_array('gzip', $encodings) || in_array('x-gzip', $encodings) || isset($_SERVER['---------------'])) && function_exists('ob_gzhandler') && !ini_get('zlib.output_compression')) { if(in_array('x-gzip', $encodings)) { $enc = 'x-gzip'; } else { $enc = 'gzip'; } $supportsGzip = true; } if($supportsGzip) { return $this->template->render('Snippets/EditorTinyMCEGzip.html'); } else { return $this->template->render('Snippets/EditorTinyMCE.html'); } }
function SetPanelSettings() { // Build the breadcrumb trail to this page $parentlist = $GLOBALS['ISC_CLASS_PAGE']->GetPageParentList(); $pageid = $GLOBALS['ISC_CLASS_PAGE']->GetPageId(); if (isset($GLOBALS['ISC_CLASS_VENDORS'])) { $vendor = $GLOBALS['ISC_CLASS_VENDORS']->GetVendor(); } else { $vendor = array(); } $GLOBALS['SNIPPETS']['PageBreadcrumb'] = ''; if ($parentlist != '') { $query = sprintf("SELECT pageid, pagetitle, pagelink, pagetype, pageparentid FROM [|PREFIX|]pages WHERE pageid IN (%s) OR pageid='%d'", $parentlist, $pageid); $result = $GLOBALS['ISC_CLASS_DB']->Query($query); while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) { $parentPages[$row['pageid']] = $row; } // Now we have the list we can generate the breadcrumb trail $parentid = $pageid; do { if (!isset($parentPages[$parentid])) { break; } $page = $parentPages[$parentid]; $GLOBALS['CatTrailName'] = isc_html_escape($page['pagetitle']); // Is it a normal page, external page or RSS feed? switch ($page['pagetype']) { case 0: case 2: case 3: // Normal Page or RSS feed $GLOBALS['CatTrailLink'] = PageLink($page['pageid'], $page['pagetitle'], $vendor); break; case 1: // External Link $GLOBALS['CatTrailLink'] = $page['pagelink']; break; } if ($parentid == $pageid) { $item = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("BreadcrumbItemCurrent"); } else { $item = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("BreadcrumbItem"); } $GLOBALS['SNIPPETS']['PageBreadcrumb'] = $item . $GLOBALS['SNIPPETS']['PageBreadcrumb']; $parentid = $page['pageparentid']; } while ($parentid != 0); } if (!empty($vendor)) { $GLOBALS['CatTrailName'] = isc_html_escape($vendor['vendorname']); $GLOBALS['CatTrailLink'] = VendorLink($vendor); $GLOBALS['SNIPPETS']['PageBreadcrumb'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("BreadcrumbItem") . $GLOBALS['SNIPPETS']['PageBreadcrumb']; } }
function SetPanelSettings() { $output = ""; $GLOBALS['ISC_CategoryBrandCache'] = GetClass('ISC_CACHECATEGORYBRANDS'); $cachedCategoryBrands = $GLOBALS['ISC_CategoryBrandCache']->getCategoryBrandsData(); //var_export($cachedCategoryBrands); $mybrands = $GLOBALS['ISC_CategoryBrandCache']->GetBrandsIndexpage($cachedCategoryBrands); //$mycategorys = $GLOBALS['ISC_CategoryBrandCache']->GetAllCategories($cachedCategoryBrands); //$mysubcategorys = $GLOBALS['ISC_CategoryBrandCache']->GetSubCategories($cachedCategoryBrands); //$myCategoryBrands = $GLOBALS['ISC_CategoryBrandCache']->GetCategoryBrands($cachedCategoryBrands); //var_dump($mycategorys); $path = GetConfig('ShopPath'); // Get the link to the "all brands" page $GLOBALS['AllBrandsLink'] = BrandLink(); //wirror20110328: show arrow image $GLOBALS['arrowimage'] = "<img src='{$path}/templates/default/images/imgHdrDropDownIcon.gif' border='0' id='brand_listimage'/>"; /*// Get the 10 most popular brands $query = "SELECT brandid, brandname, COUNT(*) AS num FROM [|PREFIX|]brands b, [|PREFIX|]products p WHERE p.prodbrandid = b.brandid AND prodvisible=1 GROUP BY prodbrandid ORDER BY brandname ASC "; //$query .= $GLOBALS['ISC_CLASS_DB']->AddLimit(0, 10+1); $result = $GLOBALS['ISC_CLASS_DB']->Query($query);*/ $extra_output = ""; // for brands exceeding more than 10 $x = 1; foreach ($mybrands as $brand) { //$GLOBALS['BrandLink'] = BrandLink($row['brandname']); $GLOBALS['BrandLink'] = $this->LeftBrandLink($brand['brandname']); //Added by Simha $GLOBALS['BrandName'] = isc_html_escape($brand['brandname']); if ($x <= 10) { $output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ShopByBrandItem"); } else { $extra_output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ShopByBrandItem"); } ++$x; } if ($x > 11) { $GLOBALS['FilterID'] = "brand"; $GLOBALS['ExtraValues'] = $extra_output; $GLOBALS['SNIPPETS']['ShopByBrandAllItem'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideFilterMoreLink"); //$GLOBALS['SNIPPETS']['ShopByBrandAllItem'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ShopByBrandAllItem"); } if (!$output) { $this->DontDisplay = true; } $output = $GLOBALS['ISC_CLASS_TEMPLATE']->ParseSnippets($output, $GLOBALS['SNIPPETS']); $GLOBALS['SNIPPETS']['SideShopByBrandList'] = $output; }
/** * Set the settings for this panel. */ public function SetPanelSettings() { $image_list = $GLOBALS['ISC_CLASS_ACCOUNT']->GetUploadImage(); if (count($image_list) == 0) { $GLOBALS['SNIPPETS']['UploadImageList'] = 'There is no image at the moment.'; } foreach ($image_list as $address) { $GLOBALS['picId'] = (int) $address['picid']; $GLOBALS['ImageUrl'] = $address['path']; $GLOBALS['ImageDesc'] = isc_html_escape($address['description']); $GLOBALS['SNIPPETS']['UploadImageList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("UploadImageItem"); } }
public function SetPanelSettings() { // generate url with all current GET params except page, ajax and section $url = array(); foreach ($_GET as $key => $value) { if ($key == 'page' || $key == 'ajax' || $key == 'section') { continue; } if (is_array($value)) { foreach ($value as $subvalue) { $url[] = urlencode($key . '[]') . '=' . urlencode($subvalue); } } else { $url[] = urlencode($key) . '=' . urlencode($value); } } $url = 'search.php?' . implode('&', $url); $GLOBALS['ProductTabUrl'] = isc_html_escape($url . '§ion=product#results'); $GLOBALS['ContentTabUrl'] = isc_html_escape($url . '§ion=content#results'); $GLOBALS["SelectedSearchTab"] = ""; $GLOBALS["HideSearchPage"] = ""; if (!$GLOBALS["ISC_CLASS_SEARCH"]->searchIsLoaded()) { $GLOBALS["HideSearchPage"] = "none"; } else { $GLOBALS["ProductContainerDisplay"] = "display:none;"; $GLOBALS["ContentContainerDisplay"] = "display:none;"; $section = "product"; if ($GLOBALS["ISC_CLASS_SEARCH"]->GetNumResults("product", "brand", "category") === 0 && $GLOBALS["ISC_CLASS_SEARCH"]->GetNumResults("content") > 0) { $section = "content"; } if (isset($_GET['section'])) { $section = $_GET['section']; } if ($section == 'content') { $GLOBALS["SelectedSearchTab"] = "content"; $GLOBALS["ContentTabActive"] = "Active"; $GLOBALS["ContentContainerDisplay"] = ""; } else { $GLOBALS["SelectedSearchTab"] = "product"; $GLOBALS["ProductTabActive"] = "Active"; $GLOBALS["ProductContainerDisplay"] = ""; } } }
public function SetPanelSettings() { // Show "All prices are in [currency code]" $currency = GetCurrencyById($GLOBALS['CurrentCurrency']); if (is_array($currency) && $currency['currencycode']) { $GLOBALS['AllPricesAreInCurrency'] = sprintf(GetLang('AllPricesAreInCurrency'), isc_html_escape($currency['currencyname']), isc_html_escape($currency['currencycode'])); } if (GetConfig('DebugMode') == 1) { $end_time = microtime_float(); $GLOBALS['ScriptTime'] = number_format($end_time - ISC_START_TIME, 4); $GLOBALS['QueryCount'] = $GLOBALS['ISC_CLASS_DB']->NumQueries; if (function_exists('memory_get_peak_usage')) { $GLOBALS['MemoryPeak'] = "Memory usage peaked at " . NiceSize(memory_get_peak_usage(true)); } else { $GLOBALS['MemoryPeak'] = ''; } if (isset($_REQUEST['debug'])) { $GLOBALS['QueryList'] = "<ol class='QueryList' style='font-size: 13px;'>\n"; foreach ($GLOBALS['ISC_CLASS_DB']->QueryList as $query) { $GLOBALS['QueryList'] .= "<li style='line-height: 1.4; margin-bottom: 4px;'>" . isc_html_escape($query['Query']) . " — <em>" . number_format($query['ExecutionTime'], 4) . "seconds</em></li>\n"; } $GLOBALS['QueryList'] .= "</ol>"; } $GLOBALS['DebugDetails'] = "<p>Page built in " . $GLOBALS['ScriptTime'] . "s with " . $GLOBALS['QueryCount'] . " queries. " . $GLOBALS['MemoryPeak'] . "</p>"; } else { $GLOBALS['DebugDetails'] = ''; } // Do we have any live chat service code to show in the footer $modules = GetConfig('LiveChatModules'); if (!empty($modules)) { $liveChatClass = GetClass('ISC_LIVECHAT'); $GLOBALS['LiveChatFooterCode'] = $liveChatClass->GetPageTrackingCode('footer'); } // Load our whitelabel file for the front end require_once ISC_BASE_PATH . '/includes/whitelabel.php'; // Load the configuration file for this template $poweredBy = 0; require_once ISC_BASE_PATH . '/templates/' . GetConfig('template') . '/config.php'; if (isset($GLOBALS['TPL_CFG']['PoweredBy'])) { if (!isset($GLOBALS['ISC_CFG']['TemplatePoweredByLines'][$GLOBALS['TPL_CFG']['PoweredBy']])) { $GLOBALS['TPL_CFG']['PoweredBy'] = 0; } $poweredBy = $GLOBALS['TPL_CFG']['PoweredBy']; } // Showing the powered by? $GLOBALS['PoweredBy'] = ''; if ($GLOBALS['ISC_CFG']['DisableFrontEndPoweredBy'] == false && isset($GLOBALS['ISC_CFG']['TemplatePoweredByLines'][$poweredBy])) { $GLOBALS['PoweredBy'] = $GLOBALS['ISC_CFG']['TemplatePoweredByLines'][$poweredBy]; } }
public function SetPanelSettings() { // Have we only got one currency? Don't show anything $currencyCache = $GLOBALS['ISC_CLASS_DATA_STORE']->Read('Currencies'); if (empty($currencyCache) || count($currencyCache) <= 2) { $this->DontDisplay = true; return; } $GLOBALS['SNIPPETS']['ChooseCurrencyList'] = ''; $query = "\n\t\t\t\tSELECT cu.currencyid, cu.currencycode, cu.currencyname, IFNULL(co.countryname, cr.couregname) AS countryname, IFNULL(co.countryiso2, cr.couregiso2) AS countryflagname,\n\t\t\t\t IF(co.countryid IS NOT NULL, 0, 1) AS currencyisregion\n\t\t\t\tFROM [|PREFIX|]currencies cu\n\t\t\t\tLEFT JOIN [|PREFIX|]countries co ON cu.currencycountryid = co.countryid\n\t\t\t\tLEFT JOIN [|PREFIX|]country_regions cr ON cu.currencycouregid = cr.couregid\n\t\t\t\tWHERE cu.currencystatus = 1\n\t\t\t\tORDER BY cu.currencyisdefault DESC, cu.currencyname ASC\n\t\t\t"; $result = $GLOBALS['ISC_CLASS_DB']->Query($query); $total = $GLOBALS['ISC_CLASS_DB']->CountResult($result); $currencyLink = GetCurrentLocation(); $currencyLink = preg_replace("#setCurrencyId=[0-9]+#", "", $currencyLink); if (strpos($currencyLink, '?') === false) { $currencyLink .= '?'; } else { if (strpos($currencyLink, '?') != strlen($currencyLink) - 1 && substr($currencyLink, -1) !== '&') { $currencyLink .= '&'; } } $currencyLink .= 'setCurrencyId='; for ($i = 1; $row = $GLOBALS['ISC_CLASS_DB']->Fetch($result); $i++) { $GLOBALS['CurrencySelected'] = ''; $GLOBALS['CurrencySwitchLink'] = isc_html_escape($currencyLink . $row['currencyid']); if ($row['currencyid'] == $GLOBALS['CurrentCurrency']) { $GLOBALS['CurrencySelected'] = 'Sel'; $GLOBALS['SelectedCurrencyID'] = $row['currencyid']; } // This needs to be in a separate general function for getting the flag if ($row['currencyisregion']) { $parts = "regions/"; } else { $parts = ""; } if (file_exists(ISC_BASE_PATH . "/lib/flags/" . $parts . strtolower($row['countryflagname']) . ".gif")) { $GLOBALS['CurrencyFlag'] = '<img src="' . GetConfig("ShopPath") . '/lib/flags/' . $parts . strtolower($row['countryflagname']) . '.gif" border="0" alt="' . isc_html_escape($row['countryname']) . '" />'; } else { $GLOBALS['CurrencyFlag'] = ''; } $GLOBALS['CurrencyID'] = $row['currencyid']; $GLOBALS['CurrencyName'] = isc_html_escape($row['currencyname']); $GLOBALS['CurrencyFlagStyle'] = ''; if ($i < $total) { $GLOBALS['CurrencyFlagStyle'] = 'border-bottom: 0px;'; } $GLOBALS['SNIPPETS']['ChooseCurrencyList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideCurrencySelectorCurrency"); } }
public function SetPanelSettings() { $count = 0; $GLOBALS['SNIPPETS']['HomeSaleProducts'] = ''; if (GetConfig('HomeNewProducts') == 0) { $this->DontDisplay = true; return; } if (GetConfig('EnableProductReviews') == 0) { $GLOBALS['HideProductRating'] = "display: none"; } $query = "\n\t\t\t\tSELECT p.*, FLOOR(prodratingtotal/prodnumratings) AS prodavgrating, imageisthumb, imagefile, " . GetProdCustomerGroupPriceSQL() . "\n\t\t\t\tFROM [|PREFIX|]products p\n\t\t\t\tLEFT JOIN [|PREFIX|]product_images pi ON (p.productid=pi.imageprodid)\n\t\t\t\tWHERE p.prodsaleprice != 0 AND p.prodsaleprice < p.prodprice AND p.prodvisible='1' AND (imageisthumb=1 OR ISNULL(imageisthumb))\n\t\t\t\t" . GetProdCustomerGroupPermissionsSQL() . "\n\t\t\t\tORDER BY RAND()\n\t\t\t"; $query .= $GLOBALS['ISC_CLASS_DB']->AddLimit(0, GetConfig('HomeNewProducts')); $result = $GLOBALS['ISC_CLASS_DB']->Query($query); $GLOBALS['AlternateClass'] = ''; while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) { if ($GLOBALS['AlternateClass'] == 'Odd') { $GLOBALS['AlternateClass'] = 'Even'; } else { $GLOBALS['AlternateClass'] = 'Odd'; } $GLOBALS['ProductCartQuantity'] = ''; if (isset($GLOBALS['CartQuantity' . $row['productid']])) { $GLOBALS['ProductCartQuantity'] = (int) $GLOBALS['CartQuantity' . $row['productid']]; } $GLOBALS['ProductId'] = $row['productid']; $GLOBALS['ProductName'] = isc_html_escape($row['prodname']); $GLOBALS['ProductLink'] = ProdLink($row['prodname']); // Determine the price of this product $originalPrice = CalcRealPrice(CalcProdCustomerGroupPrice($row, $row['prodprice']), 0, 0, $row['prodistaxable']); $GLOBALS['OriginalProductPrice'] = CurrencyConvertFormatPrice($originalPrice); $GLOBALS['ProductPrice'] = CalculateProductPrice($row); $GLOBALS['ProductRating'] = (int) $row['prodavgrating']; // Workout the product description $desc = strip_tags($row['proddesc']); if (isc_strlen($desc) < 120) { $GLOBALS['ProductSummary'] = $desc; } else { $GLOBALS['ProductSummary'] = isc_substr($desc, 0, 120) . "..."; } $GLOBALS['ProductThumb'] = ImageThumb($row['imagefile'], ProdLink($row['prodname'])); $GLOBALS['SNIPPETS']['HomeSaleProducts'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("HomeSaleProductsItem"); if (!$GLOBALS['SNIPPETS']['HomeSaleProducts']) { $this->DontDisplay = true; return; } } }
public function SetPanelSettings() { // Are there any custom fields for this product? If so, load them if ($GLOBALS['ISC_CLASS_PRODUCT']->GetNumCustomFields() == 0) { $this->DontDisplay = true; return; } $GLOBALS['SNIPPETS']['ProductCustomFields'] = ""; $query = "\n\t\t\tSELECT *\n\t\t\tFROM [|PREFIX|]product_customfields\n\t\t\tWHERE fieldprodid='" . (int) $GLOBALS['ISC_CLASS_PRODUCT']->GetProductId() . "'\n\t\t\tORDER BY fieldid ASC\n\t\t"; $result = $GLOBALS['ISC_CLASS_DB']->Query($query); while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) { $GLOBALS['CustomFieldName'] = isc_html_escape($row['fieldname']); $GLOBALS['CustomFieldValue'] = $row['fieldvalue']; $GLOBALS['SNIPPETS']['ProductCustomFields'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ProductCustomFieldItem"); } }
/** * Generate the list of video walkthroughs. */ public function GetVideoWalkthroughs() { $expires = 86400; // 24 hr $cacheFile = ISC_BASE_PATH.'/cache/feeds/dashboard-videos.xml'; if(file_exists($cacheFile) && filemtime($cacheFile) > time() - $expires) { $videoContents = file_get_contents($cacheFile); $modified = filemtime($cacheFile); } else { $videoContents = PostToRemoteFileAndGetResponse(GetConfig('VideoWalkthroughFeed')); if($videoContents) { @file_put_contents($cacheFile, $videoContents); } $modified = time(); } if(!$videoContents) { exit; } $xml = @simplexml_load_string($videoContents); if(!is_object($xml)) { exit; } $output = ''; $this->template->Assign('Width', (int)$xml->width); $this->template->Assign('Height', (int)$xml->height); foreach($xml->video as $video) { $this->template->Assign('Title', isc_html_escape($video->title)); $this->template->Assign('URL', isc_html_escape($video->url)); if($_SERVER['HTTPS'] == 'on') { $video->preview = str_replace('http://', 'https://', $video->preview); } $this->template->Assign('Preview', isc_html_escape($video->preview)); $output .= $this->template->render('Snippets/DashboardVideoWalkthroughItem.html'); } header("Last-Modified: " . gmdate("r", $modified)); header("Pragma: public"); header("Cache-control: public,maxage=" . $expires); header("Expires: " . gmdate("r", $modified + $expires)); echo $output; exit; }
function SetPanelSettings() { $GLOBALS['ProductId'] = $GLOBALS['ISC_CLASS_PRODUCT']->GetProductId(); $GLOBALS['ProductName'] = $GLOBALS['ISC_CLASS_PRODUCT']->GetProductName(); $wishLists = $this->LoadCustomerWishLists(); $GLOBALS['WishLists'] = ''; $i = 0; foreach ($wishLists as $wishlist) { if ($i == 0) { $checked = 'checked'; } else { $checked = ''; } $GLOBALS['WishLists'] .= '<input type="radio" name="wishlistid" id="wishlistid' . (int) $wishlist['wishlistid'] . '" value="' . (int) $wishlist['wishlistid'] . '" ' . $checked . ' /> <label for="wishlistid' . (int) $wishlist['wishlistid'] . '">' . isc_html_escape($wishlist['wishlistname']) . '</label><br />'; ++$i; } }