Jump to content

lyonsperf

Members
  • Content count

    341
  • Joined

  • Last visited

Everything posted by lyonsperf

  1. lyonsperf

    Who's Online Enhancement 1.4

    I have 3.5.4 installed and am getting multiple admins online shown in the who's online. Any ideas to fix this?
  2. lyonsperf

    ULTIMATE Seo Urls 5 - by FWR Media

    I just upgraded from chemo;s ultimate seo 2.2d. When submitting my sitemaps in xml form to google I am getting the following error Invalid URL This is not a valid URL. Please correct it and resubmit. URL: http:// Parent tag: url Tag: loc Problem detected on: Oct 28, 2011 I also installed the xml sitemaps mod in the extras folder. Any ideas? none of my links are being listed.
  3. lyonsperf

    Ultimate Seo Urls 5 Pro

    Here are a few lines of the xml sitemap: <?xml version="1.0" encoding="UTF-8" ?> - <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> - <url> <loc>http://www.protoolzonline.com/product_info.php/tie-rod-ball-joint-pitman-arm/tie-rodpitman-arm-adjusting-tool-set/7802-p-9083</loc> <lastmod>2011-10-15</lastmod> <changefreq>weekly</changefreq> <priority>0.5</priority> </url> - <url> <loc>http://www.protoolzonline.com/product_info.php/tie-rod-ball-joint-pitman-arm/stepped-tie-rod-separator/lis18520-p-9095</loc> <lastmod>2011-10-15</lastmod> <changefreq>weekly</changefreq> <priority>0.5</priority> </url> - <url> <loc>http://www.protoolzonline.com/product_info.php/tie-rod-ball-joint-pitman-arm/stepped-pneumatic-pickle-fork-kit/lis41400-p-9097</loc> <lastmod>2011-10-15</lastmod> <changefreq>weekly</changefreq> <priority>0.5</priority> </url>
  4. lyonsperf

    Ultimate Seo Urls 5 Pro

    I just upgraded from chemo;s ultimate seo 2.2d. When submitting my sitemaps in xml form to google I am getting the following error Invalid URL This is not a valid URL. Please correct it and resubmit. URL: http:// Parent tag: url Tag: loc Problem detected on: Oct 28, 2011 I also installed the xml sitemaps mod in the extras folder. Any ideas? none of my links are being listed.
  5. lyonsperf

    Automatically send data feed to Froogle

    Here is my googlefeeder file <?php // Title: Google Base Data Feeder // Last Update: 12/25/09 by Jack_mcs at oscommerce-solution.com // google feed requirements - http://www.google.com/support/merchants/bin/answer.py?hl=en&answer=188494 chdir('../'); include_once 'includes/application_top.php'; /*************** BEGIN MASTER SETTINGS ******************/ define('SEO_ENABLED','true'); //Change to 'false' to disable if Ultimate SEO URLs is not installed define('FEEDNAME', 'xxxxxxx.txt'); //from your googlebase account define('DOMAIN_NAME', 'www.lyonsperformance.com'); //your correct domain name (don't include www unless it is used) define('FTP_USERNAME', 'xxxxxxx'); //created from within your googlebase account define('FTP_PASSWORD', 'xxxxxxx'); //created from within your googlebase account define('FTP_ENABLED', (isset($_GET['noftp']) ? '1' : '1')); //set to 0 to disable define('CONVERT_CURRENCY', '0'); //set to 0 to disable - only needed if a feed in a difference currecny is required define('CURRENCY_TYPE', 'USD'); //(eg. USD, EUR, GBP) define('DEFAULT_LANGUAGE_ID', 1); //Change this to the id of your language. BY default 1 is english define('QUOTES_CATEGORY_NAME',''); //if the Quotes contribution is installed, enter the name of the quotes category here /*************** OPTIONS - IF ENABLED, ALSO SET THE SIMILAR OPTION FARTHER DOWN ******************/ define('OPTIONS_ENABLED', 1); define('OPTIONS_ENABLED_AGE_RANGE', 0); define('OPTIONS_ENABLED_ATTRIBUTES', 0); define('OPTIONS_ENABLED_BRAND', 1); //if set, see options for this setting below define('OPTIONS_ENABLED_CONDITION', 1); define('OPTIONS_ENABLED_CURRENCY', 0); define('OPTIONS_ENABLED_EXPIRATION', 1); define('OPTIONS_ENABLED_FEED_LANGUAGE', 0); define('OPTIONS_ENABLED_GTIN', 0); //if set, a database field named products_gtin must exist define('OPTIONS_ENABLED_GOOGLE_PRODUCT_CATEGORY', 1); //http://www.google.com/support/merchants/bin/answer.py?answer=160081 define('OPTIONS_ENABLED_GOOGLE_UTM', 0); define('OPTIONS_ENABLED_ISBN', 0); //if set, a database field named products_isbn must exist define('OPTIONS_ENABLED_MADE_IN', 0); define('OPTIONS_ENABLED_MPN', 1); //if set, see options for this setting below define('OPTIONS_ENABLED_PRODUCT_MODEL', 1); //displays the product model define('OPTIONS_ENABLED_PRODUCT_TYPE', 1); define('OPTIONS_ENABLED_SHIPPING', 0); define('OPTIONS_ENABLED_INCLUDE_TAX', 0); //0 = no tax, 1 = uses google method, 2 = UK Vat define('OPTIONS_ENABLED_UPC', 0); //if set, a database field named products_upc must exist define('OPTIONS_ENABLED_WEIGHT', 1); //some of the following only work if the matching option is enabled above. define('OPTIONS_AGE_RANGE', '20-90 years'); define('OPTIONS_AVAILABILITY', 'quantity'); //in stock - Include this value if you are certain that it will ship (or be in-transit to the customer) in 3 business days or less. //available for order - Include this value if it will take 4 or more business days to ship it to the customer. //out of stock - You’re currently not accepting orders for this product. //preorder - You are taking orders for this product, but it’s not yet been released. //if empty (no entry), the data will be loaded from the database. A field in the products description table named products_availability is required //if "quantity," the field will be popuplated via the quantity: 0 or less = out of stock, greater than 0 = in stock //if "status," the field will be popuplated via the status field. in or out of stock define('OPTIONS_BRAND', 'manu'); //leave blank to load from the database field named products_brand, set to "name" to substitute the products name, manu to substitute the manufactueres name or model to substitute the products model define('OPTIONS_CONDITION', 'new'); //possible entries are New, Refurbished, Used or blank, which loads from the database field named products_condition define('OPTIONS_CURRENCY', 'USD'); define('OPTIONS_CURRENCY_THOUSANDS_POINT', ','); //this is the thousands point as in $1,000. define('OPTIONS_DATE_FORMAT', 'Y-m-d'); //change how the date is formatted define('OPTIONS_FEED_LANGUAGE', 'en'); define('OPTIONS_GOOGLE_UTM', '?utm_source=GoogleBase1&utm_medium=BaseFeed1&utm_campaign=products'); //see http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55578 define('OPTIONS_GOOGLE_PRODUCT_CATEGORY', 'Vehicles & Parts'); //enter db to load from a database field named google_product_category enter or enter a specific google category - see taxomy - http://www.google.com/support/merchants/bin/answer.py?answer=160081 define('OPTIONS_GTIN', ''); define('OPTIONS_ISBN', ''); define('OPTIONS_MADE_IN', 'US'); define('OPTIONS_MPN', 'model'); //leave blank to load from the database field named products_mpn, set to "name" to substitute the products name, manu to substitute the manufactueres name or model to substitute the products model define('OPTIONS_PRODUCT_TYPE', 'full'); //full means the full category path (i.e., hardware,printers), anything else, or blank, means just the products category (i.e., printers) //the following is for the shipping override option - enter multiple values separated by a comma //Format entries follow. A colon must be present for each field, whether it is entered or not. // COUNTRY - OPTIONAL - If country isn't included, we'll assume the shipping price applies to the target country of the item. If region isn't included, the shipping price will apply across the entire country. // REGION - OPTIONAL - blank for entire country, otherwise, us two-letter State (CA), full zip code (90210) or wildcard zip code (902*) // SERVICE - OPTIONAL - The service class or delivery speed, i.e. ground // PRICE - REQUIRED - Fixed shipping price (assumes the same currency as the price attribute) define('OPTIONS_SHIPPING_STRING', 'US:::6.35'); //says charge tax to US for residents of Florida at 5% and don't apply tax to shipping define('OPTIONS_TAX_RATE' , '0'); //default = 0 (e.g. for 20.0% tax use "$taxRate = 20.0;") //only used in the next line define('OPTIONS_TAX_CALC', (OPTIONS_ENABLED_INCLUDE_TAX == 2 ? (OPTIONS_TAX_RATE/100) + 1 : '1')); //UK. US tax rate - US is ignorded since it is 1 //the following is for the tax override option - enter multiple values separated by a comma //Format entries follow. A colon must be present for each field, whether it is entered or not. // COUNTRY - OPTIONAL - country the tax applies to - only US for now // REGION - OPTIONAL - blank for entire country, otherwise, us two-letter State (CA), full zip code (90210) or wildcard zip code (902*) // TAX - REQUIRED - default = 0 (e.g. for 5.76% tax use 5.76) // SHIPPING - OPTIONAL - do you charge tax on shipping - choices are y or n define('OPTIONS_TAX_STRING', 'US:CT:6.35:y'); //says charge tax to US for residents of Florida at 5% and don't apply tax to shipping define('OPTIONS_UPC', ''); define('OPTIONS_WEIGHT_ACCEPTED_METHODS', 'lb'); //Valid units include lb, pound, oz, ounce, g, gram, kg, kilogram. //the following allow skipping certain items define('OPTIONS_IGNORE_PRODUCT_PRICE', 0); //0 = include products with price of 0 in output, 1 = ignore products with price of 0 define('OPTIONS_IGNORE_PRODUCT_ZERO', 0); //0 = include products with qty of 0 in output, 1 = ignore products with qty of 0 /*************** END MASTER SETTINGS ******************/ /*************** NO EDITS NEEDED BELOW THIS LINE *****************/ //******************** // Start TIMER // ----------- $stimer = explode( ' ', microtime() ); $stimer = $stimer[1] + $stimer[0]; // ----------- $OutFile = "feeds/" . FEEDNAME; $destination_file = FEEDNAME; $source_file = $OutFile; $imageURL = 'http://' . DOMAIN_NAME . '/images/'; if(SEO_ENABLED=='true'){ $productURL = 'product_info.php'; // ***** Revised for SEO $productParam = "products_id="; // ***** Added for SEO }else{ $productURL = 'http://' . DOMAIN_NAME . '/product_info.php?products_id='; } $already_sent = array(); if(CONVERT_CURRENCY) { if(SEO_ENABLED=='true'){ $productParam="currency=" . CURRENCY_TYPE . "&products_id="; }else{ $productURL = "http://" . DOMAIN_NAME . "/product_info.php?currency=" . CURRENCY_TYPE . "&products_id="; //where CURRENCY_TYPE is your currency type (eg. USD, EUR, GBP) } } $feed_exp_date = @date(OPTIONS_DATE_FORMAT, time() + 2419200 ); if (!($link=mysql_connect(DB_SERVER,DB_SERVER_USERNAME,DB_SERVER_PASSWORD))) { echo "Error when connecting itself to the data base"; exit(); } if (!mysql_select_db( DB_DATABASE , $link )) { echo "Error the data base does not exist"; exit(); } $quotes = ''; if (QUOTES_CATEGORY_NAME !== '') { $quotes = " and products.customers_email_address = '' and products.quotes_email_address = ''"; } $extraFields = ''; if (OPTIONS_AVAILABILITY == '') { $extraFields .= ' products_description.products_availability as availability, '; } if (OPTIONS_ENABLED_BRAND == 1) { if (strlen(OPTIONS_BRAND) == 0) { $extraFields .= ' products.products_brand as brand, '; } else { switch (OPTIONS_BRAND) { case 'name': $extraFields .= ' products_description.products_name as brand, '; break; case 'manu': $extraFields .= ' manufacturers.manufacturers_name as brand, '; break; case 'model': $extraFields .= ' products.products_model as brand, '; break; default: $extraFields .= ' products_description.products_name as brand, '; } } } if (OPTIONS_ENABLED_CONDITION == 1 && strlen(OPTIONS_CONDITION) == 0) { $extraFields .= ' products.products_condition as pcondition, '; } if (OPTIONS_ENABLED_GTIN == 1 && strlen(OPTIONS_GTIN) == 0) { $extraFields .= ' products.products_gtin as gtin, '; } if (OPTIONS_ENABLED_ISBN == 1 && strlen(OPTIONS_ISBN) == 0) { $extraFields .= ' products.products_isbn as isbn, '; } if (OPTIONS_ENABLED_MPN == 1) { if (strlen(OPTIONS_MPN) == 0) { $extraFields .= ' products.products_mpn as mpn, '; } else { switch (OPTIONS_MPN) { case 'name': $extraFields .= ' products_description.products_name as mpn, '; break; case 'manu': $extraFields .= ' manufacturers.manufacturers_name as mpn, '; break; case 'model': $extraFields .= ' products.products_model as mpn, '; break; default: $extraFields .= ' products_description.products_name as mpn, '; } } } if (OPTIONS_ENABLED_UPC == 1 && strlen(OPTIONS_UPC) == 0) { $extraFields .= ' products.products_upc as upc, '; } if (OPTIONS_ENABLED_GOOGLE_PRODUCT_CATEGORY == 1 && OPTIONS_GOOGLE_PRODUCT_CATEGORY == 'db') { $extraFields .= ' products_description.google_product_category as google_category, '; } $sql = " SELECT concat( '" . $productURL . "' ,products.products_id) AS product_url, products_model AS prodModel, manufacturers.manufacturers_id, products.products_id AS id, products_description.products_name AS name, products_description.products_description AS description, products.products_quantity AS quantity, products.products_status AS prodStatus, products.products_weight AS prodWeight, " . $extraFields . " FORMAT( IFNULL(specials.specials_new_products_price, products.products_price) * " . OPTIONS_TAX_CALC . ",2) AS price, CONCAT( '" . $imageURL . "' ,products.products_image) AS image_url, products_to_categories.categories_id AS prodCatID, categories.parent_id AS catParentID, categories_description.categories_name AS catName FROM (categories, categories_description, products, products_description, products_to_categories) left join manufacturers on ( manufacturers.manufacturers_id = products.manufacturers_id ) left join specials on ( specials.products_id = products.products_id AND ( ( (specials.expires_date > CURRENT_DATE) OR (specials.expires_date is NULL) OR (specials.expires_date = 0) ) AND ( specials.status = 1 ) ) ) WHERE products.products_id=products_description.products_id AND products.products_id=products_to_categories.products_id AND products_to_categories.categories_id=categories.categories_id AND categories.categories_id=categories_description.categories_id " . $quotes . " AND categories_description.language_id = " . DEFAULT_LANGUAGE_ID . " AND products_description.language_id = " . DEFAULT_LANGUAGE_ID . " ORDER BY products.products_id ASC "; $quotes = ''; if (QUOTES_CATEGORY_NAME !== '') { $quotes = " and categories_description.categories_name NOT LIKE '" . QUOTES_CATEGORY_NAME . "' "; } $catInfo = " SELECT categories.categories_id AS curCatID, categories.parent_id AS parentCatID, categories_description.categories_name AS catName FROM categories, categories_description WHERE categories.categories_id = categories_description.categories_id " . $quotes . " AND categories_description.language_id = " . DEFAULT_LANGUAGE_ID . ""; function findCat($curID, $catTempPar, $catTempDes, $catIndex) { if( (isset($catTempPar[$curID])) && ($catTempPar[$curID] != 0) ) { if(isset($catIndex[$catTempPar[$curID]])) { $temp=$catIndex[$catTempPar[$curID]]; } else { $catIndex = findCat($catTempPar[$curID], $catTempPar, $catTempDes, $catIndex); $temp = $catIndex[$catTempPar[$curID]]; } } if( (isset($catTempPar[$curID])) && (isset($catTempDes[$curID])) && ($catTempPar[$curID] == 0) ) { $catIndex[$curID] = $catTempDes[$curID]; } else { $catIndex[$curID] = $temp . ", " . $catTempDes[$curID]; } return $catIndex; } $catIndex = array(); $catTempDes = array(); $catTempPar = array(); $processCat = mysql_query( $catInfo )or die( $FunctionName . ": SQL error " . mysql_error() . "| catInfo = " . htmlentities($catInfo) ); while ( $catRow = mysql_fetch_object( $processCat ) ) { $catKey = $catRow->curCatID; $catName = $catRow->catName; $catParID = $catRow->parentCatID; if($catName != "") { $catTempDes[$catKey]=$catName; $catTempPar[$catKey]=$catParID; } } foreach($catTempDes as $curID=>$des) { //don't need the $des $catIndex = findCat($curID, $catTempPar, $catTempDes, $catIndex); } $_strip_search = array( "![\t ]+$|^[\t ]+!m", // remove leading/trailing space chars '%[\r\n]+%m'); // remove CRs and newlines $_strip_replace = array( '', ' '); $_cleaner_array = array(">" => "> ", "®" => "", " " => " ", "®" => "", "™" => "", "™" => "", "\t" => "", " " => "", """ => "\""); if ( file_exists( $OutFile ) ) { unlink( $OutFile ); } $output = "link\ttitle\tdescription\tprice\timage_link\tid\tavailability"; $attributesColumns = array(); //create optional section if(OPTIONS_ENABLED == 1) { if(OPTIONS_ENABLED_AGE_RANGE == 1) $output .= "\tage_range"; if(OPTIONS_ENABLED_BRAND == 1) $output .= "\tbrand"; if(OPTIONS_ENABLED_CONDITION == 1) $output .= "\tcondition"; if(OPTIONS_ENABLED_CURRENCY == 1) $output .= "\tcurrency"; if(OPTIONS_ENABLED_EXPIRATION == 1) $output .= "\texpiration_date"; if(OPTIONS_ENABLED_FEED_LANGUAGE == 1) $output .= "\tlanguage"; if(OPTIONS_ENABLED_GOOGLE_PRODUCT_CATEGORY == 1) $output .= "\tgoogle product_category"; if(OPTIONS_ENABLED_GTIN == 1) $output .= "\tgtin"; if(OPTIONS_ENABLED_ISBN == 1) $output .= "\tisbn"; if(OPTIONS_ENABLED_MADE_IN == 1) $output .= "\tmade_in"; if(OPTIONS_ENABLED_MPN == 1) $output .= "\tmpn"; if(OPTIONS_ENABLED_PRODUCT_MODEL == 1) $output .= "\tmodel"; if(OPTIONS_ENABLED_PRODUCT_TYPE == 1) $output .= "\tproduct_type"; if(OPTIONS_ENABLED_SHIPPING == 1) $output .= "\tshipping"; if(OPTIONS_ENABLED_INCLUDE_TAX == 1) $output .= "\ttax"; if(OPTIONS_ENABLED_UPC == 1) $output .= "\tupc"; if(OPTIONS_ENABLED_WEIGHT == 1) $output .= "\tweight"; if (OPTIONS_ENABLED_ATTRIBUTES == 1) { $products_options_name_query = mysql_query("select distinct popt.products_options_id, popt.products_options_name from products_options popt, products_attributes patrib where popt.language_id = '" . (int)1 . "' order by popt.products_options_name") or die(mysql_error()); while ($products_options_name = mysql_fetch_object($products_options_name_query)) { $attributesColumns[] = $products_options_name->products_options_name; $name = strtolower($products_options_name->products_options_name); $name = str_replace(" ","_", $name); $output .= "\tc:" . $name; } /* //If you want to only show particular attributes, comment out the above and uncomment this section. //Then enter two lines for each one you want to show. For example, if the atttributes you want to //show are named Color and Fabric, the entries would appear as follows: $attributesColumns[] = "Color"; $attributesColumns[] = "Fabric"; $output .= "\tc:" . strtolower("Color"); $output .= "\tc:" . strtolower("Fabric"); */ } } $output .= "\n"; $result=mysql_query( $sql )or die( $FunctionName . ": SQL error " . mysql_error() . "| sql = " . htmlentities($sql) ); //Currency Information if(CONVERT_CURRENCY) { $sql3 = " SELECT currencies.value AS curUSD FROM currencies WHERE currencies.code = '" . CURRENCY_TYPE . "'"; $result3=mysql_query( $sql3 )or die( $FunctionName . ": SQL error " . mysql_error() . "| sql3 = " . htmlentities($sql3) ); $row3 = mysql_fetch_object( $result3 ); } $loop_counter = 0; $statsArray = array(); while( $row = mysql_fetch_object( $result ) ) { if (isset($already_sent[$row->id])) continue; // if we've sent this one, skip the rest of the while loop if (OPTIONS_IGNORE_PRODUCT_PRICE > 0 && $row->price <= 0) continue; //skip products with 0 price if (OPTIONS_IGNORE_PRODUCT_ZERO > 0 && $row->quantity < 1) continue; //skip products with 0 qty if (OPTIONS_IGNORE_PRODUCT_PRICE < 1 && $row->price <= 0) $statsArray['price']++; //record for warning if (OPTIONS_IGNORE_PRODUCT_ZERO < 1 && $row->quantity < 1) $statsArray['qty']++; //record for warning $statsArray['total']++; if ( $row->prodStatus == 1 ) { if (CONVERT_CURRENCY) { $row->price = preg_replace("/[^.0-9]/", "", $row->price); $row->price = $row->price * $row3->curUSD; $row->price = number_format($row->price, 2, '.', OPTIONS_CURRENCY_THOUSANDS_POINT); } $availability = ''; switch (OPTIONS_AVAILABILITY) { case 'quantity': $availability = ($row->quantity > 0 ? 'in stock' : 'out of stock'); break; case 'status': $availability = ($row->prodStatus == 1 ? 'in stock' : 'out of stock'); break; case '': $availability = $row->availability; break; default: $availability = OPTIONS_AVAILABILITY; } $google_utm = (OPTIONS_ENABLED_GOOGLE_UTM ? OPTIONS_GOOGLE_UTM : ''); if(SEO_ENABLED=='true'){ $output .= tep_href_link($productURL,$productParam . $row->id, 'NONSSL', false) . $google_utm . "\t"; } else { $output .= $row->product_url . $google_utm . "\t"; } $output .= preg_replace($_strip_search, $_strip_replace, strip_tags( strtr($row->name, $_cleaner_array) ) ) . "\t" . preg_replace($_strip_search, $_strip_replace, strip_tags( strtr($row->description, $_cleaner_array) ) ) . "\t" . $row->price . "\t" . $row->image_url . "\t" . // $catIndex[$row->prodCatID] . "\t" . $row->id . "\t" . $availability; //optional values section if(OPTIONS_ENABLED == 1) { if(OPTIONS_ENABLED_AGE_RANGE == 1) $output .= "\t" . OPTIONS_AGE_RANGE; if(OPTIONS_ENABLED_BRAND == 1) $output .= "\t" . (isset($row->brand) ? $row->brand : (strlen(OPTIONS_BRAND) ? $row->name : "Not Supported")); if(OPTIONS_ENABLED_CONDITION == 1) $output .= "\t" . (isset($row->pcondition) ? $row->pcondition : OPTIONS_CONDITION); if(OPTIONS_ENABLED_CURRENCY == 1) $output .= "\t" . OPTIONS_CURRENCY; if(OPTIONS_ENABLED_EXPIRATION == 1) $output .= "\t" . $feed_exp_date; if(OPTIONS_ENABLED_FEED_LANGUAGE == 1) $output .= "\t" . OPTIONS_FEED_LANGUAGE; if(OPTIONS_ENABLED_GOOGLE_PRODUCT_CATEGORY == 1) $output .= "\t" . (OPTIONS_GOOGLE_PRODUCT_CATEGORY == 'db' ? $row->google_category : OPTIONS_GOOGLE_PRODUCT_CATEGORY); if(OPTIONS_ENABLED_GTIN == 1) $output .= "\t" . (isset($row->gtin) ? $row->gtin : (strlen(OPTIONS_GTIN) ? OPTIONS_GTIN : "Not Supported")); if(OPTIONS_ENABLED_ISBN == 1) $output .= "\t" . (isset($row->isbn) ? $row->isbn : (strlen(OPTIONS_ISBN) ? OPTIONS_ISBN : "Not Supported")); if(OPTIONS_ENABLED_MADE_IN == 1) $output .= "\t" . OPTIONS_MADE_IN; if(OPTIONS_ENABLED_MPN == 1) $output .= "\t" . (isset($row->mpn) ? $row->mpn : (strlen(OPTIONS_MPN) ? OPTIONS_MPN : "Not Supported")); if(OPTIONS_ENABLED_PRODUCT_MODEL == 1) $output .= "\t" . (! empty($row->prodModel) ? $row->prodModel : $row->catName); if(OPTIONS_ENABLED_PRODUCT_TYPE == 1) $output .= "\t" . ((OPTIONS_PRODUCT_TYPE == strtolower('full')) ? $catIndex[$row->prodCatID] : $row->catName); if(OPTIONS_ENABLED_SHIPPING == 1) $output .= "\t" . OPTIONS_SHIPPING_STRING; if(OPTIONS_ENABLED_INCLUDE_TAX == 1) $output .= "\t" . OPTIONS_TAX_STRING; if(OPTIONS_ENABLED_UPC == 1) $output .= "\t" . (isset($row->upc) ? $row->upc : (strlen(OPTIONS_UPC) ? OPTIONS_UPC : "Not Supported")); if(OPTIONS_ENABLED_WEIGHT == 1) $output .= "\t" . $row->prodWeight . ' ' .OPTIONS_WEIGHT_ACCEPTED_METHODS; /******************* BEGIN HANDLING THE ATTRIBUTES ********************/ if (OPTIONS_ENABLED_ATTRIBUTES == 1) { $products_attributes_query = mysql_query("select count(*) as total from products_options popt, products_attributes patrib where patrib.products_id='" . $row->id . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)1 . "'"); $products_attributes = mysql_fetch_object($products_attributes_query); if ($products_attributes->total > 0) { $products_options_name_query = mysql_query("select distinct popt.products_options_id, popt.products_options_name from products_options popt, products_attributes patrib where patrib.products_id='" . (int)$row->id . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)1 . "' order by popt.products_options_name") or die(mysql_error()); $trackTabs = ''; while ($products_options_name = mysql_fetch_object($products_options_name_query)) { $products_options_array = array(); $products_options_query = mysql_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from products_attributes pa, products_options_values pov where pa.products_id = '" . (int)$row->id . "' and pa.options_id = '" . $products_options_name->products_options_id . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)1 . "'"); while ($products_options = mysql_fetch_object($products_options_query)) { $products_options_array[] = array('id' => $products_options->products_options_values_id, 'text' => $products_options->products_options_values_name); } for ($a = 0; $a < count($attributesColumns); ++$a) { if ($products_options_name->products_options_name == $attributesColumns[$a]) { if ($a == 0) $trackTabs = "\t"; else { if (empty($trackTabs)) $trackTabs = str_repeat("\t", $a); $trackTabs .= "\t"; } $output .= $trackTabs; foreach ($products_options_array as $arr) $output .= $arr['text'] . ','; $output = substr($output, 0, -1); } } } } } /******************* END HANDLING THE ATTRIBUTES ********************/ } $output .= " \n"; } $already_sent[$row->id] = 1; $loop_counter++; if ($loop_counter>750) { $fp = fopen( $OutFile , "a" ); $fout = fwrite( $fp , $output ); fclose( $fp ); $loop_counter = 0; $output = ""; } } $fp = fopen( $OutFile , "a" ); $fout = fwrite( $fp , $output ); fclose( $fp ); echo '<p style="margin:auto; text-align:left">'; printf( "Feed contains %d products.", $statsArray['total'] ); echo '</p>'; $warning = false; if (count($statsArray['price']) > 0) { $warning = true; echo '<p style="margin:auto; text-align:left">'; printf( " ***Warning:*** There are %d products with a price of $0.", $statsArray['price'] ); echo '</p>'; } if (count($statsArray['qty']) > 0) { $warning = true; echo '<p style="margin:auto; text-align:left; padding-bottom:10px; ">'; printf( " ***Warning:*** There are %d products with a quantity of 0.", $statsArray['qty'] ); echo '</p>'; } $completed = 'File Completed' . ($warning ? ' (with warnings): ' : ':' ); echo "$completed <a href=\"../" . $OutFile . "\" target=\"_blank\">" . $destination_file . "</a><br>\n"; chmod($OutFile, 0777); //Start FTP function ftp_file( $ftpservername, $ftpusername, $ftppassword, $ftpsourcefile, $ftpdirectory, $ftpdestinationfile ) { // set up basic connection $conn_id = ftp_connect($ftpservername); if ( $conn_id == false ) { echo "FTP open connection failed to $ftpservername <BR>\n" ; return false; } // login with username and password $login_result = ftp_login($conn_id, $ftpusername, $ftppassword); // check connection if ((!$conn_id) || (!$login_result)) { echo "FTP connection has failed!<BR>\n"; echo "Attempted to connect to " . $ftpservername . " for user " . $ftpusername . "<BR>\n"; return false; } else { echo "Connected to " . $ftpservername . ", for user " . $ftpusername . "<BR>\n"; } if ( strlen( $ftpdirectory ) > 0 ) { if (ftp_chdir($conn_id, $ftpdirectory )) { echo "Current directory is now: " . ftp_pwd($conn_id) . "<BR>\n"; } else { echo "Couldn't change directory on $ftpservername<BR>\n"; return false; } } ftp_pasv ( $conn_id, true ) ; // upload the file $upload = ftp_put( $conn_id, $ftpdestinationfile, $ftpsourcefile, FTP_ASCII ); // check upload status if (!$upload) { echo "$ftpservername: FTP upload has failed!<BR>\n"; return false; } else { echo "Uploaded " . $ftpsourcefile . " to " . $ftpservername . " as " . $ftpdestinationfile . "<BR>\n"; } // close the FTP stream ftp_close($conn_id); return true; } if (FTP_ENABLED) ftp_file( "uploads.google.com", FTP_USERNAME, FTP_PASSWORD, $source_file, "", $destination_file); //End FTP // End TIMER // --------- $etimer = explode( ' ', microtime() ); $etimer = $etimer[1] + $etimer[0]; echo '<p style="margin:auto; text-align:center">'; printf( "Script timer: <b>%f</b> seconds.", ($etimer-$stimer) ); echo '</p>'; // --------- ?>
  6. lyonsperf

    Automatically send data feed to Froogle

    I did. I don't have a GTIN, brand or MPN listing in my database.
  7. lyonsperf

    Automatically send data feed to Froogle

    Got this today In reviewing the items you are submitting through the Google Merchant Center, we have found some issues with the information submitted. Because of the issues listed below, all of your items for the indicated countries are at risk of being suspended from Google Product Search. Please fix these issues within 7 days to avoid suspension of all your items. Account: Lyons Performance Account ID: xxxxxxxx Country: US Missing or Invalid Unique Product Identifiers Some or all of the items in your feed are missing unique product identifiers, such as 'MPN', 'brand' and 'GTIN'. These values are very important for matching users' queries to your products. It is required to provide unique product identifiers for most product categories.
  8. lyonsperf

    Automatically send data feed to Froogle

    Jack, I think you need to review the new guidelines for Google's feed submission. They have changed a few of the requirements and have obsoleted a few others. I got several warnings from them concerning missing required data and also some that they have no attribute for. For example: they now require an option for link, id, image link..... These are not included options in the googlefeeder file. There are also outdated options such as:ShippingWeight, made_in, ProductURL, ImageURL... The bingfeeder file is really off as it submits to google but is missing many of the required options for a google feed. I believe that Bing has their own feed submital. Anyway if you have some time you might want to look these files over. Thanks, Matt
  9. lyonsperf

    Multi_Vendor_Shipping new thread

    A couple of things. 1) I need to have a setting for Freight Collect where a truck shipped order goes cod for the shipping only. 2) Will there be an update for the changes in USPS and UPS? Any help would be most appreciated. Thanks Matt
  10. Hi Jack, As you know I love installing your mods. I have Header Tags SEO, Googlesitemaps SEO, SEO URLS,Google/Froogle Feeder and Ultimate seos 2.2d installed onmy tool site. I am having issues with Google in Merchant center and webmaster central with the sitemaps. First it was the date/time format but I went through the code and replaced all the YY-mm-dd with YYYY-MM-DDThh:mm:ss. They seem to be picking up the 301 redirects and call them errors. I also am not sure if I have configured the above mentioned mods correctly as my category pages read as http://www.protoolzonline.com/flashlights-c-54.html?osCsid=c36f6f2ed0a9d568fd677a050709f124. My product info pages read as http://www.protoolzonline.com/tools-supplies-system-diagnostic-tools-smart-gauge-system-performance-analyzer-p-114.html?cPath=52_3003&osCsid=c36f6f2ed0a9d568fd677a050709f124. These are examples from specific categories and products the code is not the same on each. Any ideas on how to fix this? Google is only listing 1 of my 5000 products in my sitemap. It won't accept sitemapcategories.xml,sitemapmanufacturers.xml and the others.
  11. Hi All, I just loaded this mod and am getting the following error: Warning: require(test/pdf/pdf_datasheet_config.php) [function.require]: failed to open stream: No such file or directory in /home/mysite/public_html/test/pdf/pdf_datasheet_functions.php on line 12 Line 12 is require('test/pdf/pdf_datasheet_config.php'); I have this new site setup inside my customers main site as a test so that we can build a new design while the old design remains functional. So the breadcrumb trail looks like:http://www.mysite.com/public_html/test/ I have tried several senarios of line 12 but continue to get the same errors. Warning: require(test/pdf/pdf_datasheet_config.php) [function.require]: failed to open stream: No such file or directory in /home/mysite/public_html/test/pdf/pdf_datasheet_functions.php on line 12 Fatal error: require() [function.require]: Failed opening required 'test/pdf/pdf_datasheet_config.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mysite/public_html/test/pdf/pdf_datasheet_functions.php on line 12 Any ideas?
  12. lyonsperf

    Get 1 Free

    Well i'm stumped. I re checked everything and its all there. I did notice that the mods txt file has changes in product_info.php with g1f. db callouts. The sql file does not have these. Could this be the issue?
  13. lyonsperf

    Get 1 Free

    Hi Jim, Here is my modified class/shopping_cart.php file. I have used winmerge to compare the two files and checked it with webuilder. No syntax errors found. I also use MVs but you wrote that so it blends fine with Get 1 Free. Please have a look and let me know what you see. I've tried everything. <?php /* $Id: shopping_cart.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ class shoppingCart { var $contents, $total, $weight, $cartID, $content_type; function shoppingCart() { $this->reset(); } function restore_contents() { global $customer_id; if (!tep_session_is_registered('customer_id')) return false; // insert current cart contents in database if (is_array($this->contents)) { reset($this->contents); while (list($products_id, ) = each($this->contents)) { $qty = $this->contents[$products_id]['qty']; $product_query = tep_db_query("select products_id from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'"); if (!tep_db_num_rows($product_query)) { tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . tep_db_input($qty) . "', '" . date('Ymd') . "')"); if (isset($this->contents[$products_id]['attributes'])) { reset($this->contents[$products_id]['attributes']); while (list($option, $value) = each($this->contents[$products_id]['attributes'])) { tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "')"); } } } else { tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . tep_db_input($qty) . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'"); } } } // reset per-session cart contents, but not the database contents $this->reset(false); $products_query = tep_db_query("select products_id, customers_basket_quantity from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "'"); while ($products = tep_db_fetch_array($products_query)) { $this->contents[$products['products_id']] = array('qty' => $products['customers_basket_quantity']); // attributes $attributes_query = tep_db_query("select products_options_id, products_options_value_id from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products['products_id']) . "'"); while ($attributes = tep_db_fetch_array($attributes_query)) { $this->contents[$products['products_id']]['attributes'][$attributes['products_options_id']] = $attributes['products_options_value_id']; } } $this->cleanup(); } function reset($reset_database = false) { global $customer_id; $this->contents = array(); $this->total = 0; $this->weight = 0; $this->content_type = false; if (tep_session_is_registered('customer_id') && ($reset_database == true)) { tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "'"); tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "'"); } unset($this->cartID); if (tep_session_is_registered('cartID')) tep_session_unregister('cartID'); } function add_cart($products_id, $qty = '1', $attributes = '', $notify = true) { global $new_products_id_in_cart, $customer_id; $products_id_string = tep_get_uprid($products_id, $attributes); $products_id = tep_get_prid($products_id_string); if (defined('MAX_QTY_IN_CART') && (MAX_QTY_IN_CART > 0) && ((int)$qty > MAX_QTY_IN_CART)) { $qty = MAX_QTY_IN_CART; } $attributes_pass_check = true; if (is_array($attributes)) { reset($attributes); while (list($option, $value) = each($attributes)) { if (!is_numeric($option) || !is_numeric($value)) { $attributes_pass_check = false; break; } } } if (is_numeric($products_id) && is_numeric($qty) && ($attributes_pass_check == true)) { $check_product_query = tep_db_query("select products_status from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'"); $check_product = tep_db_fetch_array($check_product_query); if (($check_product !== false) && ($check_product['products_status'] == '1')) { if ($notify == true) { $new_products_id_in_cart = $products_id; tep_session_register('new_products_id_in_cart'); } if ($this->in_cart($products_id_string)) { $this->update_quantity($products_id_string, $qty, $attributes); } else { $this->contents[$products_id_string] = array('qty' => (int)$qty); // insert into database if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id_string) . "', '" . (int)$qty . "', '" . date('Ymd') . "')"); if (is_array($attributes)) { reset($attributes); while (list($option, $value) = each($attributes)) { $this->contents[$products_id_string]['attributes'][$option] = $value; // insert into database if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id_string) . "', '" . (int)$option . "', '" . (int)$value . "')"); } } } $this->cleanup(); // assign a temporary unique ID to the order contents to prevent hack attempts during the checkout procedure $this->cartID = $this->generate_cart_id(); } } } function update_quantity($products_id, $quantity = '', $attributes = '') { global $customer_id; $products_id_string = tep_get_uprid($products_id, $attributes); $products_id = tep_get_prid($products_id_string); if (defined('MAX_QTY_IN_CART') && (MAX_QTY_IN_CART > 0) && ((int)$quantity > MAX_QTY_IN_CART)) { $quantity = MAX_QTY_IN_CART; } $attributes_pass_check = true; if (is_array($attributes)) { reset($attributes); while (list($option, $value) = each($attributes)) { if (!is_numeric($option) || !is_numeric($value)) { $attributes_pass_check = false; break; } } } if (is_numeric($products_id) && isset($this->contents[$products_id_string]) && is_numeric($quantity) && ($attributes_pass_check == true)) { $this->contents[$products_id_string] = array('qty' => (int)$quantity); // update database if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . (int)$quantity . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id_string) . "'"); if (is_array($attributes)) { reset($attributes); while (list($option, $value) = each($attributes)) { $this->contents[$products_id_string]['attributes'][$option] = $value; // update database if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " set products_options_value_id = '" . (int)$value . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id_string) . "' and products_options_id = '" . (int)$option . "'"); } } } } function cleanup() { global $customer_id; reset($this->contents); while (list($key,) = each($this->contents)) { if ($this->contents[$key]['qty'] < 1) { unset($this->contents[$key]); // remove from database if (tep_session_is_registered('customer_id')) { tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($key) . "'"); tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($key) . "'"); } } } } function count_contents() { // get total number of items in cart $total_items = 0; if (is_array($this->contents)) { reset($this->contents); while (list($products_id, ) = each($this->contents)) { $total_items += $this->get_quantity($products_id); // Get 1 free // If this product qualifies for free product(s) add in the number of free products if (is_array ($free_product = $this->get1free ($products_id))) { $total_items += $free_product['quantity']; } // end Get 1 free } } return $total_items; } function get_quantity($products_id) { if (isset($this->contents[$products_id])) { return $this->contents[$products_id]['qty']; } else { return 0; } } function in_cart($products_id) { if (isset($this->contents[$products_id])) { return true; } else { return false; } } function remove($products_id) { global $customer_id; unset($this->contents[$products_id]); // remove from database if (tep_session_is_registered('customer_id')) { tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'"); tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'"); } // Get 1 free // If this product qualifies for free product(s) remove the free products if (is_array ($free_product = $this->get1free ($products_id))) { $pid = (int)$free_product['id']; unset($this->contents[$pid]); // remove from database if (tep_session_is_registered('customer_id')) { tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($pid) . "'"); tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($pid) . "'"); } } // end Get 1 free // assign a temporary unique ID to the order contents to prevent hack attempts during the checkout procedure $this->cartID = $this->generate_cart_id(); return $debug; } function remove_all() { $this->reset(); } function get_product_id_list() { $product_id_list = ''; if (is_array($this->contents)) { reset($this->contents); while (list($products_id, ) = each($this->contents)) { $product_id_list .= ', ' . $products_id; } } return substr($product_id_list, 2); } function calculate() { global $currencies; $this->total = 0; $this->weight = 0; if (!is_array($this->contents)) return 0; reset($this->contents); while (list($products_id, ) = each($this->contents)) { $qty = $this->contents[$products_id]['qty']; // products price $product_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_weight from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'"); if ($product = tep_db_fetch_array($product_query)) { $prid = $product['products_id']; $products_tax = tep_get_tax_rate($product['products_tax_class_id']); $products_price = $product['products_price']; $products_weight = $product['products_weight']; $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'"); if (tep_db_num_rows ($specials_query)) { $specials = tep_db_fetch_array($specials_query); $products_price = $specials['specials_new_products_price']; } $this->total += $currencies->calculate_price($products_price, $products_tax, $qty); $this->weight += ($qty * $products_weight); // Get 1 free // If this product qualifies for free product(s) add in the total weight of free products if (is_array ($free_product = $this->get1free ($products_id))) { $this->weight += $free_product['quantity'] * $free_product['weight']; } // end Get 1 free } // attributes price if (isset($this->contents[$products_id]['attributes'])) { reset($this->contents[$products_id]['attributes']); while (list($option, $value) = each($this->contents[$products_id]['attributes'])) { $attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$prid . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'"); $attribute_price = tep_db_fetch_array($attribute_price_query); if ($attribute_price['price_prefix'] == '+') { $this->total += $currencies->calculate_price($attribute_price['options_values_price'], $products_tax, $qty); } else { $this->total -= $currencies->calculate_price($attribute_price['options_values_price'], $products_tax, $qty); } } } } } ////// //MVS Start // New method to provide cost, weight, quantity, and product IDs by vendor ////// //Output array structure (example): //shoppingcart Object //( // [vendor_shipping] => array // ( // [0] => array //Number is the vendor_id // ( // [weight] => 22.59 // [cost] => 12.95 // [qty] => 2 // [products_id] => array // ( // [0] => 12 // [1] => 47 // ) // ) // [12] => array // ( // [weight] => 32.74 // [cost] => 109.59 // [qty] => 5 // [products_id] => array // ( // [0] => 2 // [1] => 3 // [2] => 37 // [3] => 49 // ) // ) // ) //) function vendor_shipping() { if (!is_array($this->contents)) return 0; //Cart is empty $this->vendor_shipping = array(); //Initialize the output array reset($this->contents); // and reset the input array foreach ($this->contents as $products_id => $value) { //$value is never used $quantity = $this->contents[$products_id]['qty']; //mod IndvShip, added products_ship_price $products_query = tep_db_query("select products_id, products_price, products_ship_price, products_tax_class_id, products_weight, vendors_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'" ); if ($products = tep_db_fetch_array($products_query)) { $products_price = $products['products_price']; //mod IndvShip $products_ship_price = $products['products_ship_price']; $products_weight = $products['products_weight']; $vendors_id = ($products['vendors_id'] <= 0) ? 1 : $products['vendors_id']; $products_tax = tep_get_tax_rate($products['products_tax_class_id']); //Find special prices (if any) $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$products_id . "' and status = '1'" ); if (tep_db_num_rows ($specials_query)) { $specials = tep_db_fetch_array($specials_query); $products_price = $specials['specials_new_products_price']; } //Add values to the output array $this->vendor_shipping[$vendors_id]['weight'] += ($quantity * $products_weight); $this->vendor_shipping[$vendors_id]['cost'] += tep_add_tax($products_price, $products_tax) * $quantity; $this->vendor_shipping[$vendors_id]['qty'] += $quantity; //mod IndvShip $this->vendor_shipping[$vendors_id]['ship_cost'] += ($quantity * $products_ship_price); $this->vendor_shipping[$vendors_id]['products_id'][] = $products_id; //There can be more than one product } // Add/subtract attributes prices (if any) if (isset($this->contents[$products_id]['attributes'])) { reset($this->contents[$products_id]['attributes']); foreach ($this->contents[$products_id]['attributes'] as $option => $value) { $attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'"); $attribute_price = tep_db_fetch_array($attribute_price_query); if ($attribute_price['price_prefix'] == '+') { $this->vendor_shipping[$vendors_id]['cost'] += $quantity * tep_add_tax($attribute_price['options_values_price'], $products_tax); } else { $this->vendor_shipping[$vendors_id]['cost'] -= $quantity * tep_add_tax($attribute_price['options_values_price'], $products_tax); } } } } return $this->vendor_shipping; } //MVS End function attributes_price($products_id) { $attributes_price = 0; if (isset($this->contents[$products_id]['attributes'])) { reset($this->contents[$products_id]['attributes']); while (list($option, $value) = each($this->contents[$products_id]['attributes'])) { $attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'"); $attribute_price = tep_db_fetch_array($attribute_price_query); if ($attribute_price['price_prefix'] == '+') { $attributes_price += $attribute_price['options_values_price']; } else { $attributes_price -= $attribute_price['options_values_price']; } } } return $attributes_price; } //MVS - added function to only retrieve specific vendors products function get_vendors_products($vendor) { global $languages_id; if (!is_array($this->contents)) return false; $products_array = array(); reset($this->contents); while (list($products_id, ) = each($this->contents)) { $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_length, p.products_width, p.products_height, p.products_ready_to_ship, p.products_tax_class_id, v.vendors_id, v.vendors_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_VENDORS . " v where p.products_id = '" . (int)$products_id . "' and pd.products_id = p.products_id and v.vendors_id = '" . $vendor . "' and p.vendors_id = '" . $vendor . "' and pd.language_id = '" . (int)$languages_id . "'"); //upsxml dimensions end //MVS end if ($products = tep_db_fetch_array($products_query)) { $prid = $products['products_id']; $products_price = $products['products_price']; $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'"); if (tep_db_num_rows($specials_query)) { $specials = tep_db_fetch_array($specials_query); $products_price = $specials['specials_new_products_price']; } $products_array[] = array('id' => $products_id, 'name' => $products['products_name'], 'qproduct' => '', 'model' => $products['products_model'], 'image' => $products['products_image'], 'price' => $products_price, 'quantity' => $this->contents[$products_id]['qty'], 'weight' => $products['products_weight'], //upsxml dimensions start 'length' => ($products['product_free_shipping'] == '1' ? 0 : $products['products_length']), 'width' => ($products['product_free_shipping'] == '1' ? 0 : $products['products_width']), 'height' => ($products['product_free_shipping'] == '1' ? 0 : $products['products_height']), 'ready_to_ship' => $products['products_ready_to_ship'], //upsxml dimensions end 'final_price' => ($products_price + $this->attributes_price($products_id)), 'tax_class_id' => $products['products_tax_class_id'], //MVS start 'vendors_id' => $products['vendors_id'], 'vendors_name' => $products['vendors_name'], //MVS end 'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : '')); // Get 1 free if (is_array ($free_product = $this->get1free ($products_id))) { // Add the free product to the shopping cart (Customer cannot alter this) $products_array[] = array('id' => $free_product['id'], 'name' => $free_product['name'], 'qproduct' => '<br><span class="stockWarning">Free with <b>' . $products['products_name'] . '</b> purchase</span>', 'model' => $free_product['model'], 'image' => $free_product['image'], 'price' => 0, 'quantity' => $free_product['quantity'], 'weight' => $free_product['weight'], 'final_price' => 0, 'tax_class_id' => $products['products_tax_class_id'], 'attributes' => '', 'free' => 1 ); } //if (is_array // end Get 1 free } } return $products_array; } //MVS - upsxml end function get_products() { global $languages_id; if (!is_array($this->contents)) return false; $products_array = array(); reset($this->contents); while (list($products_id, ) = each($this->contents)) { //MVS //upsxml dimensions - added p.products_length, p.products_width, p.products_height, p.products_ready_to_ship, $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_length, p.products_width, p.products_height, p.products_ready_to_ship, p.products_tax_class_id, v.vendors_id, v.vendors_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_VENDORS . " v where p.products_id = '" . (int)$products_id . "' and pd.products_id = p.products_id and v.vendors_id = p.vendors_id and pd.language_id = '" . (int)$languages_id . "'"); if ($products = tep_db_fetch_array($products_query)) { $prid = $products['products_id']; $products_price = $products['products_price']; $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'"); if (tep_db_num_rows($specials_query)) { $specials = tep_db_fetch_array($specials_query); $products_price = $specials['specials_new_products_price']; } $products_array[] = array('id' => $products_id, 'name' => $products['products_name'], 'model' => $products['products_model'], 'image' => $products['products_image'], 'price' => $products_price, 'quantity' => $this->contents[$products_id]['qty'], 'weight' => $products['products_weight'], //upsxml dimensions start 'length' => ($products['product_free_shipping'] == '1' ? 0 : $products['products_length']), 'width' => ($products['product_free_shipping'] == '1' ? 0 : $products['products_width']), 'height' => ($products['product_free_shipping'] == '1' ? 0 : $products['products_height']), //uspxml dimensions end 'ready_to_ship' => $products['products_ready_to_ship'], 'final_price' => ($products_price + $this->attributes_price($products_id)), 'tax_class_id' => $products['products_tax_class_id'], //MVS start 'vendors_id' => $products['vendors_id'], 'vendors_name' => $products['vendors_name'], //MVS end 'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : '')); } } return $products_array; } function show_total() { $this->calculate(); return $this->total; } function show_weight() { $this->calculate(); return $this->weight; } function generate_cart_id($length = 5) { return tep_create_random_value($length, 'digits'); } function get_content_type() { $this->content_type = false; if ( (DOWNLOAD_ENABLED == 'true') && ($this->count_contents() > 0) ) { reset($this->contents); while (list($products_id, ) = each($this->contents)) { if (isset($this->contents[$products_id]['attributes'])) { reset($this->contents[$products_id]['attributes']); while (list(, $value) = each($this->contents[$products_id]['attributes'])) { $virtual_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad where pa.products_id = '" . (int)$products_id . "' and pa.options_values_id = '" . (int)$value . "' and pa.products_attributes_id = pad.products_attributes_id"); $virtual_check = tep_db_fetch_array($virtual_check_query); if ($virtual_check['total'] > 0) { switch ($this->content_type) { case 'physical': $this->content_type = 'mixed'; return $this->content_type; break; default: $this->content_type = 'virtual'; break; } } else { switch ($this->content_type) { case 'virtual': $this->content_type = 'mixed'; return $this->content_type; break; default: $this->content_type = 'physical'; break; } } } } else { switch ($this->content_type) { case 'virtual': $this->content_type = 'mixed'; return $this->content_type; break; default: $this->content_type = 'physical'; break; } } } } else { $this->content_type = 'physical'; } return $this->content_type; } function unserialize($broken) { for(reset($broken);$kv=each($broken);) { $key=$kv['key']; if (gettype($this->$key)!="user function") $this->$key=$kv['value']; } } // start Get 1 Free function get1free ($products_id) { global $languages_id; $get_1_free_query = tep_db_query("select products_free_id, products_free_quantity, products_qualify_quantity, products_multiple, get_1_free_expires_date from " . TABLE_GET_1_FREE . " where products_id = '" . (int)$products_id . "' and status = '1'"); if (tep_db_num_rows($get_1_free_query) > 0) { $get_1_free = tep_db_fetch_array($get_1_free_query); //Check that the offer has not expired //MNK bugfix 13.08.2007 if (($get_1_free['get_1_free_expires_date'] <= date('Y-m-d H:i:s')) && ($get_1_free['get_1_free_expires_date'] != '0000-00-00 00:00:00')) { //offer has expired, so update the database and return false tep_db_query("update " . TABLE_GET_1_FREE . " set status = '0', date_status_change = now() where products_id = '" . (int)$products_id . "'"); return false; } else { // Offer is valid, so check if the quantity qualifies $products_quantity = $this->contents[$products_id]['qty']; if ($products_quantity >= $get_1_free['products_qualify_quantity']) { // Qualifies, so get the quantity of free products $free_quantity = 1; if ($get_1_free['products_multiple'] > 1) { //BOF fischo bugfix 10.04.2009 //$free_quantity = floor ($products_quantity / $get_1_free['products_qualify_quantity']); $free_quantity = floor ($products_quantity / $get_1_free['products_qualify_quantity']) * $get_1_free['products_free_quantity']; //EOF fischo bugfix 10.04.2009 if ($free_quantity > $get_1_free['products_multiple']) { $free_quantity = $get_1_free['products_multiple']; } } // Get the info on the free product $products_free_query = tep_db_query("select pd.products_name, p.products_model,p.products_image,p.products_weight from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$get_1_free['products_free_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $products_free = tep_db_fetch_array($products_free_query); // Return an array of free product values $output = array ( 'id' => $get_1_free['products_free_id'], 'quantity' => $free_quantity, 'name' => $products_free['products_name'], 'model' => $products_free['products_model'], 'image' => $products_free['products_image'], 'weight' => $products_free['products_weight']); return $output; } //if ($products_quantity } //else }//if (tep_db_num_rows // offer was not valid (disabled or expired) return false; }//function // end Get 1 Free // get_products_for_packaging is a special function for split product support in the class packing // assumes that you have added the sql for upsxml, which adds the table products_split function get_products_for_packaging() { if (!is_array($this->contents)) return false; $products_array = array(); // get the list of product information $products = $this->get_products(); // cycle through list foreach ($products as $product) { $split_query = tep_db_query("select * from " . TABLE_PRODUCTS_SPLIT . " where products_id = " . (int)$product['id']); // is this a split product? if (tep_db_num_rows($split_query) > 0) { // save the total prices of the split product $product_price = $product['price']; $product_final_price = $product['final_price']; while ($split_info = tep_db_fetch_array($split_query)) { // for each piece of the product replace only the information that is unique to the piece // other information from the product will remain unchanged $product['weight'] = $split_info['products_weight']; $product['length'] = $split_info['products_length']; $product['width'] = $split_info['products_width']; $product['height'] = $split_info['products_height']; $product['ready_to_ship'] = $split_info['products_ready_to_ship']; $product['price'] = round(($split_info['value_fraction'] * $product_price), 4); $product['final_price'] = round(($split_info['value_fraction'] * $product_final_price), 4); // save the updated product piece $products_array[] = $product; } // end while } else { // not a split product, save it directly $products_array[] = $product; } } // end foreach return $products_array; } } ?>
  14. lyonsperf

    Get 1 Free

    I have spent he last two days trying to get this to work. I have the admin side working and the message on the product info page but the free product does not show up in the cart. I have added the extra get 1 free mods and have been through the forum and the extra changes to this contribution. Can anyone help? I am using rc2.2a with php 5.
  15. lyonsperf

    Cool Flash Carousel Menu

    Nobody else is using this mod?
  16. lyonsperf

    Cool Flash Carousel Menu

    Does anyone have the install instructions for this? I want to add it to my site but the creator didn't hard code the directions. He had a link to his site but it is dead.
  17. lyonsperf

    upsxml installing help

    Are you using a template for OSC? That code is not normal OSC code.
  18. lyonsperf

    Header Tags SEO

    Hi Jack, I got a wierd issue. The category tags I add in the admin disappear over night! Any idea what would make them reset and default to the category title name in each field?
  19. lyonsperf

    upsxml installing help

    You need to go back through the files you modified and check the additions. The first warning is a missing bracket or a line that was mixed with the previous line. The second warning means that the info you added was previously added somewhere else. Re-read the instructions and start again. You also need to post more of your module file for us to help. I would post the complete file text. Matt
  20. lyonsperf

    Multi_Vendor_Shipping new thread

    ok, after a good nights sleep I tackled the free shipping issue head on. What I ended up doing is changing whereever it says "MODULE_SHIPPING_FREEAMOUNT..." I changed it to "MODULE_VENDORS_SHIPPING_FREEAMOUNT...". The ... is the rest of the line which didn't change. This was a very labor intensive issue as there are multiple files that require the changes. If I have some free time I will put together a mod for it.
  21. lyonsperf

    Multi_Vendor_Shipping new thread

    Hi again, I installed the free shipping with minimum amount, using the modded files from the MVS contribution. The free shipping choice appears in checkout_shipping but there is no way to select it. If you click continue it brings you back to the same shipping page with the error"please select a shipping option". I ran winmerge on all the files and don't see an error. Any thoughts?
  22. lyonsperf

    Multi_Vendor_Shipping new thread

    Hi Jim, Any chance of getting updates for the USPS and UPS modules? My pricing is usually off by a dollar or so on both. Thanks, Matt
  23. lyonsperf

    Header Tags SEO

    Then what does this do? Fill keywords for all added pages from derived keywords on actual pages?
  24. lyonsperf

    Header Tags SEO

    Hi Jack, I tried using the filltags for my keywords and I clicked the option to use the product description to source the keywords. Now, the only thing in the keyword box on each product page is the product title. Shouldn't this pull individual words from the description? Thanks, Matt
  25. lyonsperf

    CONTRIBUTION Product Quick Edit

    Is there really only three files in this download? I read the instructions but the admin page shows nothing that can be edited. It lists the products fine but you can't edit them. Is there a missing sql mod and stylesheet?
×