Init Coupon module design
This commit is contained in:
115
core/lib/Thelia/Coupon/CouponAbstract.php
Normal file
115
core/lib/Thelia/Coupon/CouponAbstract.php
Normal file
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Coupon;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* Assist in writing a CouponInterface
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
abstract class CouponAbstract implements CouponInterface
|
||||
{
|
||||
/** @var RuleOrganizerInterface */
|
||||
protected $organizer = null;
|
||||
|
||||
|
||||
/**
|
||||
* Return Coupon code (ex: XMAS)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCode()
|
||||
{
|
||||
// TODO: Implement getCode() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* Return Coupon title (ex: Coupon for XMAS)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
// TODO: Implement getTitle() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* Return Coupon short description
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getShortDescription()
|
||||
{
|
||||
// TODO: Implement getShortDescription() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* Return Coupon description
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
// TODO: Implement getDescription() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* If Coupon is cumulative or prevent any accumulation
|
||||
* If is cumulative you can sum Coupon effects
|
||||
* If not cancel all other Coupon and take the last given
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function isCumulative()
|
||||
{
|
||||
// TODO: Implement isCumulative() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* If Coupon is removing Checkout Postage
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isRemovingPostage()
|
||||
{
|
||||
// TODO: Implement isRemovingPostage() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* Return effects generated by the coupon
|
||||
*
|
||||
* @return \Closure
|
||||
*/
|
||||
public function getEffect()
|
||||
{
|
||||
// TODO: Implement getEffect() method.
|
||||
}
|
||||
|
||||
}
|
||||
60
core/lib/Thelia/Coupon/CouponAdapterInterface.php
Normal file
60
core/lib/Thelia/Coupon/CouponAdapterInterface.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Coupon;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* Allow a CouponManager class to be fed with relevant Thelia data
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
interface CouponAdapterInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* Return a Cart a CouponManager can process
|
||||
*
|
||||
* @return \Thelia\Model\Cart
|
||||
*/
|
||||
public function getCart();
|
||||
|
||||
/**
|
||||
* Return an Address a CouponManager can process
|
||||
*
|
||||
* @return \Thelia\Model\Address
|
||||
*/
|
||||
public function getDeliveryAddress();
|
||||
|
||||
/**
|
||||
* Return an Customer a CouponManager can process
|
||||
*
|
||||
* @return \Thelia\Model\Customer
|
||||
*/
|
||||
public function getCustomer();
|
||||
}
|
||||
67
core/lib/Thelia/Coupon/CouponBaseAdapter.php
Normal file
67
core/lib/Thelia/Coupon/CouponBaseAdapter.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Coupon;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class CouponBaseAdapter implements CouponAdapterInterface
|
||||
{
|
||||
/**
|
||||
* Return a Cart a CouponManager can process
|
||||
*
|
||||
* @return \Thelia\Model\Cart
|
||||
*/
|
||||
public function getCart()
|
||||
{
|
||||
// TODO: Implement getCart() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an Address a CouponManager can process
|
||||
*
|
||||
* @return \Thelia\Model\Address
|
||||
*/
|
||||
public function getDeliveryAddress()
|
||||
{
|
||||
// TODO: Implement getDeliveryAddress() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an Customer a CouponManager can process
|
||||
*
|
||||
* @return \Thelia\Model\Customer
|
||||
*/
|
||||
public function getCustomer()
|
||||
{
|
||||
// TODO: Implement getCustomer() method.
|
||||
}
|
||||
|
||||
}
|
||||
49
core/lib/Thelia/Coupon/CouponFactory.php
Normal file
49
core/lib/Thelia/Coupon/CouponFactory.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Coupon;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* Generate a CouponInterface
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class CouponFactory
|
||||
{
|
||||
/**
|
||||
* Build a CouponInterface from its database data
|
||||
*
|
||||
* @param int $couponId CouponInterface id
|
||||
*
|
||||
* @return CouponInterface ready to be processed
|
||||
*/
|
||||
public function buildCouponFromId($couponId)
|
||||
{
|
||||
}
|
||||
}
|
||||
89
core/lib/Thelia/Coupon/CouponInterface.php
Normal file
89
core/lib/Thelia/Coupon/CouponInterface.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Coupon;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* Represents a Coupon ready to be processed in a Checkout process
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
interface CouponInterface
|
||||
{
|
||||
/**
|
||||
* Return Coupon code (ex: XMAS)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCode();
|
||||
|
||||
/**
|
||||
* Return Coupon title (ex: Coupon for XMAS)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle();
|
||||
|
||||
/**
|
||||
* Return Coupon short description
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getShortDescription();
|
||||
|
||||
/**
|
||||
* Return Coupon description
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription();
|
||||
|
||||
/**
|
||||
* If Coupon is cumulative or prevent any accumulation
|
||||
* If is cumulative you can sum Coupon effects
|
||||
* If not cancel all other Coupon and take the last given
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function isCumulative();
|
||||
|
||||
/**
|
||||
* If Coupon is removing Checkout Postage
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isRemovingPostage();
|
||||
|
||||
/**
|
||||
* Return effects generated by the coupon
|
||||
*
|
||||
* @return \Closure
|
||||
*/
|
||||
public function getEffect();
|
||||
}
|
||||
54
core/lib/Thelia/Coupon/CouponManager.php
Normal file
54
core/lib/Thelia/Coupon/CouponManager.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Coupon;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* Manage how Coupons could interact with a Checkout
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class CouponManager
|
||||
{
|
||||
/** @var CouponAdapterInterface Provide necessary value from Thelia*/
|
||||
protected $adapter;
|
||||
|
||||
/** @var array CouponInterface to process*/
|
||||
protected $coupons = array();
|
||||
|
||||
/**
|
||||
* Get Discount for the given Coupons
|
||||
*
|
||||
* @return float checkout discount
|
||||
*/
|
||||
public function getDiscount()
|
||||
{
|
||||
return 10.00;
|
||||
}
|
||||
}
|
||||
38
core/lib/Thelia/Coupon/Rule/AvailableForDate.php
Normal file
38
core/lib/Thelia/Coupon/Rule/AvailableForDate.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Coupon\Rule;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class AvailableForDate extends AvailableForPeriod
|
||||
{
|
||||
|
||||
}
|
||||
38
core/lib/Thelia/Coupon/Rule/AvailableForLocationX.php
Normal file
38
core/lib/Thelia/Coupon/Rule/AvailableForLocationX.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Coupon\Rule;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class AvailableForLocationX extends CouponRuleAbstract
|
||||
{
|
||||
|
||||
}
|
||||
38
core/lib/Thelia/Coupon/Rule/AvailableForNbArticles.php
Normal file
38
core/lib/Thelia/Coupon/Rule/AvailableForNbArticles.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Coupon\Rule;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class AvailableForNbArticles extends CouponRuleAbstract
|
||||
{
|
||||
|
||||
}
|
||||
38
core/lib/Thelia/Coupon/Rule/AvailableForPeriod.php
Normal file
38
core/lib/Thelia/Coupon/Rule/AvailableForPeriod.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Coupon\Rule;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class AvailableForPeriod extends CouponRuleAbstract
|
||||
{
|
||||
|
||||
}
|
||||
38
core/lib/Thelia/Coupon/Rule/AvailableForRepeatedDate.php
Normal file
38
core/lib/Thelia/Coupon/Rule/AvailableForRepeatedDate.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Coupon\Rule;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class AvailableForRepeatedDate extends AvailableForDate
|
||||
{
|
||||
|
||||
}
|
||||
38
core/lib/Thelia/Coupon/Rule/AvailableForRepeatedPeriod.php
Normal file
38
core/lib/Thelia/Coupon/Rule/AvailableForRepeatedPeriod.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Coupon\Rule;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class AvailableForRepeatedPeriod extends AvailableForPeriod
|
||||
{
|
||||
|
||||
}
|
||||
38
core/lib/Thelia/Coupon/Rule/AvailableForTotalAmount.php
Normal file
38
core/lib/Thelia/Coupon/Rule/AvailableForTotalAmount.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Coupon\Rule;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class AvailableForTotalAmount extends CouponRuleAbstract
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Coupon\Rule;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class AvailableForTotalAmountForCategoryY extends AvailableForTotalAmount
|
||||
{
|
||||
|
||||
}
|
||||
69
core/lib/Thelia/Coupon/Rule/CouponRuleAbstract.php
Normal file
69
core/lib/Thelia/Coupon/Rule/CouponRuleAbstract.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Coupon\Rule;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* Assist in writing a condition of whether the Rule is applied or not
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class CouponRuleAbstract implements CuponRuleInterface
|
||||
{
|
||||
/**
|
||||
* Check if backoffice inputs are relevant or not
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function checkBackOfficeIntput()
|
||||
{
|
||||
// TODO: Implement checkBackOfficeIntput() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if Checkout inputs are relevant or not
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function checkCheckoutInput()
|
||||
{
|
||||
// TODO: Implement checkCheckoutInput() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the current Checkout matchs this condition
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isMatching()
|
||||
{
|
||||
// TODO: Implement isMatching() method.
|
||||
}
|
||||
|
||||
}
|
||||
60
core/lib/Thelia/Coupon/Rule/CuponRuleInterface.php
Normal file
60
core/lib/Thelia/Coupon/Rule/CuponRuleInterface.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Coupon\Rule;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* Represents a condition of whether the Rule is applied or not
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
interface CuponRuleInterface
|
||||
{
|
||||
/**
|
||||
* Check if backoffice inputs are relevant or not
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function checkBackOfficeIntput();
|
||||
|
||||
/**
|
||||
* Check if Checkout inputs are relevant or not
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function checkCheckoutInput();
|
||||
|
||||
/**
|
||||
* Check if the current Checkout matchs this condition
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isMatching();
|
||||
|
||||
}
|
||||
51
core/lib/Thelia/Coupon/RuleOrganizer.php
Normal file
51
core/lib/Thelia/Coupon/RuleOrganizer.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Coupon;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* Manage how Coupons could interact with a Checkout
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class RuleOrganizer implements RuleOrganizerInterface
|
||||
{
|
||||
/**
|
||||
* Organize CouponRuleInterface
|
||||
*
|
||||
* @param array $rules Array of CouponRuleInterface
|
||||
*
|
||||
* @return array Array of CouponRuleInterface sorted
|
||||
*/
|
||||
public function organize(array $rules)
|
||||
{
|
||||
// TODO: Implement organize() method.
|
||||
}
|
||||
|
||||
}
|
||||
47
core/lib/Thelia/Coupon/RuleOrganizerInterface.php
Normal file
47
core/lib/Thelia/Coupon/RuleOrganizerInterface.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Coupon;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* Manage how Coupons could interact with a Checkout
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
interface RuleOrganizerInterface
|
||||
{
|
||||
/**
|
||||
* Organize CouponRuleInterface
|
||||
*
|
||||
* @param array $rules Array of CouponRuleInterface
|
||||
*
|
||||
* @return array Array of CouponRuleInterface sorted
|
||||
*/
|
||||
public function organize(array $rules);
|
||||
}
|
||||
40
core/lib/Thelia/Coupon/Type/RemoveXAmount.php
Normal file
40
core/lib/Thelia/Coupon/Type/RemoveXAmount.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Coupon\Type;
|
||||
|
||||
use Thelia\Coupon\CouponAbstract;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class RemoveXAmount extends CouponAbstract
|
||||
{
|
||||
|
||||
}
|
||||
38
core/lib/Thelia/Coupon/Type/RemoveXAmountForCategoryY.php
Normal file
38
core/lib/Thelia/Coupon/Type/RemoveXAmountForCategoryY.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Coupon\Type;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class RemoveXAmountForCategoryY extends RemoveXAmount
|
||||
{
|
||||
|
||||
}
|
||||
38
core/lib/Thelia/Coupon/Type/RemoveXPercent.php
Normal file
38
core/lib/Thelia/Coupon/Type/RemoveXPercent.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Coupon\Type;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class RemoveXPercent extends CouponAbstract
|
||||
{
|
||||
|
||||
}
|
||||
38
core/lib/Thelia/Coupon/Type/RemoveXPercentForAttributeY.php
Normal file
38
core/lib/Thelia/Coupon/Type/RemoveXPercentForAttributeY.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Coupon\Type;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class RemoveXPercentForAttributeY extends RemoveXPercent
|
||||
{
|
||||
|
||||
}
|
||||
38
core/lib/Thelia/Coupon/Type/RemoveXPercentForCategoryY.php
Normal file
38
core/lib/Thelia/Coupon/Type/RemoveXPercentForCategoryY.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Coupon\Type;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class RemoveXPercentForCategoryY extends RemoveXPercent
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Coupon\Type;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class RemoveXPercentForProductSaleElementIdY extends RemoveXPercent
|
||||
{
|
||||
|
||||
}
|
||||
38
core/lib/Thelia/Coupon/Type/RemoveXPercentForProductY.php
Normal file
38
core/lib/Thelia/Coupon/Type/RemoveXPercentForProductY.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Coupon\Type;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class RemoveXPercentForProductY extends RemoveXPercent
|
||||
{
|
||||
|
||||
}
|
||||
66
core/lib/Thelia/Tests/Coupon/CouponBaseAdapterTest.php
Normal file
66
core/lib/Thelia/Tests/Coupon/CouponBaseAdapterTest.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
namespace Thelia\Coupon;
|
||||
|
||||
/**
|
||||
* Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2013-08-19 at 18:26:01.
|
||||
*/
|
||||
class CouponBaseAdapterTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @var CouponBaseAdapter
|
||||
*/
|
||||
protected $object;
|
||||
|
||||
/**
|
||||
* Sets up the fixture, for example, opens a network connection.
|
||||
* This method is called before a test is executed.
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
$this->object = new CouponBaseAdapter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tears down the fixture, for example, closes a network connection.
|
||||
* This method is called after a test is executed.
|
||||
*/
|
||||
protected function tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Thelia\Coupon\CouponBaseAdapter::getCart
|
||||
* @todo Implement testGetCart().
|
||||
*/
|
||||
public function testGetCart()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Thelia\Coupon\CouponBaseAdapter::getDeliveryAddress
|
||||
* @todo Implement testGetDeliveryAddress().
|
||||
*/
|
||||
public function testGetDeliveryAddress()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Thelia\Coupon\CouponBaseAdapter::getCustomer
|
||||
* @todo Implement testGetCustomer().
|
||||
*/
|
||||
public function testGetCustomer()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
}
|
||||
42
core/lib/Thelia/Tests/Coupon/CouponFactoryTest.php
Normal file
42
core/lib/Thelia/Tests/Coupon/CouponFactoryTest.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
namespace Thelia\Coupon;
|
||||
|
||||
/**
|
||||
* Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2013-08-19 at 18:06:16.
|
||||
*/
|
||||
class CouponFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @var CouponFactory
|
||||
*/
|
||||
protected $object;
|
||||
|
||||
/**
|
||||
* Sets up the fixture, for example, opens a network connection.
|
||||
* This method is called before a test is executed.
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
$this->object = new CouponFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tears down the fixture, for example, closes a network connection.
|
||||
* This method is called after a test is executed.
|
||||
*/
|
||||
protected function tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Thelia\Coupon\CouponFactory::buildCouponFromId
|
||||
* @todo Implement testBuildCouponFromId().
|
||||
*/
|
||||
public function testBuildCouponFromId()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
}
|
||||
42
core/lib/Thelia/Tests/Coupon/CouponManagerTest.php
Normal file
42
core/lib/Thelia/Tests/Coupon/CouponManagerTest.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
namespace Thelia\Coupon;
|
||||
|
||||
/**
|
||||
* Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2013-08-19 at 18:05:02.
|
||||
*/
|
||||
class CouponManagerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @var CouponManager
|
||||
*/
|
||||
protected $object;
|
||||
|
||||
/**
|
||||
* Sets up the fixture, for example, opens a network connection.
|
||||
* This method is called before a test is executed.
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
$this->object = new CouponManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tears down the fixture, for example, closes a network connection.
|
||||
* This method is called after a test is executed.
|
||||
*/
|
||||
protected function tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Thelia\Coupon\CouponManager::getDiscount
|
||||
* @todo Implement testGetDiscount().
|
||||
*/
|
||||
public function testGetDiscount()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace Thelia\Coupon;
|
||||
|
||||
/**
|
||||
* Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2013-08-19 at 18:26:01.
|
||||
*/
|
||||
class RemoveXAmountForCategoryYTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Sets up the fixture, for example, opens a network connection.
|
||||
* This method is called before a test is executed.
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Tears down the fixture, for example, closes a network connection.
|
||||
* This method is called after a test is executed.
|
||||
*/
|
||||
protected function tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
42
core/lib/Thelia/Tests/Coupon/RuleOrganizerTest.php
Normal file
42
core/lib/Thelia/Tests/Coupon/RuleOrganizerTest.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
namespace Thelia\Coupon;
|
||||
|
||||
/**
|
||||
* Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2013-08-19 at 18:27:07.
|
||||
*/
|
||||
class RuleOrganizerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @var RuleOrganizer
|
||||
*/
|
||||
protected $object;
|
||||
|
||||
/**
|
||||
* Sets up the fixture, for example, opens a network connection.
|
||||
* This method is called before a test is executed.
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
$this->object = new RuleOrganizer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tears down the fixture, for example, closes a network connection.
|
||||
* This method is called after a test is executed.
|
||||
*/
|
||||
protected function tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Thelia\Coupon\RuleOrganizer::organize
|
||||
* @todo Implement testOrganize().
|
||||
*/
|
||||
public function testOrganize()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace Thelia\Coupon;
|
||||
|
||||
/**
|
||||
* Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2013-08-19 at 18:26:01.
|
||||
*/
|
||||
class RemoveXAmountForCategoryYTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Sets up the fixture, for example, opens a network connection.
|
||||
* This method is called before a test is executed.
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Tears down the fixture, for example, closes a network connection.
|
||||
* This method is called after a test is executed.
|
||||
*/
|
||||
protected function tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
26
core/lib/Thelia/Tests/Coupon/Type/RemoveXAmountTest.php
Normal file
26
core/lib/Thelia/Tests/Coupon/Type/RemoveXAmountTest.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace Thelia\Coupon;
|
||||
|
||||
/**
|
||||
* Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2013-08-19 at 18:26:01.
|
||||
*/
|
||||
class RemoveXAmountTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Sets up the fixture, for example, opens a network connection.
|
||||
* This method is called before a test is executed.
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Tears down the fixture, for example, closes a network connection.
|
||||
* This method is called after a test is executed.
|
||||
*/
|
||||
protected function tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace Thelia\Coupon;
|
||||
|
||||
/**
|
||||
* Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2013-08-19 at 18:26:01.
|
||||
*/
|
||||
class RemoveXPercenForCategoryYTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Sets up the fixture, for example, opens a network connection.
|
||||
* This method is called before a test is executed.
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Tears down the fixture, for example, closes a network connection.
|
||||
* This method is called after a test is executed.
|
||||
*/
|
||||
protected function tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
26
core/lib/Thelia/Tests/Coupon/Type/RemoveXPercentTest.php
Normal file
26
core/lib/Thelia/Tests/Coupon/Type/RemoveXPercentTest.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace Thelia\Coupon;
|
||||
|
||||
/**
|
||||
* Generated by PHPUnit_SkeletonGenerator 1.2.1 on 2013-08-19 at 18:26:01.
|
||||
*/
|
||||
class RemoveXPercentTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Sets up the fixture, for example, opens a network connection.
|
||||
* This method is called before a test is executed.
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Tears down the fixture, for example, closes a network connection.
|
||||
* This method is called after a test is executed.
|
||||
*/
|
||||
protected function tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user