BoxSize.php
972 Bytes
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
<?php
/**
*
* @author liuziyang
* @version
*/
/**
* BoxSize helper
*
* @uses viewHelper Zend_View_Helper
*/
class Web_View_Helper_BoxSize extends Zend_View_Helper_Abstract {
/**
* @var Zend_View_Interface
*/
public $view;
/**
*
*/
public function boxSize($sort_ids) {
$max_sort_id = empty($sort_ids['msort']) ? 0 : $sort_ids['msort'];
$middle_sort_id = empty($sort_ids['misort']) ? 0 : $sort_ids['misort'];
$small_sort_id = empty($sort_ids['sort']) ? 0 : $sort_ids['sort'];
if ($small_sort_id == 0) {
return null;
}
$this->view->boxSize = $boxSize = QINProduct_Models_Size_Client::getListBySort($small_sort_id);
$this->view->hasSizeOpt = 1;
if (empty($boxSize)) {
$this->view->hasSizeOpt = 0;
return null;
}
return $this->view->render('box/size.phtml');
}
/**
* Sets the view field
* @param $view Zend_View_Interface
*/
public function setView(Zend_View_Interface $view) {
$this->view = $view;
}
}