Permalink
Browse files

updated pricing

  • Loading branch information...
1 parent 2c86306 commit 1861da76dd5d9a30b30d3144a489adff79bc69bd @theodorDiaconu theodorDiaconu committed with iampersistent Jan 23, 2013
@@ -0,0 +1,67 @@
+<?php
+/**
+ * (c) 2012 Vespolina Project http://www.vespolina-project.org
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace Vespolina\Entity\Order;
+
+final class OrderEvents
+{
+ /**
+ * The order initialization order is is triggered after a new order is created and initialized
+ */
+ const INIT_ORDER = 'vespolina_order.order_init';
+
+ /**
+ * INIT_ITEM is triggered when an product is added to the order
+ */
+ const INIT_ITEM = 'vespolina_order.item_init';
+
+ /**
+ * After a pricing context has been created, following event is called to initialize the pricing context.
+ * The pricing context is typically used to inject context dependent pricing parameters
+ *
+ * For instance one could inject an explicit discount or tax percentage, possible
+ * overriding default parameters.
+ */
+ const INIT_PRICING_CONTEXT = 'vespolina_order.init_pricing_context';
+
+ /**
+ * The order finished event is triggered when all basic operations on a order have been completed
+ * For instance one first adds three items, adjust quantity and then triggers the order finished event
+ */
+ const FINISHED = 'vespolina_order.order_finished';
+
+ /**
+ * REMOVE_ITEM is triggered a product has been completely removed from a order
+ */
+ const REMOVE_ITEM = 'vespolina_order.item_remove';
+
+ /**
+ * UPDATE_ORDER is triggered to alert that an update to the order is needed
+ */
+ const UPDATE_ORDER = 'vespolina_order.order_update';
+
+ /**
+ * UPDATE_ORDER_PRICE is triggered to alert that the prices in the order are needed
+ */
+ const UPDATE_ORDER_PRICE = 'vespolina_order.order_update_price';
+
+ /**
+ * UPDATE_ORDER_STATE is triggered when the state of the order has changed
+ */
+ const UPDATE_ORDER_STATE = 'vespolina_order.order_update_state';
+
+ /**
+ * UPDATE_ITEM is triggered when the a quantity or options in a item as changed
+ */
+ const UPDATE_ITEM = 'vespolina_order.item_update';
+
+ /**
+ * UPDATE_ITEM_STATE is triggered when the state of an item in the order has changed
+ */
+ const UPDATE_ITEM_STATE = 'vespolina_order.item_update_state';
+}
@@ -48,4 +48,14 @@ public function all()
{
return $this->pricingElements;
}
+
+ function getNetValue()
+ {
+ // TODO: Implement getNetValue() method.
+ }
+
+ function getTotalValue()
+ {
+ // TODO: Implement getTotalValue() method.
+ }
}
@@ -14,6 +14,7 @@
use Vespolina\Entity\Product\OptionInterface;
use Vespolina\Entity\Product\OptionGroupInterface;
use Vespolina\Entity\Taxonomy\TaxonomyInterface;
+use Vespolina\Entity\Pricing\PricingSetInterface;
/**
* @author Richard D Shank <develop@zestic.com>
@@ -43,7 +44,7 @@
* @param $pricingSet
* @return array
*/
- public function setPricingSet($pricingSet)
+ public function setPricing(PricingSetInterface $pricingSet)
{
$this->pricingSet = $pricingSet;
@@ -53,7 +54,7 @@ public function setPricingSet($pricingSet)
/**
* @return array $priceSet
*/
- public function getPricingSet()
+ public function getPricing()
{
return $this->pricingSet;
}
@@ -9,6 +9,7 @@
namespace Vespolina\Entity\Product;
use Vespolina\Entity\Asset\AssetInterface;
+use Vespolina\Entity\Pricing\PricingSetInterface;
use Vespolina\Entity\Pricing\PricingSet;
use Vespolina\Entity\Product\BaseProduct;
use Vespolina\Entity\Product\MerchandiseInterface;
@@ -159,7 +160,7 @@ public function getDeactivateOn()
/**
* @inheritdoc
*/
- public function setPricing(PricingSet $pricing)
+ public function setPricing(PricingSetInterface $pricing)
{
$this->pricing = $pricing;
}
@@ -9,6 +9,7 @@
namespace Vespolina\Entity\Product;
use Vespolina\Entity\Asset\AssetInterface;
+use Vespolina\Entity\Pricing\PricingSetInterface;
use Vespolina\Entity\Pricing\PricingSet;
use Vespolina\Entity\Product\BaseProductInterface;
@@ -105,9 +106,10 @@ function getDeactivateOn();
/**
* Return the PricingSet for this merchandise
*
- * @param \Vespolina\Entity\Pricing\PricingSet $pricingSet
+ * @param \Vespolina\Entity\Pricing\PricingSetInterface $pricingSet
+ * @return
*/
- function setPricing(PricingSet $pricingSet);
+ function setPricing(PricingSetInterface $pricingSet);
/**
* Return the PricingSet for this merchandise

0 comments on commit 1861da7

Please sign in to comment.