55 lines
2.2 KiB
PHP
55 lines
2.2 KiB
PHP
<?php
|
|
/*************************************************************************************/
|
|
/* This file is part of the Thelia package. */
|
|
/* */
|
|
/* Copyright (c) OpenStudio */
|
|
/* email : dev@thelia.net */
|
|
/* web : http://www.thelia.net */
|
|
/* */
|
|
/* For the full copyright and license information, please view the LICENSE.txt */
|
|
/* file that was distributed with this source code. */
|
|
/*************************************************************************************/
|
|
|
|
namespace Thelia\Module;
|
|
|
|
use Thelia\Model\Country;
|
|
use Thelia\Model\OrderPostage;
|
|
use Thelia\Model\State;
|
|
use Thelia\Module\Exception\DeliveryException;
|
|
|
|
interface DeliveryModuleWithStateInterface extends BaseModuleInterface
|
|
{
|
|
/**
|
|
* 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/
|
|
*
|
|
* If you return true, the delivery method will de displayed to the customer
|
|
* If you return false, the delivery method will not be displayed
|
|
*
|
|
* @param Country $country the country to deliver to.
|
|
* @param State $state
|
|
*
|
|
* @return boolean
|
|
*/
|
|
public function isValidDelivery(Country $country, State $state = null);
|
|
|
|
/**
|
|
* Calculate and return delivery price in the shop's default currency
|
|
*
|
|
* @param Country $country the country to deliver to.
|
|
* @param State $state
|
|
*
|
|
* @return OrderPostage|float the delivery price
|
|
* @throws DeliveryException if the postage price cannot be calculated.
|
|
*/
|
|
public function getPostage(Country $country, State $state = null);
|
|
|
|
/**
|
|
*
|
|
* This method return true if your delivery manages virtual product delivery.
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function handleVirtualProductDelivery();
|
|
}
|