-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmyshop_allproducts.html
90 lines (80 loc) · 3.81 KB
/
myshop_allproducts.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<{$breadcrumb}>
<br />
<div align='center'>
<{if $welcome_msg != ''}><br /><br /><div id="myshop_welcome"><{$welcome_msg}></div><{/if}>
<{if $mod_pref.advertisement != ''}><br /><br /><div id="myshop_publicite"><{$mod_pref.advertisement}></div><br /><{/if}>
</div>
<h2><{$smarty.const._MI_MYSHOP_SMNAME6}></h2>
<div align="left"><i><{$smarty.const._MYSHOP_CATALOG_HLP}></i></div>
<br />
<script type="text/javascript">
Ext.onReady(function(){
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
var myData = [
<{foreach item=product from=$products}>
['<a href="<{$product.product_url_rewrited}>" title="<{$product.product_href_title}>"><{$product.product_title}></a> <{$product.product_recommended_picture}>','<{$product.product_category.cat_title}>'<{if $mod_pref.use_price}>,'<{if $product.product_discount_price_ttc != ''}><{$product.product_discount_price_ttc}><{else}><{$product.product_price_ttc}><{/if}><{/if}>','<{if $product.product_stock > 0 }><a href="<{$smarty.const.MYSHOP_URL}>caddy.php?op=addproduct&product_id=<{$product.product_id}>" title="<{$smarty.const._MYSHOP_ADD_TO_CART}>"><img src="<{$smarty.const.MYSHOP_IMAGES_URL}>cartadd.gif" alt="<{$smarty.const._MYSHOP_ADD_TO_CART}>" border="0" /></a><{else}><{$mod_pref.nostock_msg}><{/if}>'] <{if $product.product_count != count($products)}>,<{/if}>
<{/foreach}>
];
// example of custom renderer function
function change(val){
if(val > 0){
return '<span style="color:green;">' + val + '</span>';
}else if(val < 0){
return '<span style="color:red;">' + val + '</span>';
}
return val;
}
// example of custom renderer function
function pctChange(val){
if(val > 0){
return '<span style="color:green;">' + val + '%</span>';
}else if(val < 0){
return '<span style="color:red;">' + val + '%</span>';
}
return val;
}
// create the data store
var store = new Ext.data.SimpleStore({
fields: [
{name: 'product'},
{name: 'category'},
<{if $mod_pref.use_price}>{name: 'price'},<{/if}>
{name: 'cart'}
]
});
store.loadData(myData);
// create the Grid
var grid = new Ext.grid.GridPanel({
store: store,
columns: [
{id:'product',header: "<{$smarty.const._MYSHOP_TITLE}>", width: 160, sortable: true, dataIndex: 'product'},
{id:'category',header: "<{$smarty.const._MYSHOP_CATEGORY}>", width: 120, sortable: true, dataIndex: 'category'},
{header: "<{$smarty.const._MYSHOP_PRICE}>", width: 75, sortable: true, align: 'right', dataIndex: 'price'},
{id:'cart',header: "<{$smarty.const._MYSHOP_ADD_TO_CART}>", width: 100, align: 'center', sortable: false, dataIndex: 'cart'}
],
stripeRows: true,
autoExpandColumn: 'product',
height:350,
width:600,
title:'<{$smarty.const._MI_MYSHOP_SMNAME6}>'
});
grid.render('grid-all-products');
grid.getSelectionModel().selectFirstRow();
});
</script>
<div id="grid-all-products"></div>
<{if $pagenav != ''}>
<br /><div align="center"><{$pagenav}></div><br />
<{/if}>
<{if $pdf_catalog == 1 }>
<br /><br />
<h3><{$smarty.const._MYSHOP_PDF_CATALOG}></h3>
<br />
<form name="frmCatalog" id="frmCatalog" method="post" action="<{$smarty.const.MYSHOP_URL}>pdf/catalog.php">
<input type="radio" name="catalogFormat" id="catalogFormat" value="0" checked="checked" /><{$smarty.const._MYSHOP_PDF_CATALOG1}>
<br /><input type="radio" name="catalogFormat" id="catalogFormat" value="1" /><{$smarty.const._MYSHOP_PDF_CATALOG2}>
<br /><input type="submit" name="btnSubmit" id="btnSubmit" value="<{$smarty.const._MYSHOP_PDF_GETIT}>" />
</form>
<{/if}>
<{* NOTIFICATION *}>
<{include file='db:legacy_notification_select.html'}>