@@ -71,12 +71,12 @@ <h1>Products</h1>
71
71
</ div >
72
72
< div class ="info-bar ">
73
73
< div class ="row ">
74
- < div class ="col-lg-4 products-showing "> Showing < strong > 8</ strong > of < strong > 8</ strong > products</ div >
74
+ < div class ="col-lg-4 products-showing " id =" productCount " > Showing < strong > 8</ strong > of < strong > 8</ strong > products</ div >
75
75
< div class ="col-lg-8 products-number-sort ">
76
76
< form class ="form-inline "> </ form >
77
77
< div class ="row ">
78
78
< div class ="col-6 col-lg-7 ">
79
- < div class ="products-number "> < strong > Show</ strong > < a href ="# " class ="btn btn-sm btn-outline-primary mr-1 "> 12</ a > < a href ="# " class ="btn btn-outline-secondary btn-sm mr-1 "> 24</ a > < a href ="# " class ="btn btn-outline-secondary btn-sm mr-1 "> All</ a > products</ div >
79
+ <!-- < div class="products-number"><strong>Show</strong><a href="#" class="btn btn-sm btn-outline-primary mr-1" onclick="showProducts(12)" >12</a> <a href="#" class="btn btn-outline-secondary btn-sm mr-1" onclick="showProducts(24)" >24</a> <a href="#" class="btn btn-outline-secondary btn-sm mr-1" onclick="showProducts(-1)" >All</a> products</div> -- >
80
80
</ div >
81
81
< div class ="col-6 col-lg-5 ">
82
82
< div class ="products-sort-by d-flex justify-content-end "> < strong > Sort by</ strong >
@@ -135,11 +135,11 @@ <h1>Products</h1>
135
135
if ( data != null ) {
136
136
137
137
var content = ''
138
-
138
+ var count = 0
139
139
$ . each ( data . data , function ( index , product ) {
140
140
141
141
console . log ( 'product ID: ' + product . id )
142
-
142
+ count = count + 1
143
143
content += '<div class="col-md-3 col-sm-4">\
144
144
<div class="product">\
145
145
<div class="image"><a href="detail.html?id=' + product . id + '"' + '><img src="' + product . imageUrl1 + '" alt=""\
@@ -158,11 +158,11 @@ <h3><a href="detail.html?id=' + product.id + '"' + ' </a>' + product.name+ '</h3
158
158
} )
159
159
160
160
$ ( "#rowProducts" ) . append ( content ) ;
161
+ $ ( "#productCount" ) . html ( "Showing <strong>" + count + "</strong> of <strong>" + count + "</strong> products" )
161
162
162
163
}
163
164
} ,
164
165
error : function ( jqXHR , textStatus , errorThrown ) {
165
-
166
166
console . log ( errorThrown )
167
167
}
168
168
0 commit comments