Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

eztrade/admin/categorylist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: categorylist.php 8565 2001-11-21 17:34:16Z br $
5 //
6 // Created on: <13-Sep-2000 14:56:11 bf>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 //
10 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
11 //
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
25 //
26
27 // include_once( "classes/INIFile.php" );
28 // include_once( "classes/eztemplate.php" );
29 // include_once( "classes/ezlocale.php" );
30 // include_once( "classes/ezcurrency.php" );
31 // include_once( "classes/ezcachefile.php" );
32 // include_once( "classes/ezlist.php" );
33
34 function deleteCache( $ProductID, $CategoryID, $CategoryArray )
35 {
36 if ( is_a( $ProductID, "eZProduct" ) )
37 {
38 $CategoryID =& $ProductID->categoryDefinition( false );
39 $CategoryArray =& $ProductID->categories( false );
40 $ProductID = $ProductID->id();
41 }
42
43 $files = eZCacheFile::files( "kernel/eztrade/cache/", array( "productlist",
44 array_merge( $CategoryID, $CategoryArray ) ),
45 "cache", "," );
46 foreach( $files as $file )
47 {
48 $file->delete();
49 }
50 $files = eZCacheFile::files( "kernel/eztrade/cache/", array( "hotdealslist" ),
51 "cache", "," );
52 foreach( $files as $file )
53 {
54 $file->delete();
55 }
56 }
57
58
59 $ini =& eZINI::instance( 'site.ini' );
60
61 $Language = $ini->variable( "eZTradeMain", "Language" );
62 $Limit = $ini->variable( "eZTradeMain", "AdminProductLimit" );
63 $hotDealImageWidth = $ini->variable( "eZTradeMain", "HotDealImageWidth" );
64 $hotDealImageHeight = $ini->variable( "eZTradeMain", "HotDealImageHeight" );
65 $ShowQuantity = $ini->variable( "eZTradeMain", "ShowQuantity" ) == "true";
66
67 // include_once( "eztrade/classes/ezproductcategory.php" );
68 // include_once( "eztrade/classes/ezproduct.php" );
69
70 $t = new eZTemplate( "kernel/eztrade/admin/" . $ini->variable( "eZTradeMain", "AdminTemplateDir" ),
71 "kernel/eztrade/admin/intl/", $Language, "categorylist.php" );
72
73 // Set detail or normal mode
74 if ( isSet ( $DetailView ) )
75 {
76 $session =& eZSession::globalSession();
77 $session->setVariable( "TradeViewMode", "Detail" );
78 }
79 if ( isSet ( $NormalView ) )
80 {
81 $session =& eZSession::globalSession();
82 $session->setVariable( "TradeViewMode", "Normal" );
83 }
84
85 $checkMode =& eZSession::globalSession();
86
87 if ( $checkMode->variable( "TradeViewMode" ) == "Detail" )
88 {
89 $DetailView = true;
90 }
91 else if ( $checkMode->variable( "TradeViewMode" ) == "Normal" )
92 {
93 $NormalView = true;
94 }
95
96 $t->setAllStrings();
97
98 $t->set_file( "category_list_page_tpl", "categorylist.tpl" );
99
100 // path
101 $t->set_block( "category_list_page_tpl", "path_item_tpl", "path_item" );
102
103 // category
104 $t->set_block( "category_list_page_tpl", "category_list_tpl", "category_list" );
105 $t->set_block( "category_list_tpl", "category_item_tpl", "category_item" );
106
107 $t->set_block( "category_list_page_tpl", "normal_view_button", "normal_button" );
108 $t->set_block( "category_list_page_tpl", "detail_view_button", "detail_button" );
109
110 // product
111 $t->set_block( "category_list_page_tpl", "product_list_tpl", "product_list" );
112 $t->set_block( "product_list_tpl", "normal_list_tpl", "normal_list" );
113 $t->set_block( "product_list_tpl", "detail_view_tpl", "detail_view" );
114 $t->set_block( "product_list_tpl", "update_button_tpl", "update_button" );
115
116 $t->set_block( "normal_list_tpl", "product_item_tpl", "product_item" );
117
118 $t->set_block( "product_item_tpl", "product_active_item_tpl", "product_active_item" );
119 $t->set_block( "product_item_tpl", "product_inactive_item_tpl", "product_inactive_item" );
120
121 $t->set_block( "product_item_tpl", "voucher_icon_tpl", "voucher_icon" );
122 $t->set_block( "product_item_tpl", "product_icon_tpl", "product_icon" );
123
124 $t->set_block( "product_item_tpl", "inc_vat_item_tpl", "inc_vat_item" );
125 $t->set_block( "product_item_tpl", "ex_vat_item_tpl", "ex_vat_item" );
126
127 //detail view templates
128
129 $t->set_block( "detail_view_tpl", "detail_voucher_icon_tpl", "detail_voucher_icon" );
130 $t->set_block( "detail_view_tpl", "detail_product_icon_tpl", "detail_product_icon" );
131
132 $t->set_block( "detail_view_tpl", "vat_select_tpl", "vat_select" );
133 $t->set_block( "detail_view_tpl", "box_select_tpl", "box_select" );
134 $t->set_block( "detail_view_tpl", "module_linker_button_tpl", "module_linker" );
135 $t->set_block( "detail_view_tpl", "shipping_select_tpl", "shipping_select" );
136 $t->set_block( "detail_view_tpl", "quantity_item_tpl", "quantity_item" );
137 $t->set_block( "quantity_item_tpl", "day_item_tpl", "day_item" );
138 $t->set_block( "detail_view_tpl", "section_item_tpl", "section_item" );
139 $t->set_block( "section_item_tpl", "link_item_tpl", "link_item" );
140
141 //$t->set_block( "product_item_tpl", "inc_vat_item_tpl", "inc_vat_item" );
142 //$t->set_block( "product_item_tpl", "ex_vat_item_tpl", "ex_vat_item" );
143 $t->set_block( "detail_view_tpl", "product_image_tpl", "product_image" );
144 $t->set_block( "detail_view_tpl", "no_product_image_tpl", "no_product_image" );
145 $t->set_block( "detail_view_tpl", "main_image_tpl", "main_image" );
146 $t->set_block( "detail_view_tpl", "no_main_image_tpl", "no_main_image" );
147 $t->set_block( "detail_view_tpl", "value_tpl", "value" );
148 $t->set_block( "detail_view_tpl", "multiple_value_tpl", "multiple_value" );
149 $t->set_block( "detail_view_tpl", "image_tpl", "image" );
150 // move up / down
151 $t->set_block( "detail_view_tpl", "detail_absolute_placement_item_tpl", "detail_absolute_placement_item" );
152 $t->set_block( "detail_view_tpl", "detail_inc_vat_item_tpl", "detail_inc_vat_item" );
153 $t->set_block( "detail_view_tpl", "detail_ex_vat_item_tpl", "detail_ex_vat_item" );
154
155 // move up / down
156 //$t->set_block( "product_list_tpl", "absolute_placement_header_tpl", "absolute_placement_header" );
157 $t->set_block( "product_item_tpl", "absolute_placement_item_tpl", "absolute_placement_item" );
158
159 $t->set_var( "site_style", $siteDesign );
160
161 if( isset( $ParentID ) )
162 {
163 $category = new eZProductCategory( $ParentID );
164 }
165 else
166 {
167 $category = new eZProductCategory( 0 );
168 }
169 // $category->copy( true );
170
171 $ParentID = 0;
172
173 // $category = new eZProductCategory();
174
175 //if( isset( $ParentID ) )
176 //{
177 // $category->get( $ParentID );
178 //}
179 //else
180 //{
181 // $category->get( 1 );
182 //}
183
184 $category->get();
185 // move products up / down
186
187 if ( $category->sortMode() == "absolute_placement" )
188 {
189 if ( is_numeric( $MoveUp ) )
190 {
191 $category->moveUp( $MoveUp );
192 deleteCache( $MoveUp, false, false );
193 }
194 if ( is_numeric( $MoveDown ) )
195 {
196 $category->moveDown( $MoveDown );
197 deleteCache( $MoveDown, false, false );
198 }
199 }
200
201 // path
202 $pathArray =& $category->path();
203
204 $t->set_var( "path_item", "" );
205 foreach ( $pathArray as $path )
206 {
207 $t->set_var( "category_id", $path[0] );
208
209 $t->set_var( "category_name", $path[1] );
210
211 $t->parse( "path_item", "path_item_tpl", true );
212 }
213
214
215
216 $categoryList =& $category->getByParent( $category );
217
218 // categories
219 $i = 0;
220 $t->set_var( "category_list", "" );
221
222 foreach ( $categoryList as $categoryItem )
223 {
224 $t->set_var( "category_id", $categoryItem->id() );
225
226 $t->set_var( "category_name", $categoryItem->name() );
227
228 $parent = $categoryItem->parent();
229
230
231 if ( ( $i % 2 ) == 0 )
232 {
233 $t->set_var( "td_class", "bglight" );
234 }
235 else
236 {
237 $t->set_var( "td_class", "bgdark" );
238 }
239 $t->set_var( "category_description", $categoryItem->description() );
240
241 $t->parse( "category_item", "category_item_tpl", true );
242 $i++;
243 }
244
245 if ( count( $categoryList ) > 0 )
246 $t->set_var( "csv_dir", $ini->variable( "eZTradeMain", "CSVImportPath" ) );
247
248 if ( count( $categoryList ) > 0 )
249 $t->parse( "category_list", "category_list_tpl" );
250 else
251 $t->set_var( "category_list", "" );
252
253
254 if ( !isset( $Limit ) or !is_numeric( $Limit ) )
255 $Limit = 10;
256 if ( !isset( $Offset ) or !is_numeric( $Offset ) )
257 $Offset = 0;
258
259 // products
260 $TotalTypes =& $category->productCount( $category->sortMode(), true, false, $category->id() );
261 $productList =& $category->products( $category->sortMode(), true, $Offset, $Limit, true, $category->id() );
262
263 $locale = new eZLocale( $Language );
264 $i = 0;
265 $t->set_var( "product_list", "" );
266
267 /*if ( $category->sortMode() == "absolute_placement" )
268 {
269 $t->parse( "absolute_placement_header", "absolute_placement_header_tpl" );
270 }
271 else
272 {
273 $t->set_var( "absolute_placement_header", "" );
274 }*/
275
276 $categoryList = $category->getTree( );
277
278 foreach ( $productList as $product )
279 {
280 $t->set_var( "category_array_id", $i );
281 $t->set_var( "td_class", ( $i % 2 ) == 0 ? "bglight" : "bgdark" );
282 $t->set_var( "product_id", $product->id() );
283
284 // $category = new eZProductCategory();
285
286 $t->set_var( "value", "" );
287 $t->set_var( "multiple_value", "" );
288 foreach ( $categoryList as $catItem )
289 {
290 $defCat = $product->categoryDefinition();
291 if ( $product->existsInCategory( $catItem[0] )
292 && ( $defCat->id() != $catItem[0]->id() ) )
293 {
294 $t->set_var( "multiple_selected", "selected" );
295 }
296 else
297 {
298 $t->set_var( "multiple_selected", "" );
299 }
300
301 if ( $defCat->id() == $catItem[0]->id() )
302 {
303 $t->set_var( "selected", "selected" );
304 }
305 else
306 {
307 $t->set_var( "selected", "" );
308 }
309
310 $t->set_var( "option_value", $catItem[0]->id() );
311 $t->set_var( "option_name", $catItem[0]->name() );
312
313 if ( $catItem[1] > 0 )
314 $t->set_var( "option_level", str_repeat( "&nbsp;", $catItem[1] ) );
315 else
316 $t->set_var( "option_level", "" );
317
318 $t->parse( "value", "value_tpl", true );
319 $t->parse( "multiple_value", "multiple_value_tpl", true );
320 }
321
322 $t->set_var( "product_image", "" );
323 $t->set_var( "no_product_image", "" );
324 $image = $product->thumbnailImage();
325
326 if ( $image )
327 {
328 $thumbnail =& $image->requestImageVariation( $hotDealImageWidth, $hotDealImageHeight );
329
330 if ( $thumbnail )
331 {
332 $t->set_var( "thumbnail_image_uri", "/" . $thumbnail->imagePath() );
333 $t->set_var( "thumbnail_image_width", $thumbnail->width() );
334 $t->set_var( "thumbnail_image_height", $thumbnail->height() );
335 $t->parse( "product_image", "product_image_tpl" );
336 }
337 }
338 else
339 {
340 $t->set_var( "product_image", "" );
341 $t->parse( "no_product_image", "no_product_image_tpl" );
342 }
343
344 $t->set_var( "main_image", "" );
345 $t->set_var( "no_main_image", "" );
346
347 $image = $product->mainImage();
348
349 if ( $image )
350 {
351 $thumbnail =& $image->requestImageVariation( $hotDealImageWidth, $hotDealImageHeight );
352
353 if ( $thumbnail )
354 {
355 $t->set_var( "main_image_uri", "/" . $thumbnail->imagePath() );
356 $t->set_var( "main_image_width", $thumbnail->width() );
357 $t->set_var( "main_image_height", $thumbnail->height() );
358 $t->parse( "main_image", "main_image_tpl" );
359 }
360 }
361 else
362 {
363 $t->set_var( "main_image", "" );
364 $t->parse( "no_main_image", "no_main_image_tpl" );
365 }
366
367 // die($product->brief());
368 // rendering contains html
369
370 $t->set_var( "product_name", htmlspecialchars($product->name()) );
371 $t->set_var( "product_number", $product->productNumber() );
372
373 if ( isSet ( $DetailView ) )
374 {
375 $t->set_var( "brief_value", $product->briefPlain() );
376 $t->set_var( "description_value", $product->descriptionPlain() );
377 }else{
378 $t->set_var( "brief_value", $product->brief() );
379 $t->set_var( "description_value", $product->description() );
380 }
381
382 $t->set_var( "is_hot_deal_checked", "" );
383 if ( $product->isHotDeal() == true )
384 $t->set_var( "is_hot_deal_checked", "checked" );
385
386 $t->set_var( "showproduct_checked", "" );
387 if ( $product->showProduct() == true )
388 $t->set_var( "showproduct_checked", "checked" );
389
390 $t->set_var( "showprice_checked", "" );
391 if ( $product->showPrice() == true )
392 $t->set_var( "showprice_checked", "checked" );
393
394 $t->set_var( "discontinued_checked", "" );
395 if ( $product->discontinued() == true )
396 $t->set_var( "discontinued_checked", "checked" );
397
398 $t->set_var( "include_vat", "" );
399 $t->set_var( "exclude_vat", "" );
400 if ( $product->includesVAT() == true )
401 $t->set_var( "include_vat", "selected" );
402 else
403 $t->set_var( "exclude_vat", "selected" );
404
405 // show the VAT values
406 $t->set_var( "vat_select", "" );
407 $vat = new eZVATType();
408 $vatTypes = $vat->getAll();
409 $VatType =& $product->vatType();
410
411 foreach ( $vatTypes as $type )
412 {
413 if ( $VatType and ( $VatType->id() == $type->id() ) )
414 {
415 $t->set_var( "vat_selected", "selected" );
416 }
417 else
418 {
419 $t->set_var( "vat_selected", "" );
420 }
421
422 $t->set_var( "vat_id", $type->id() );
423 $t->set_var( "vat_name", $type->name() . " (" . $type->value() . ")%" );
424
425 $t->parse( "vat_select", "vat_select_tpl", true );
426 }
427
428 // show the box types
429 $t->set_var( "box_select", "" );
430 $box = new eZBoxType();
431 $boxTypes = $box->getAll();
432 $BoxType =& $product->boxType();
433 foreach ( $boxTypes as $type )
434 {
435 if ( $BoxType and ( $BoxType->id() == $type->id() ) )
436 $t->set_var( "box_selected", "selected" );
437 else
438 $t->set_var( "box_selected", "" );
439 $t->set_var( "box_id", $type->id() );
440 // $t->set_var( "box_name", $type->name()." (".$type->length()."x".$type->width()."x".$type->height()." in)" );
441 $t->set_var( "box_name", $type->name() );
442 $t->parse( "box_select", "box_select_tpl", true );
443 }
444
445 // show shipping groups
446
447 $t->set_var( "shipping_select", "" );
448 $group = new eZShippingGroup();
449 $groups =& $group->getAll();
450 $ShippingGroup =& $product->shippingGroup();
451
452 foreach ( $groups as $group )
453 {
454 if ( $ShippingGroup and $ShippingGroup->id() == $group->id() )
455 {
456 $t->set_var( "selected", "selected" );
457 }
458 else
459 {
460 $t->set_var( "selected", "" );
461 }
462
463 $t->set_var( "shipping_group_id", $group->id() );
464
465 $t->set_var( "shipping_group_name", $group->name() );
466
467 $t->parse( "shipping_select", "shipping_select_tpl", true );
468 }
469
470 $weight = $product->weight();
471 if ($weight)
472 $t->set_var( "weight_value", $weight );
473 else
474 $t->set_var( "weight_value", "" );
475
476 // Show quantity
477 $Quantity = $product->totalQuantity();
478 $t->set_var( "quantity_item", "" );
479 $t->set_var( "quantity_value", $Quantity );
480
481 // show expected stock date
482
483 if ( $product->stockDate() )
484 {
485 $Stock = new eZDate();
486 $Stock->setTimeStamp( $product->stockDate() );
487 $StockYear = $Stock->year();
488 $StockMonth = $Stock->month();
489 $StockDay = $Stock->day();
490 }
491 else
492 {
493 $StockYear = "";
494 $StockMonth = "";
495 $StockDay = "";
496 }
497
498 for ( $j = 1; $j <= 31; $j++ )
499 {
500 $t->set_var( "day_id", $j );
501 $t->set_var( "day_value", $j );
502 $t->set_var( "selected", "" );
503 if ( $StockDay == $j )
504 $t->set_var( "selected", "selected" );
505 if ( $StockDay == "" and $j == date(j) )
506 $t->set_var( "selected", "selected" );
507 $t->parse( "day_item", "day_item_tpl", true );
508 }
509
510 $month_array = array( 1 => "select_january",
511 2 => "select_february",
512 3 => "select_march",
513 4 => "select_april",
514 5 => "select_may",
515 6 => "select_june",
516 7 => "select_july",
517 8 => "select_august",
518 9 => "select_september",
519 10 => "select_october",
520 11 => "select_november",
521 12 => "select_december" );
522
523 foreach ( $month_array as $month )
524 $t->set_var( $month, "" );
525 $var_name =& $month_array[$StockMonth];
526 if ( $var_name == "" )
527 $var_name =& $month_array[date(n)];
528 $t->set_var( $var_name, "selected" );
529 if ( $StockYear )
530 $t->set_var( "stockyear", $StockYear );
531 else
532 $t->set_var( "stockyear", date(Y) );
533
534 if ( $ShowQuantity )
535 $t->parse( "quantity_item", "quantity_item_tpl" );
536
537 $t->set_var( "product_price", "" );
538 $t->set_var( "product_price_inc_vat", "" );
539 if ( $product->hasPrice() )
540 {
541 // $price = new eZCurrency( $product->price() );
542
543 // $t->set_var( "product_price", $locale->format( $price ) );
544
545 $t->set_var( "product_price", $product->localePrice( $PricesIncludeVAT ) );
546
547 }
548
549
550 $t->set_var( "external_link", $product->externalLink() );
551 $t->set_var( "keywords_value", $product->keywords() );
552
553 $priceArray = "";
554 $options =& $product->options();
555 $high = 0;
556 $low = 0;
557 foreach ( $options as $option )
558 {
559 if ( is_a( $option, "eZOption" ) )
560 {
561 $optionValues =& $option->values();
562 if ( count( $optionValues ) > 1 )
563 {
564 $i=0;
565 $priceArray = array();
566 foreach ( $optionValues as $optionValue )
567 {
568 $priceArray[$i] = $optionValue->price();
569 $i++;
570 }
571 $high += max( $priceArray );
572 $low += min( $priceArray );
573 }
574 }
575 }
576 /* if ( count( $options ) > 0 )
577 {
578 $low = new eZCurrency( $low + $product->price() );
579 $high = new eZCurrency( $high + $product->price() );
580 if ( $low != $high )
581 $t->set_var( "product_price", $locale->format( $low ) . " - " . $locale->format( $high ) );
582 else
583 $t->set_var( "product_price", $locale->format( $low ) );
584 }
585
586 $range = $product->priceRange();
587 if ( $range )
588 {
589 $min = new eZCurrency( $range->min() );
590 $max = new eZCurrency( $range->max() );
591
592 $t->set_var( "product_price", $locale->format( $min ) . " - " . $locale->format( $max ) );
593 }
594
595 */
596 if( $product->includesVAT() == true )
597 {
598 $t->set_var( "ex_vat_item", "" );
599 $t->parse( "inc_vat_item", "inc_vat_item_tpl" );
600 }
601 else
602 {
603 $t->set_var( "inc_vat_item", "" );
604 $t->parse( "ex_vat_item", "ex_vat_item_tpl" );
605 }
606
607
608
609 $t->set_var( "product_active_item", "" );
610 $t->set_var( "product_inactive_item", "" );
611 if ( $product->showProduct() )
612 {
613 $t->parse( "product_active_item", "product_active_item_tpl" );
614 }
615 else
616 {
617 $t->parse( "product_inactive_item", "product_inactive_item_tpl" );
618 }
619 // $t->set_var( "product_id", $product->id() );
620
621 $t->set_var( "category_id", $category->id() );
622
623 if ( isSet ( $DetailView ) )
624 {
625 if ( $category->sortMode() == "absolute_placement" )
626 {
627 $t->parse( "detail_absolute_placement_item", "detail_absolute_placement_item_tpl" );
628 }
629 else
630 {
631 $t->set_var( "detail_absolute_placement_item", "" );
632 }
633 }
634 else
635 {
636 if ( $category->sortMode() == "absolute_placement" )
637 {
638 $t->parse( "absolute_placement_item", "absolute_placement_item_tpl" );
639 }
640 else
641 {
642 $t->set_var( "absolute_placement_item", "" );
643 }
644 }
645
646 $t->set_var( "product_icon", "" );
647 $t->set_var( "voucher_icon", "" );
648 $t->set_var( "detail_product_icon", "" );
649 $t->set_var( "detail_voucher_icon", "" );
650
651 // If product type == 1, render the product object as a product
652 // If product type == 1, render the product object as a voucher
653 if ( isSet ( $DetailView ) )
654 {
655 if ( $product->productType() == 1 )
656 {
657 $t->set_var( "url_action", "productedit" );
658 $t->parse( "detail_product_icon", "detail_product_icon_tpl" );
659 }
660 if ( $product->productType() == 2 )
661 {
662 $t->set_var( "url_action", "voucher" );
663 $t->parse( "detail_voucher_icon", "detail_voucher_icon_tpl" );
664 }
665 }
666 else
667 {
668 if ( $product->productType() == 1 )
669 {
670 $t->set_var( "url_action", "productedit" );
671 $t->parse( "product_icon", "product_icon_tpl" );
672 }
673 if ( $product->productType() == 2 )
674 {
675 $t->set_var( "url_action", "voucher" );
676 $t->parse( "voucher_icon", "voucher_icon_tpl" );
677 }
678 }
679 // link list
680 $module_link = new eZModuleLink( "eZTrade", "Product", $product->id() );
681 $sections =& $module_link->sections();
682 $t->set_var( "section_item", "" );
683 foreach ( $sections as $section )
684 {
685 $t->set_var( "link_item", "" );
686 $t->set_var( "section_name", $section->name() );
687 $t->set_var( "section_id", $section->id() );
688 $links =& $section->links();
689 foreach ( $links as $link )
690 {
691 $t->set_var( "link_name", $link->name() );
692 $t->set_var( "link_url", $link->url() );
693 $t->set_var( "link_id", $link->id() );
694 $t->parse( "link_item", "link_item_tpl", true );
695 }
696 $t->parse( "section_item", "section_item_tpl", true );
697 }
698
699
700 // get additional images
701 $t->set_var( "image", "" );
702 $images = $product->images();
703
704 $t->set_var( "image", "" );
705 $t->set_var( "image_list", "" );
706 $image_count = 0;
707
708 foreach ( $images as $imageArray )
709 {
710 $image = $imageArray["Image"];
711
712 // $t->set_var( "image_name", $image->name() );
713 $t->set_var( "image_caption", eZTextTool::nl2br( $image->caption() ) );
714 // $t->set_var( "image_id", $image->id() );
715
716 $variation = $image->requestImageVariation( $hotDealImageWidth, $hotDealImageHeight );
717
718 $t->set_var( "image_url", "/" .$variation->imagePath() );
719 $t->set_var( "image_width", $variation->width() );
720 $t->set_var( "image_height", $variation->height() );
721 $t->parse( "image", "image_tpl", true );
722 }
723
724 // Set the detail or normail view
725 if ( isSet ( $DetailView ) )
726 {
727 $t->set_var( "product_item", "" );
728 $t->parse( "detail_view", "detail_view_tpl", true );
729 }
730 else
731 {
732 $t->set_var( "detail_view", "" );
733 $t->parse( "product_item", "product_item_tpl", true );
734 }
735
736 $i++;
737 }
738
739 if ( isSet ( $DetailView ) )
740 {
741 $t->set_var( "is_detail_view", "true" );
742 $t->set_var( "detail_button", "" );
743 $t->set_var( "normal_list", "" );
744 $t->parse( "update_button", "update_button_tpl" );
745 $t->parse( "normal_button", "normal_view_button" );
746 }
747 else
748 {
749 $t->set_var( "is_detail_view", "" );
750 $t->set_var( "normal_button", "" );
751 $t->set_var( "update_button", "" );
752 $t->parse( "detail_button", "detail_view_button" );
753 }
754
755 $t->set_var( "offset", $Offset );
756
757 /*
758 echo "TotalTypes:".$TotalTypes."<br>";
759 echo "Limit:".$Limit."<br>";
760 echo "Offset:".$Offset."<br>";
761 exit();
762 */
763
764 eZList::drawNavigator( $t, $TotalTypes, $Limit, $Offset, "product_list_tpl" );
765 /*
766 if ( $user )
767 {
768 $session->setVariable( "RedirectURL", "/trade/categorylist/parent/$ParentID/$Offset" );
769 }
770 */
771
772 if (( count( $productList ) > 0 ) and ( !isSet ($DetailView) ))
773 {
774 $t->parse( "product_list", "product_list_tpl" );
775 $t->parse( "normal_list", "normal_list_tpl" );
776 }
777
778 if ( count( $productList ) > 0 )
779 $t->parse( "product_list", "product_list_tpl" );
780 else
781 {
782 $t->set_var( "product_list", "" );
783 $t->set_var( "normal_list", "" );
784 }
785
786 $t->pparse( "output", "category_list_page_tpl" );
787
788 ?>
$category
if( $Action=="Edit") $category
Definition: adedit.php:378
$CategoryID
$CategoryID
Definition: admin/articleedit.php:53
$group
$group
Definition: admin/articleedit.php:799
$session
$session
Definition: admin/articlelist.php:44
$month
else $month
Definition: appointmentedit.php:660
$files
$files
Definition: articlepreview.php:91
$images
$images
Definition: articlepreview.php:146
eZBoxType
Definition: ezboxtype.php:40
eZDate
Definition: ezdate.php:46
eZList\drawNavigator
static drawNavigator(&$t, $total_types, $max_types, $index, $parent=false, $variables=false)
Definition: ezlist.php:401
eZLocale
Definition: ezlocale.php:119
eZModuleLink
Definition: ezmodulelink.php:65
eZProductCategory
Definition: ezproductcategory.php:90
eZSession\globalSession
static & globalSession( $id="", $fetch=true)
Definition: kernel/ezsession/classes/ezsession.php:614
eZShippingGroup
Definition: ezshippinggroup.php:44
eZTemplate
Definition: eztemplate.php:107
eZTextTool\nl2br
static nl2br( $string, $xhtml=true)
Definition: eztexttool.php:65
eZVATType
Definition: ezvattype.php:41
$module_link
$module_link
Definition: classes/admin/linklist.php:226
$sections
$sections
Definition: classes/admin/linklist.php:227
$type
$type
Definition: classes/admin/linkselect.php:220
$thumbnail
$thumbnail
Definition: ezarticle/admin/imagelist.php:59
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$groups
if( $CategoryID !=0) $groups
Definition: ezbulkmail/admin/categoryedit.php:108
$file
$file
Definition: ezfilemanager/user/filedownload.php:35
$j
$j
Definition: ezimagecatalogue/admin/imagelist.php:345
$section
$section
Definition: ezimagecatalogue/user/categoryedit.php:393
$variation
$variation
Definition: ezimagecatalogue/user/menubox.php:55
$link
$link
Definition: ezlink/admin/attributeedit.php:49
$Limit
$Limit
Definition: eztrade/admin/categorylist.php:62
$locale
$locale
Definition: eztrade/admin/categorylist.php:263
$t
$t
Definition: eztrade/admin/categorylist.php:70
$TotalTypes
$TotalTypes
Definition: eztrade/admin/categorylist.php:260
$ParentID
$ParentID
Definition: eztrade/admin/categorylist.php:171
$i
$i
Definition: eztrade/admin/categorylist.php:219
$Language
$Language
Definition: eztrade/admin/categorylist.php:61
$ini
$ini
Definition: eztrade/admin/categorylist.php:59
$hotDealImageHeight
$hotDealImageHeight
Definition: eztrade/admin/categorylist.php:64
$pathArray
if( $category->sortMode()=="absolute_placement") $pathArray
Definition: eztrade/admin/categorylist.php:202
$categoryList
foreach( $pathArray as $path) $categoryList
Definition: eztrade/admin/categorylist.php:216
deleteCache
deleteCache( $ProductID, $CategoryID, $CategoryArray)
Definition: eztrade/admin/categorylist.php:34
$checkMode
if(isSet( $DetailView)) if(isSet( $NormalView)) $checkMode
Definition: eztrade/admin/categorylist.php:85
$hotDealImageWidth
$hotDealImageWidth
Definition: eztrade/admin/categorylist.php:63
$ShowQuantity
$ShowQuantity
Definition: eztrade/admin/categorylist.php:65
$productList
$productList
Definition: eztrade/admin/categorylist.php:261
$PricesIncludeVAT
$PricesIncludeVAT
Definition: homepage.php:47
$product
$product
Definition: homepage.php:202
$options
$options
Definition: optionlist.php:56
$box
foreach( $vatTypes as $type) $box
Definition: productedit.php:1356
$VatType
$VatType
Definition: productedit.php:1076
$vat
foreach( $categoryArray as $catItem) $vat
Definition: productedit.php:1334
$BoxType
$BoxType
Definition: productedit.php:1077
$boxTypes
$boxTypes
Definition: productedit.php:1357
$vatTypes
$vatTypes
Definition: productedit.php:1335
$image_count
$image_count
Definition: productpreview.php:204
$Quantity
if( $product->catalogNumber() !="") $Quantity
Definition: productpreview.php:491
$image
$image
Definition: user/articlelist.php:242
$links
$links
Definition: user/linkcategorylist.php:181
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.