예제 #1
0
			</div>
		</div> 


		<div class="col-md-4 col-xs-4">

			<div id="login">
				<?php 
if (Yii::app()->user->isGuest) {
    ?>
					<?php 
    echo CHtml::link(Yii::t('global', 'Login'), array("site/login"));
    ?>
					
					<a href="<?php 
    echo _xls_site_url('myaccount/edit');
    ?>
"><?php 
    echo Yii::t('global', 'Register');
    ?>
</a>
				<?php 
} else {
    ?>
					<?php 
    echo CHtml::link(CHtml::image(Yii::app()->user->profilephoto) . Yii::app()->user->firstname, array('/myaccount'));
    ?>
					<?php 
    echo CHtml::link(Yii::t('global', 'Logout'), array("site/logout"));
    ?>
					<?php 
예제 #2
0
//					}',
//				'updater'=>'js:function(item) {
//					var parts = item.split("|");
//					window.location.href=(parts.shift());
//					}',
//			)));
?>
        <input type="search" name="q" id="xlsSearch" placeholder="<?php 
echo Yii::t('global', 'SEARCH') . '...';
?>
">
	</span>
	<?php 
echo CHtml::endForm();
?>
</div>






	<span class="search_advanced right"><a href="<?php 
echo _xls_site_url('/search');
?>
"><img class="spyglass" src="<?php 
echo Yii::app()->theme->baseUrl;
?>
/css/images/spyglass.png"></a></span>

예제 #3
0
 public static function GetLinkByKey($strKey)
 {
     $cpage = CustomPage::model()->findByAttributes(array('page_key' => $strKey));
     if ($cpage) {
         return $cpage->Link;
     } else {
         return _xls_site_url();
     }
 }
예제 #4
0
/**
 * Redirect to a given URL
 * @param string $url
 */
function _rd($url = '')
{
    if (empty($url)) {
        $url = $_SERVER["REQUEST_URI"];
        //_xls_site_url will append subfolder again so get rid of it here
        if (__SUBDIRECTORY__) {
            $url = substr($url, strlen(__SUBDIRECTORY__), 999);
        }
    }
    header("Location: " . _xls_site_url($url));
    exit;
}
예제 #5
0
 public function getLink()
 {
     return _xls_site_url("/class/" . $this->request_url);
 }
예제 #6
0
 public function run()
 {
     // place the action logic here
     //Load some information we'll use within the loops
     $intStockHandling = _xls_get_conf('INVENTORY_OUT_ALLOW_ADD', 0);
     $intGoogleMPN = _xls_get_conf('GOOGLE_MPN', 0);
     $strQueryAddl = $intStockHandling == 0 ? " AND inventory_avail>0" : "";
     header("content-type: text/xml;charset=UTF-8");
     echo '<?xml version="1.0" encoding="UTF-8"?>' . chr(13);
     echo ' <rss xmlns:g="http://base.google.com/ns/1.0" version="2.0">' . chr(13);
     echo '<channel>' . chr(13);
     echo '		<title><![CDATA[' . _xls_get_conf('STORE_NAME', 'Lightspeed Web Store') . ']]></title>' . chr(13);
     echo '		<link>' . _xls_site_url() . '</link>' . chr(13);
     echo '		<description><![CDATA[' . _xls_get_conf('STORE_TAGLINE') . ']]></description>' . chr(13);
     // We only want active web products that are not master products
     // https://support.google.com/merchants/answer/188494
     $sql = 'SELECT * FROM ' . Product::model()->tableName() . ' WHERE current=1 AND web=1 AND master_model=0 ' . $strQueryAddl . ' ORDER BY id';
     if (isset($_GET['group'])) {
         $intGroup = _xls_number_only($_GET['group']);
         if ($intGroup < 1) {
             $intGroup = 1;
         }
         $parse = _xls_get_conf('GOOGLE_PARSE', 5000);
         switch ($intGroup) {
             case 1:
                 $sql .= " limit " . $parse;
                 break;
             default:
                 $sql .= " limit " . ($intGroup - 1) * $parse . "," . $parse;
                 break;
         }
     }
     $arrProducts = Yii::app()->db->createCommand($sql)->query();
     while (($arrItem = $arrProducts->read()) !== false) {
         $objProduct = Product::model()->findByPk($arrItem['id']);
         $arrGoogle = _xls_get_googlecategory($objProduct->id);
         $strGoogle = $arrGoogle['Category'];
         $arrTaxGrids = $objProduct->GetTaxRateGrid();
         $arrTrail = Category::GetTrailByProductId($objProduct->id, 'names');
         //If our current category doesn't have Google set but we have a parent that does, use it
         if (empty($strGoogle) && count($arrTrail) > 1) {
             $arrGoogle = _xls_get_googleparentcategory($objProduct->id);
             $strGoogle = $arrGoogle['Category'];
         }
         echo '<item>' . chr(13);
         echo chr(9) . "<g:id>" . $objProduct->id . "</g:id>" . chr(13);
         echo chr(9) . '<title><![CDATA[' . strip_tags($objProduct->Title) . ']]></title>' . chr(13);
         if ($objProduct->description_long) {
             echo chr(9) . '<description><![CDATA[' . $objProduct->WebLongDescription . ']]></description>' . chr(13);
         }
         if ($strGoogle) {
             echo chr(9) . '<g:google_product_category>' . $strGoogle . '</g:google_product_category>' . chr(13);
         }
         if ($arrTrail) {
             echo chr(9) . '<g:product_type><![CDATA[' . implode(" &gt; ", $arrTrail) . ']]></g:product_type>' . chr(13);
         }
         echo chr(9) . '<link>' . $objProduct->directUrl . '</link>' . chr(13);
         if ($objProduct->image_id) {
             $arrProductImages = $objProduct->getProductPhotos(true);
             if ($arrProductImages) {
                 echo chr(9) . '<g:image_link>' . $arrProductImages[0]['image'] . '</g:image_link>' . chr(13);
                 for ($index = 1; $index < count($arrProductImages); $index++) {
                     echo chr(9) . '<g:additional_image_link>' . $arrProductImages[$index]['image'] . '</g:additional_image_link>' . chr(13);
                 }
             }
         }
         echo chr(9) . '<g:condition>new</g:condition>' . chr(13);
         if ($objProduct->IsAddable) {
             echo chr(9) . '<g:availability>in stock</g:availability>' . chr(13);
         } else {
             echo chr(9) . '<g:availability>out of stock</g:availability>' . chr(13);
         }
         echo chr(9) . '<g:price>' . $objProduct->PriceValue . '</g:price>' . chr(13);
         echo chr(9) . '<g:brand><![CDATA[' . $objProduct->Family . ']]></g:brand>' . chr(13);
         echo chr(9) . '<g:gtin>' . $objProduct->upc . '</g:gtin>' . chr(13);
         if ($intGoogleMPN) {
             echo chr(9) . '<g:mpn><![CDATA[' . $objProduct->code . ']]></g:mpn>' . chr(13);
         }
         if (substr($strGoogle, 0, 7) == "Apparel") {
             echo chr(9) . '<g:gender>' . $arrGoogle['Gender'] . '</g:gender>' . chr(13);
             echo chr(9) . '<g:age_group>' . $arrGoogle['Age'] . '</g:age_group>' . chr(13);
         }
         echo chr(9) . '<g:color><![CDATA[' . $objProduct->product_color . ']]></g:color>' . chr(13);
         echo chr(9) . '<g:size><![CDATA[' . $objProduct->product_size . ']]></g:size>' . chr(13);
         if ($objProduct->parent > 0) {
             echo chr(9) . '<item_group_id>' . $objProduct->parent . '</item_group_id>' . chr(13);
         }
         foreach ($arrTaxGrids as $arrTaxGrid) {
             echo chr(9) . '<g:tax>' . chr(13);
             echo chr(9) . '   <g:country>' . $arrTaxGrid[0] . '</g:country>' . chr(13);
             echo chr(9) . '  <g:region>' . $arrTaxGrid[1] . '</g:region>' . chr(13);
             echo chr(9) . '  <g:rate>' . $arrTaxGrid[2] . '</g:rate>' . chr(13);
             echo chr(9) . '  <g:tax_ship>' . $arrTaxGrid[3] . '</g:tax_ship>' . chr(13);
             echo chr(9) . '</g:tax>	' . chr(13);
         }
         echo chr(9) . '<g:shipping_weight>' . $objProduct->product_weight . '</g:shipping_weight>' . chr(13);
         echo '</item>' . chr(13);
     }
     echo '</channel>' . chr(13);
     echo '</rss>';
     Yii::app()->db->createCommand("UPDATE xlsws_modules set active=1 where module='wsgooglemerchant'")->execute();
 }