View Single Post
  #3  
Old 06-09-2015, 03:12 AM
 
xgarb xgarb is offline
 

eXpert
  
Join Date: Jul 2004
Location: UK
Posts: 263
 

Default Re: X5 - Creating a new ItemsList type

Thanks, I have it working.

In the class I have....

Code:
const DISPLAY_MODE_CLIENT = 'client';


Code:
/** * Get display modes for center widget type * * @return array */ public static function getCenterDisplayModes() { return array( static::DISPLAY_MODE_GRID => 'Grid', static::DISPLAY_MODE_LIST => 'List', static::DISPLAY_MODE_TABLE => 'Table', static::DISPLAY_MODE_CLIENT => 'Client', ); } /** * Define widget parameters * * @return void */ protected function defineWidgetParams() { parent::defineWidgetParams(); $this->widgetParams[self::PARAM_WIDGET_TYPE]->setValue(self::WIDGET_TYPE_CENTER); $this->widgetParams[self::PARAM_DISPLAY_MODE]->setValue(self::DISPLAY_MODE_CLIENT); $this->widgetParams[self::PARAM_SHOW_DISPLAY_MODE_SELECTOR]->setValue(false); $this->widgetParams[self::PARAM_SHOW_SORT_BY_SELECTOR]->setValue(false); }

In my theme I've created in customer/en/items_list/product/center/client/body.tpl

Code:
<list name="itemsList.product.cart" /> <div class="products"> <div class="products-list" IF="getPageData()"> <div FOREACH="getPageData(),product" class="row" style="margin:15px 0"> <div class="col-xs-12 col-sm-4" style="text-align:center"> <widget class="\XLite\View\Image" image="{product.getImage()}" className="photo product-thumbnail" verticalAlign="top" id="product_image_{product.product_id}" alt="{t(#Thumbnail#)}" /> </div> <div class="col-xs-12 col-sm-8"> <div><strong>{product.name:h}</strong></div> <div style="color:grey">{if:product.sku}SKU: {product.sku}{else:}&nbsp;{end:}</div> <div IF="product.getBriefDescription()" class="description product-description">{product.getBriefDescription():h}</div> <widget class="\XLite\View\Price" product="{product}" displayOnlyPrice="false" /> <a href="{buildURL(#product#,##,_ARRAY_(#product_id#^product.product_id,#category_id#^categoryId))}" class="product-link"> View Product Page </a> </div> </div> </div> </div>

For some reason the list name="info" and list name="photo" weren't working like in the other three Itemlists but I prefer to have all the code in one template as above anyway.

I'm using this to make my own template to put related products in a tab and make it nicely responsive. If anyone else does this.. you might not see a change until you have deleted cookies.
__________________
Core version: 5.5.xx
Reply With Quote