Permalink
Browse files

Changed from using vespolina_address to payment profile for the billi…

…ng state, this is inline with the state that's being displayed
  • Loading branch information...
1 parent d768afe commit 028b3d03dce1805b8a877a8605be0beec79dfd49 @jmgtan jmgtan committed with iampersistent Feb 6, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/ImmersiveLabs/Pricing/Provider/OrderPricingProvider.php
@@ -55,10 +55,10 @@ public function determineOrderPrices(OrderInterface $order, PricingContextInterf
// example taxRates : 0.10 for 10%, 0.25 for 25%
if ($partner = $pricingContext['partner']) {
/** @var $partner \Vespolina\Entity\Partner\Partner */
- if (count($partner->getAddresses())) {
+ if (count($partner->getPreferredPaymentProfile())) {
/** @var $address \Vespolina\Entity\Partner\AddressInterface */
- $address = $partner->getAddresses()->get(0);
- $rate = $this->taxProvider->getTaxForAddress($address);
+ $paymentProfile = $partner->getPreferredPaymentProfile();
+ $rate = $this->taxProvider->getTaxByState($paymentProfile->getBillingState());
$totalTax = $itemsTotalNet * $rate;
$orderPricingSet->set('taxRate', $rate);
$orderPricingSet->set('taxes', $totalTax);

0 comments on commit 028b3d0

Please sign in to comment.