Permalink
Browse files

3.0.5

  • Loading branch information...
1 parent 65c526b commit 4ab5fec4455353a13fe16fbfdf6c975faf95c340 Kris Thom White committed Oct 2, 2013
View
@@ -6,7 +6,7 @@
if(!file_exists($config))
{
- header("Location: install.php");
+ die("Web Store is not installed");
exit;
}
@@ -49,24 +49,16 @@ class Controller extends CController
public $gridProductsRows;
public $custom_page_content;
+
/**
* Load anything we need globally, such as items we're going to use in our main.php template.
* If you create init() in any other controller, you need to run parent::init() too or this
* will be skipped.
*/
- public function init() {
+ public function init()
+ {
- if (Yii::app()->params['STORE_OFFLINE']>0 || Yii::app()->params['INSTALLED'] != '1')
- {
- if (isset($_GET['offline']))
- Yii::app()->session['STORE_OFFLINE'] = _xls_number_only($_GET['offline']);
-
- if (Yii::app()->session['STORE_OFFLINE'] != Yii::app()->params['STORE_OFFLINE'] || Yii::app()->params['INSTALLED'] != '1')
- {
- $this->render('/site/offline');
- Yii::app()->end();
- }
- }
+ Yii::app()->setViewPath(Yii::getPathOfAlias('application')."/views-cities");
$this->logoutUrl = $this->createUrl("site/logout");
@@ -93,6 +85,26 @@ public function init() {
die("you have no theme set");
}
+
+ if (Yii::app()->params['STORE_OFFLINE']>0 || Yii::app()->params['INSTALLED'] != '1')
+ {
+ if (isset($_GET['offline']))
+ Yii::app()->session['STORE_OFFLINE'] = _xls_number_only($_GET['offline']);
+
+ if (Yii::app()->session['STORE_OFFLINE'] != Yii::app()->params['STORE_OFFLINE'] || Yii::app()->params['INSTALLED'] != '1')
+ {
+ $this->render('/site/offline');
+ Yii::app()->end();
+ }
+ }
+
+ $this->logoutUrl = $this->createUrl("site/logout");
+
+ $strViewset = "cities";
+ if(!empty($strViewset)) Yii::app()->setViewPath(Yii::getPathOfAlias('application')."/views-".$strViewset);
+
+
+
if ( Yii::app()->theme && file_exists('webroot.themes.'.Yii::app()->theme->name.'.layouts.column2'))
$this->layout='webroot.themes.'.Yii::app()->theme->name.'.layouts.column2';
@@ -108,13 +120,14 @@ public function init() {
$this->getUserLanguage();
$this->pageTitle =
- Yii::app()->name = _xls_get_conf('STORE_NAME', 'LightSpeed Web Store');
+ Yii::app()->name = _xls_get_conf('STORE_NAME', 'LightSpeed Web Store')." : ".
+ _xls_get_conf('STORE_TAGLINE');
$this->pageCanonicalUrl = $this->getCanonicalUrl();
$this->pageDescription = _xls_get_conf('STORE_TAGLINE');
$this->pageImageUrl ='';
$this->pageHeaderImage = CHtml::link(CHtml::image(Yii::app()->baseUrl._xls_get_conf('HEADER_IMAGE')), array('site/index'));
- Yii::app()->clientScript->registerMetaTag("LightSpeed Web Store ".XLSWS_VERSION,'generator');
+
try {
@@ -141,6 +154,8 @@ public function init() {
if(_xls_facebook_login())
$this->getFacebookLogin();
+ Yii::app()->clientScript->registerMetaTag(
+ "LightSpeed Web Store ".XLSWS_VERSION,'generator',null,array(),'generator');
}
/**
@@ -326,4 +341,5 @@ protected function afterRender($view, &$output) {
return true;
}
-}
+}
+
@@ -68,13 +68,19 @@ public function getModel()
} else {
$objCart = Cart::model()->findByPk($intCartId);
- if (!$objCart || $objCart->cart_type != CartType::cart) {
+ if (!($objCart instanceof Cart))
+ {
//something has happened to the database object
Yii::log("Could not find cart ".$intCartId.", creating new one.", 'error', 'application.'.__CLASS__.".".__FUNCTION__);
$objCart = Cart::InitializeCart();
Yii::app()->user->setState('cartid',$objCart->id);
}
-
+ elseif($objCart->cart_type != CartType::cart && $objCart->cart_type != CartType::awaitpayment)
+ {
+ Yii::log("Found cart ".$intCartId." but ".$objCart->cart_type." is not editable type, so generate a new one", 'error', 'application.'.__CLASS__.".".__FUNCTION__);
+ $objCart = Cart::InitializeCart();
+ Yii::app()->user->setState('cartid',$objCart->id);
+ }
}
$this->_model = $objCart;
@@ -141,6 +147,8 @@ public function loginMerge($objCartToMerge = null)
$objProduct = Product::model()->findbyPk($objItem->product_id);
//we strip any discount from another cart usu. promo code
$retVal = $this->model->AddProduct($objProduct, $objItem->qty, $objItem->cart_type, $objItem->wishlist_item, $objItem->description,$objItem->sell,0);
+ if($objItem->wishlist_item>0)
+ WishlistItem::model()->updateByPk($objItem->wishlist_item,array('cart_item_id'=>$retVal));
if(is_null($objCartToMerge)) $objItem->delete();
}
@@ -488,7 +496,7 @@ public function getIsTaxIn()
if($this->model->id>0)
{
- if($this->model->taxCode->IsNoTax()) return false;
+ if(is_object($this->model->taxCode) && $this->model->taxCode->IsNoTax()) return false;
if (Yii::app()->params['TAX_INCLUSIVE_PRICING']) return true;
return false;
@@ -1509,12 +1509,19 @@ function _xls_check_version($releasenotes = false)
$strThemeVersion="noupdate";
}
+ if(isset($_SERVER['SERVER_SOFTWARE']))
+ $serversoftware=$_SERVER['SERVER_SOFTWARE'];
+ else
+ $serversoftware="";
+
$data['webstore'] = array(
'version' => XLSWS_VERSIONBUILD,
'customer' => $storeurl,
'type' => (_xls_get_conf('LIGHTSPEED_HOSTING')==1 ? "hosted" : "self"),
'track' => (_xls_get_conf('AUTO_UPDATE_TRACK','0')==1 ? "beta" : "release"),
+ 'autoupdate' => (_xls_get_conf('AUTO_UPDATE','1')==1 ? "1" : "0"),
'theme' => $strTheme,
+ 'serversoftware'=> $serversoftware,
'releasenotes' => $releasenotes,
'themeversion' => $strThemeVersion,
'schema' => _xls_get_conf('DATABASE_SCHEMA_VERSION')
@@ -17,8 +17,8 @@ function searchForComponents()
foreach (glob(dirname(__FILE__).'/../extensions/wsshipping/*', GLOB_ONLYDIR) as $moduleDirectory)
$arr[basename($moduleDirectory)] = array('class'=>'ext.wsshipping.'.basename($moduleDirectory).'.'.basename($moduleDirectory));
- if (file_exists(dirname(__FILE__).'/wslogging.php'))
- $arr['log']=require(dirname(__FILE__).'/wslogging.php');
+ if (file_exists(dirname(__FILE__).'/../../../config/wslogging.php'))
+ $arr['log']=require(dirname(__FILE__).'/../../../config/wslogging.php');
else
$arr['log']=array(
'class'=>'CLogRouter',
@@ -1,5 +1,5 @@
<?php
-define('XLSWS_VERSION', '3.0.4');
-define('XLSWS_VERSIONBUILD', 3040);
-define('XLSWS_BUILDDATE', '2013-08-28 16:14:01');
+define('XLSWS_VERSION', '3.0.5');
+define('XLSWS_VERSIONBUILD', 3050);
+define('XLSWS_BUILDDATE', '2013-10-02 12:18:39');
@@ -438,7 +438,7 @@ public function actionCheckout()
if(_xls_get_conf('LIGHTSPEED_HOSTING','0') == '1' && _xls_get_conf('LIGHTSPEED_HOSTING_SHARED_SSL','0') == '1')
$this->verifySharedSSL();
- $this->pageTitle=Yii::app()->name . ' - Checkout';
+ $this->pageTitle=_xls_get_conf('STORE_NAME') . ' : Checkout';
//Set breadcrumbs
$this->breadcrumbs = array(
Yii::t('global','Edit Cart')=>array('/cart'),
@@ -904,7 +904,7 @@ public function actionCheckout()
Yii::app()->clientScript->registerScript('payment',
'$(document).ready(function(){
- changePayment(\''.$objPaymentModule->id.'\')
+ changePayment(\''.$model->paymentProvider.'\')
});');
}
} else $model->paymentProvider=null;
@@ -18,7 +18,7 @@ class InstallController extends Controller
protected $online;
public function init() {
-
+ Yii::app()->setViewPath(Yii::getPathOfAlias('application')."/views-cities");
set_time_limit(300);
//We override init() to keep our system from trying to autoload stuff we haven't finished converting yet
}
@@ -13,7 +13,7 @@ class LegacySoapController extends Controller
{
public function init() {
-
+ Yii::app()->setViewPath(Yii::getPathOfAlias('application')."/views-cities");
if(Yii::app()->params['INSTALLED'] != '1') die(); //No soap when not installed (or partially installed)
//do nothing since we don't need a PHP session created for SOAP transactions
@@ -150,13 +150,14 @@ public function actionBrowse() {
if (_xls_get_conf('INVENTORY_OUT_ALLOW_ADD') == Product::InventoryMakeDisappear)
- $criteria->addCondition('inventory_avail>0');
+ $criteria->addCondition('(inventory_avail>0 OR inventoried=0)');
if (!_xls_get_conf('CHILD_SEARCH') || empty($strQ))
$criteria->addCondition('Product.parent IS NULL');
$criteria->addCondition('web=1');
+ $criteria->addCondition('current=1');
$criteria->order = 'Product.'._xls_get_sort_order();
@@ -288,7 +289,7 @@ protected function BuildCommand($formModel,$intLimit = null, $intOffset = null)
$arrBind = array(':query'=>$strQ);
if (_xls_get_conf('INVENTORY_OUT_ALLOW_ADD') == Product::InventoryMakeDisappear)
- $strInv .= " AND inventory_avail>0 ";
+ $strInv .= " AND (inventory_avail>0 OR inventoried=0) ";
if (!_xls_get_conf('CHILD_SEARCH'))
$strInv .= " AND parent IS NULL ";
@@ -358,7 +359,7 @@ protected function BuildCommand($formModel,$intLimit = null, $intOffset = null)
$objCommand->leftJoin('xlsws_product_tags t2', 't2.product_id = t.id');
$objCommand->leftJoin('xlsws_tags t3', 't2.tag_id = t3.id');
$objCommand->from('xlsws_product t');
- $objCommand->where('(' . $strWhere . ') ' . $strInv . ' AND web=1');
+ $objCommand->where('(' . $strWhere . ') ' . $strInv . ' AND web=1 AND current=1');
//If we have passed a category, append it to the search here
if(isset($formModel['cat']) && $formModel['cat']>0)
@@ -369,7 +370,7 @@ protected function BuildCommand($formModel,$intLimit = null, $intOffset = null)
$intIdArray = array_merge($intIdArray, $objCategory->GetBranchPath());
unset($arrBind[':cat']);
$objCommand->leftJoin('xlsws_product_category_assn t4', 't4.product_id = t.id');
- $objCommand->where(array('AND', '(' . $strWhere . ') ' . $strInv . ' AND web=1', array('in', 'category_id', $intIdArray)));
+ $objCommand->where(array('AND', '(' . $strWhere . ') ' . $strInv . ' AND web=1 AND current=1', array('in', 'category_id', $intIdArray)));
}
@@ -379,7 +380,7 @@ protected function BuildCommand($formModel,$intLimit = null, $intOffset = null)
{
if ($intLimit==-1) {
//This means we're just running a count, so we don't need all aspects of this query
- $objCommand->select(' count(t.id) ');
+ $objCommand->select(' count(DISTINCT t.id) ');
$objCommand->group(null);
$objCommand->order(null);
}
@@ -14,26 +14,6 @@ class SiteController extends Controller
{
public $layout='//layouts/column2';
-
- /**
- * Declares class-based actions.
- */
- public function actions()
- {
- return array(
- // captcha action renders the CAPTCHA image displayed on the contact page
- 'captcha'=>array(
- 'class'=>'CCaptchaAction',
- 'backColor'=>0xFFFFFF,
- ),
- // page action renders "static" pages stored under 'protected/views/site/pages'
- // They can be accessed via: index.php?r=site/page&view=FileName
- 'page'=>array(
- 'class'=>'CViewAction',
- ),
- );
- }
-
/**
* This is the default 'index' action that is invoked
* when an action is not explicitly requested by users.
@@ -49,46 +29,7 @@ public function actionIndex()
break;
case "*products":
-
- $criteria = new CDbCriteria();
-
- if (_xls_get_conf('INVENTORY_OUT_ALLOW_ADD') == Product::InventoryMakeDisappear)
- $criteria->addCondition('current=1 AND web=1 AND parent IS NULL AND inventory_avail>0');
- else
- $criteria->condition = 'current=1 AND web=1 AND parent IS NULL';
-
- if (Product::HasFeatured())
- $criteria->addCondition('featured=1');
- $criteria->order = _xls_get_sort_order();
-
- $item_count = Product::model()->count($criteria);
-
- $pages = new CPagination($item_count);
- $pages->setPageSize(Yii::app()->params['listPerPage']);
- $pages->applyLimit($criteria);
-
- $model = Product::model()->findAll($criteria);
-
- $model = $this->createBookends($model);
-
- $this->pageTitle=_xls_get_formatted_page_title(
- null,_xls_get_conf('SEO_HOMEPAGE_TITLE','{storename} : {storetagline}')
- );
-
-
- //We leech off the grid file from search
- if (Yii::app()->theme && file_exists('themes/'.Yii::app()->theme->name.'/views/search/grid.php'))
- $gridFile = 'webroot.themes.'.Yii::app()->theme->name.'.views.search.grid';
- else $gridFile = "application.views.search.grid";
-
- $this->render($gridFile,array(
- 'model'=> $model, // must be the same as $item_count
- 'item_count'=>$item_count,
- 'page_size'=>Yii::app()->params['listPerPage'],
- 'items_count'=>$item_count,
- 'pages'=>$pages,
- ));
-
+ $this->forward("search/browse");
break;
default:
@@ -135,7 +76,10 @@ public function actionMap()
*/
public function actionError()
{
- $this->layout='//layouts/errorlayout';
+ $strPath = Yii::app()->getViewPath();
+ if(substr($strPath,-5)=="views")
+ Yii::app()->setViewPath(Yii::getPathOfAlias('application')."/views-cities");
+ $this->layout='//layouts/errorlaout';
if($error=Yii::app()->errorHandler->error)
{
if(Yii::app()->request->isAjaxRequest)
@@ -68,7 +68,7 @@ public function getAdminForm()
'live'=>array(
'type'=>'dropdownlist',
'items'=>array('live'=>'Live','test'=>'Sandbox'),
- 'title'=>"To use (TEST MODE) in your regular account, leave this as Live and instead set Test Mode in your Authorize.net account settings on their site. Sandbox should only be used with Authorize.net Sandbox testing servers.",
+ 'title'=>"To use TEST MODE set to Sandbox.",
'hint'=>"Hover over field for instructions",
),
'restrictcountry'=>array(
@@ -29,7 +29,7 @@ public function run()
$type='purchase';
$cust_id='';
- $order_id=$this->objCart->id_str;
+ $order_id=$this->objCart->id_str.date("YmdHis");
$amount=number_format(round($this->objCart->total,2),2, '.', '');
$pan=_xls_number_only($this->CheckoutForm->cardNumber);
$expiry_date=$this->CheckoutForm->cardExpiryMonth.substr($this->CheckoutForm->cardExpiryYear,2,2);
@@ -114,7 +114,7 @@ public function run()
/***************************** HTTPS Post Object *****************************/
- $mpgHttpPost =new mpgHttpsPost($store_id,$api_token,$mpgRequest);
+ $mpgHttpPost =new mpgHttpsPost($store_id,$api_token,$mpgRequest,$this->config);
/******************************* Response ************************************/
Oops, something went wrong. Retry.

0 comments on commit 4ab5fec

Please sign in to comment.