Added the AbstractDeliveryModule class, and the isValidDelivery method.

This commit is contained in:
Franck Allimant
2014-04-17 18:57:04 +02:00
parent 834045366e
commit e0079096dd
3 changed files with 178 additions and 109 deletions

View File

@@ -28,11 +28,24 @@ use Thelia\Model\Country;
interface DeliveryModuleInterface extends BaseModuleInterface
{
/**
* calculate and return delivery price
* This method is called by the Delivery loop, to check if the current module has to be displayed to the customer.
* Override it to implements your delivery rules/
*
* @param Country $country
* If you return true, the delivery method will de displayed to the customer
* If you return false, the delivery method will not be displayed
*
* @return mixed
* @param Country $country the country to deliver to.
*
* @return boolean
*/
public function isValidDelivery(Country $country);
/**
* Calculate and return delivery price in the shop's default currency
*
* @param Country $country the country to deliver to.
*
* @return float the delivery price
*/
public function getPostage(Country $country);
}