cart integration
This commit is contained in:
@@ -37,7 +37,7 @@ class LoopResult implements \Iterator
|
||||
public function __construct($modelCollection = null)
|
||||
{
|
||||
$this->position = 0;
|
||||
if ($modelCollection instanceof ObjectCollection || $modelCollection instanceof PropelModelPager) {
|
||||
if ($modelCollection instanceof ObjectCollection || $modelCollection instanceof PropelModelPager || is_array($modelCollection)) {
|
||||
$this->modelCollection = $modelCollection;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,9 +73,14 @@ class Feed extends BaseLoop
|
||||
|
||||
$limit = min(count($items), $this->getLimit());
|
||||
|
||||
$loopResult = new LoopResult();
|
||||
|
||||
$indexes = array();
|
||||
for ($idx = 0; $idx < $limit; $idx++) {
|
||||
$indexes[] = $idx;
|
||||
}
|
||||
|
||||
$loopResult = new LoopResult($query);
|
||||
|
||||
foreach ($indexes as $idx) {
|
||||
|
||||
$item = $items[$idx];
|
||||
|
||||
@@ -87,7 +92,7 @@ class Feed extends BaseLoop
|
||||
|
||||
$date = $item->get_date('d/m/Y');
|
||||
|
||||
$loopResultRow = new LoopResultRow();
|
||||
$loopResultRow = new LoopResultRow($loopResult, $item, $this->versionable, $this->timestampable, $this->countable);
|
||||
|
||||
$loopResultRow->set("URL", $item->get_permalink());
|
||||
$loopResultRow->set("TITLE", $item->get_title());
|
||||
|
||||
@@ -23,13 +23,16 @@
|
||||
|
||||
namespace Thelia\Module;
|
||||
|
||||
use Thelia\Model\Country;
|
||||
|
||||
interface DeliveryModuleInterface extends BaseModuleInterface
|
||||
{
|
||||
/**
|
||||
*
|
||||
* calculate and return delivery price
|
||||
*
|
||||
* @param Country $country
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function calculate($country = null);
|
||||
public function calculate(Country $country);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace Colissimo;
|
||||
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Thelia\Model\Country;
|
||||
use Thelia\Module\BaseModule;
|
||||
use Thelia\Module\DeliveryModuleInterface;
|
||||
|
||||
@@ -57,10 +58,10 @@ class Colissimo extends BaseModule implements DeliveryModuleInterface
|
||||
*
|
||||
* calculate and return delivery price
|
||||
*
|
||||
* @param null $country
|
||||
* @param Country $country
|
||||
* @return mixed
|
||||
*/
|
||||
public function calculate($country = null)
|
||||
public function calculate(Country $country)
|
||||
{
|
||||
// TODO: Implement calculate() method.
|
||||
return 2;
|
||||
|
||||
Reference in New Issue
Block a user