## ## xs:booster v1.041 for GambioGX. ## Copyright (c) 2008-2009 xs:booster Ltd. ## http://www.xsbooster.com ## ## Licensed under GNU/GPL ## Upgrade Guide for xs:booster Upgradig from version 1.03x or 1.04 to 1.041 (regards ONLY GambioGX with pre-installed xs:booster) -------------------------------------------------------------------------------- xs:booster files: Please replace ALL xs:booster files (Please use the upgrade package for GambioGX) -------------------------------------------------------------------------------- Xt:Commerce shop files affected: (all file paths relating to the main shop directory) includes/classes/xtcPrice.php create_account.php create_guest_account.php admin/categories.php includes/modules/product_info.php includes/classes/shopping_cart.php gm/classes/GMAttributesCalculator.php Please modify the files as follows: ================================================================ ================ includes/classes/xtcPrice.php ================ ================================================================ ---- Position: starting at line 197 -- Replace -- function xtcCheckXTBAuction($pID) { if(($pos=strpos($pID,"{"))) $pID = substr($pID,0,$pos); if($_SESSION['xtb0']['tx']['products_id']==$pID&&$_SESSION['xtb0']['tx']['XTB_QUANTITYPURCHASED']) { $this->actualCurr=$_SESSION['xtb0']['tx']['XTB_AMOUNTPAID_CURRENCY']; return round($_SESSION['xtb0']['tx']['XTB_AMOUNTPAID'], $this->currencies[$this->actualCurr]['decimal_places']); } return false; } -- by -- // xs:booster start (v1.041) function xtcCheckXTBAuction($pID) { if(($pos=strpos($pID,"{"))) $pID=substr($pID,0,$pos); if(!is_array($_SESSION['xtb0']['tx'])) return false; foreach($_SESSION['xtb0']['tx'] as $tx) { if($tx['products_id']==$pID&&$tx['XTB_QUANTITYPURCHASED']!=0) { $this->actualCurr=$tx['XTB_AMOUNTPAID_CURRENCY']; return round($tx['XTB_AMOUNTPAID'], $this->currencies[$this->actualCurr]['decimal_places']); } } return false; } // xs:booster end ================================================================ =================== create_account.php =================== and ================ create_guest_account.php ================ ================================================================ ---- Position: starting at line 442 resp. 366 -- Replace -- // xs:booster prefill if(@isset($_SESSION['xtb0']['tx'])) { $GLOBALS['gender']= 'm'; $GLOBALS['firstname']= substr($_SESSION['xtb0']['tx']['XTB_EBAY_NAME'],0,strpos($_SESSION['xtb0']['tx']['XTB_EBAY_NAME']," ")); $GLOBALS['lastname']= substr($_SESSION['xtb0']['tx']['XTB_EBAY_NAME'],strpos($_SESSION['xtb0']['tx']['XTB_EBAY_NAME']," ")+1,strlen($_SESSION['xtb0']['tx']['XTB_EBAY_NAME'])); $GLOBALS['street_address']= $_SESSION['xtb0']['tx']['XTB_EBAY_STREET']; $GLOBALS['postcode']= $_SESSION['xtb0']['tx']['XTB_EBAY_POSTALCODE']; $GLOBALS['city']= $_SESSION['xtb0']['tx']['XTB_EBAY_CITY']; $GLOBALS['country']= $_SESSION['xtb0']['tx']['XTB_EBAY_COUNTRYNAME']; $GLOBALS['email_address']= $_SESSION['xtb0']['tx']['XTB_EBAY_EMAIL']; $GLOBALS['telephone']= $_SESSION['xtb0']['tx']['XTB_EBAY_PHONE']; } // xs:booster prefill end -- by -- // xs:booster start (v1.041) if(@isset($_SESSION['xtb0']['tx'][0])) { $GLOBALS['gender']= 'm'; $GLOBALS['firstname']= substr($_SESSION['xtb0']['tx'][0]['XTB_EBAY_NAME'],0,strpos($_SESSION['xtb0']['tx'][0]['XTB_EBAY_NAME']," ")); $GLOBALS['lastname']= substr($_SESSION['xtb0']['tx'][0]['XTB_EBAY_NAME'],strpos($_SESSION['xtb0']['tx'][0]['XTB_EBAY_NAME']," ")+1,strlen($_SESSION['xtb0']['tx'][0]['XTB_EBAY_NAME'])); $GLOBALS['street_address']= $_SESSION['xtb0']['tx'][0]['XTB_EBAY_STREET']; $GLOBALS['postcode']= $_SESSION['xtb0']['tx'][0]['XTB_EBAY_POSTALCODE']; $GLOBALS['city']= $_SESSION['xtb0']['tx'][0]['XTB_EBAY_CITY']; $GLOBALS['country']= $_SESSION['xtb0']['tx'][0]['XTB_EBAY_COUNTRYNAME']; $GLOBALS['email_address']= $_SESSION['xtb0']['tx'][0]['XTB_EBAY_EMAIL']; $GLOBALS['telephone']= $_SESSION['xtb0']['tx'][0]['XTB_EBAY_PHONE']; } // xs:booster end ================================================================ ================ admin/categories.php ================ ================================================================ ---- Position: starting at line 172 -- Replace -- // --- MULTI XTBOOST --- if (isset ($_POST['multi_xtb'])) { $_SESSION['xtb1']['multi_xtb']=array(); if (is_array($_POST['multi_products'])) $_SESSION['xtb1']['multi_xtb']=$_POST['multi_products']; if (is_array($_POST['multi_categories'])) { foreach ($_POST['multi_categories'] AS $category_id) { $q = xtc_db_query("select p.products_id from ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c where p.products_id = p2c.products_id and p.products_status = '1' and p2c.categories_id = '".$category_id."'"); while($p = xtc_db_fetch_array($q)) $_SESSION['xtb1']['multi_xtb'][] = $p['products_id']; } } header("Location: xtbooster.php?xtb_module=add&mode=multi_xtb"); exit; } // --- MULTI XTBOOST ENDS --- -- by -- // xs:booster start - multiauktion (v1.041) if (isset($_POST['multi_xtb'])) { $_SESSION['xtb1']['multi_xtb']=array(); require_once("../".DIR_WS_CLASSES.'xtbooster.php'); $xtb = new xtbooster_base; $xtb->config(); $requestx = "ACTION:TradeTemplateFetch"; $resx = $xtb->parse($xtb->exec($requestx)); $MULTI_REVERSECATS = $resx['MULTI_REVERSECATS']; $MULTI_ONLYONSTOCK = $resx['MULTI_ONLYONSTOCK']; if (is_array($_POST['multi_products'])) { $x=$_POST['multi_products']; foreach($x as $products_id) { $q = xtc_db_query("select products_quantity from ".TABLE_PRODUCTS." where products_id = '".$products_id."'"); $p = xtc_db_fetch_array($q); if($MULTI_ONLYONSTOCK=='true'&&$p['products_quantity']<1) continue; $_SESSION['xtb1']['multi_xtb'][]=$products_id; } } if (is_array($_POST['multi_categories'])) { $_xtb_max_p = 10000; function _xtb_reverse($category_id=0) { global $_xtb_max_p,$MULTI_ONLYONSTOCK; $cp = xtc_db_query("select * from ".TABLE_CATEGORIES." where parent_id = '".$category_id."'"); while($c=xtc_db_fetch_array($cp)) { $q = xtc_db_query("select p.products_id, p.products_quantity from ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c where p.products_id = p2c.products_id and p.products_status = '1' and p2c.categories_id = '".$c['categories_id']."'"); while($p = xtc_db_fetch_array($q)) { if($MULTI_ONLYONSTOCK=='true'&&$p['products_quantity']<1) continue; $_SESSION['xtb1']['multi_xtb'][$p['products_id']] = $p['products_id']; } if($_xtb_max_p--<0) break; _xtb_reverse($c['categories_id']); } } foreach ($_POST['multi_categories'] AS $i=>$category_id) { $q = xtc_db_query("select p.products_id, p.products_quantity from ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c where p.products_id = p2c.products_id and p.products_status = '1' and p2c.categories_id = '".$category_id."'"); while($p = xtc_db_fetch_array($q)) { if($MULTI_ONLYONSTOCK=='true'&&$p['products_quantity']<1) continue; $_SESSION['xtb1']['multi_xtb'][$p['products_id']] = $p['products_id']; } if($MULTI_REVERSECATS=='true') _xtb_reverse($category_id); } } header("Location: xtbooster.php?xtb_module=add&mode=multi_xtb"); exit; } // xs:booster end - multiauktion (v1.041) =================================================================== ================ includes/modules/product_info.php ================ =================================================================== ---- Position: starting at line 45 Einfügen: // xs:booster start (v1.041) $xsb_tx = array(); if(@is_array($_SESSION['xtb0']['tx'])) { foreach($_SESSION['xtb0']['tx'] as $tx) { if($tx['products_id']==$product->data['products_id']) { $xsb_tx = $tx; break; } } } // xs:booster end ---- Position: starting at line 80 -- Replace -- if(@$_SESSION['xtb0']['tx']['XTB_ALLOW_USER_CHQTY']=='true'||$_SESSION['xtb0']['tx']['products_id']!=$product->data['products_id']) -- by -- if(@$xsb_tx['XTB_ALLOW_USER_CHQTY']=='true'||$xsb_tx['products_id']!=$product->data['products_id']) ---- Position: starting at line 95 -- Replace -- if(@$_SESSION['xtb0']['tx']['XTB_ALLOW_USER_CHQTY']=='true'||$_SESSION['xtb0']['tx']['products_id']!=$product->data['products_id']) -- by -- if(@$xsb_tx['XTB_ALLOW_USER_CHQTY']=='true'||$xsb_tx['products_id']!=$product->data['products_id']) ---- Position: starting at line 164 -- Replace -- if(isset($_SESSION['xtb0']['tx']['XTB_REDIRECT_USER_TO'])&&$_SESSION['xtb0']['tx']['products_id']==$product->data['products_id']) $info_smarty->assign('XTB_REDIRECT_USER_TO', $_SESSION['xtb0']['tx']['XTB_REDIRECT_USER_TO']); -- by -- if(isset($xsb_tx['XTB_REDIRECT_USER_TO'])&&$xsb_tx['products_id']==$product->data['products_id']) $info_smarty->assign('XTB_REDIRECT_USER_TO', $xsb_tx['XTB_REDIRECT_USER_TO']); ==================================================================== ================ includes/classes/shopping_cart.php ================ ==================================================================== ---- Position: starting at line 153 -- Replace -- if(strpos($products_id,"{")>0) $pid = substr($products_id, 0, strpos($products_id,"{")); else $pid = $products_id; if(@$_SESSION['xtb0']['tx']['XTB_ALLOW_USER_CHQTY']=='false'&&$_SESSION['xtb0']['tx']['products_id']==$pid) return true; // xs:booster transaction doesn't allow quantity updates.. -- by -- // xs:booster start (v1.041) $pid=strpos($products_id,"{")>0?substr($products_id,0,strpos($products_id,"{")):$products_id; if(is_array($_SESSION['xtb0']['tx'])) { $sum = 0; $cc = true; foreach($_SESSION['xtb0']['tx'] as $tx) { if($tx['products_id']==$pid) { $sum += $tx['XTB_QUANTITYPURCHASED']; if($tx['XTB_ALLOW_USER_CHQTY']=='false') $cc=false; } } if($quantity!=$sum&&$cc==false) $quantity=$sum; } // xs:booster end ================================================================ ============ gm/classes/GMAttributesCalculator.php ============ ================================================================ ---- Position: starting at line 53 -- Replace -- // check specialprice if ($sPrice = $xtPrice->xtcCheckSpecial($this->products_id)){ -- by -- // check eBay price if ($sPrice = $xtPrice->xtcCheckXTBAuction($this->products_id)){ $pPrice = $xtPrice->xtcFormat($sPrice + $this->attributes_price(), $format, 0, $curr, $vpeStatus, $this->products_id); } // check specialprice elseif ($sPrice = $xtPrice->xtcCheckSpecial($this->products_id)){ -------------------------------------------------------------------------------- Database extensions: If your old xs:booster version was 1.033 or newer, no database modifications. If your xs:booster was older than 1.033: Please login to an administration panel of your database (like phpMyAdmin - ask your web space provider, when in doubt) and enter the following database commands: ALTER TABLE `xtb_transactions` CHANGE `XTB_REDIRECT_USER_TO` `XTB_REDIRECT_USER_TO` ENUM( 'basket', 'product', 'create_guest_account', 'create_account' ) NOT NULL DEFAULT 'basket'; ALTER TABLE `xtb_auctions` ADD `_EBAY_MARKETPLACE` CHAR(2) NOT NULL DEFAULT 'DE' AFTER `_EBAY_QUANTITY_BUYED`; ## ## END OF THE GUIDE ## ## xt:booster Ltd. ## http://www.xsbooster.com ## http://blog.xsbooster.com ##