-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
1,024 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
/** | ||
* Pi Engine (http://pialog.org) | ||
* | ||
* @link http://code.pialog.org for the Pi Engine source repository | ||
* @copyright Copyright (c) Pi Engine http://pialog.org | ||
* @license http://pialog.org/license.txt New BSD License | ||
*/ | ||
|
||
/** | ||
* @author Hossein Azizabadi <[email protected]> | ||
*/ | ||
|
||
namespace Module\Order\Form\Element; | ||
|
||
use Pi; | ||
use Zend\Form\Element\Select; | ||
|
||
class Delivery extends Select | ||
{ | ||
/** | ||
* @return array | ||
*/ | ||
public function getValueOptions() | ||
{ | ||
if (empty($this->valueOptions)) { | ||
$list = array(); | ||
$where = array('location' => $this->options['location']); | ||
$select = Pi::model('location_delivery', 'order')->select()->where($where); | ||
$rowset = Pi::model('location_delivery', 'order')->selectWith($select); | ||
foreach ($rowset as $row) { | ||
$delivery = Pi::model('delivery', 'order')->find($row->delivery)->toArray(); | ||
if ($delivery['status']) { | ||
$list[$delivery['id']] = sprintf('%s - %s : %s - %s : %s %s' , | ||
$delivery['title'], | ||
__('Price'), | ||
Pi::api('api', 'order')->viewPrice($row->price), | ||
__('Time'), | ||
_number($row->delivery_time), | ||
__('Days') | ||
); | ||
} | ||
} | ||
$this->valueOptions = $list; | ||
} | ||
return $this->valueOptions; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.