Free shipping restricitions based on Countries and Shipping module

This commit is contained in:
Franck Allimant
2014-05-16 10:30:15 +02:00
parent ffd842cbf6
commit 90947bcda9
24 changed files with 7358 additions and 25 deletions

View File

@@ -3,8 +3,25 @@
namespace Thelia\Model;
use Thelia\Model\Base\OrderCoupon as BaseOrderCoupon;
use Thelia\Model\Base\OrderCouponCountryQuery;
class OrderCoupon extends BaseOrderCoupon
{
/**
* Return the countries for which free shipping is valid
* @return array|mixed|\Propel\Runtime\Collection\ObjectCollection
*/
public function getFreeShippingForCountries() {
return OrderCouponCountryQuery::create()->filterByOrderCoupon($this)->find();
}
/**
* Return the modules for which free shipping is valid
*
* @return array|mixed|\Propel\Runtime\Collection\ObjectCollection
*/
public function getFreeShippingForModules() {
return OrderCouponModuleQuery::create()->filterByOrderCoupon($this)->find();
}
}