Skip to content
This repository has been archived by the owner on May 30, 2019. It is now read-only.

Commit

Permalink
Fixed admin order page for Shipping
Browse files Browse the repository at this point in the history
* Fixed tests
  • Loading branch information
mmoreram committed Jun 11, 2015
1 parent 342c4a1 commit 66d3681
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
<h3 class="fw-n">{{ 'admin.order.field.carrier'|trans }}</h3>
<i class="icon-truck"></i>
{# TODO: Extract carrier_name from the shown order #}
{{ carrier_name|default('Default') }} ( {{ order.shippingAmount|print_money }} )
{{ order.shippingMethod.carrierName }} ( {{ order.shippingAmount|print_money }} )
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/Elcodi/Admin/PaymentBundle/AdminPaymentBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
use Symfony\Component\Console\Application;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\HttpKernel\KernelInterface;

use Elcodi\Admin\PaymentBundle\DependencyInjection\AdminPaymentExtension;
use Elcodi\Bundle\CoreBundle\Interfaces\DependentBundleInterface;
use Symfony\Component\HttpKernel\KernelInterface;

/**
* Class AdminPaymentBundle
Expand Down
2 changes: 1 addition & 1 deletion src/Elcodi/Admin/StoreBundle/AdminStoreBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
use Symfony\Component\Console\Application;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\HttpKernel\KernelInterface;

use Elcodi\Admin\StoreBundle\DependencyInjection\AdminStoreExtension;
use Elcodi\Bundle\CoreBundle\Interfaces\DependentBundleInterface;
use Symfony\Component\HttpKernel\KernelInterface;

/**
* Class AdminStoreBundle
Expand Down
2 changes: 1 addition & 1 deletion src/Elcodi/Bridge/BehatBridgeBundle/DoctrineContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function prepare(BeforeScenarioScope $scope)
->executeCommand('doctrine:fixtures:load', [
'--fixtures' => $this
->kernel
->getRootDir() . '/../src/Elcodi/Fixtures',
->getRootDir() . '/../src/Elcodi',
])
->laodLocationFixtures()
->executeCommand('elcodi:plugins:load')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
use Symfony\Component\Console\Application;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\HttpKernel\KernelInterface;

use Elcodi\Bridge\PaymentSuiteBridgeBundle\DependencyInjection\ElcodiPaymentSuiteBridgeExtension;
use Elcodi\Bundle\CoreBundle\Interfaces\DependentBundleInterface;
use Symfony\Component\HttpKernel\KernelInterface;

/**
* Class ElcodiPaymentSuiteBridgeBundle
Expand Down
2 changes: 1 addition & 1 deletion src/Elcodi/Fixtures/DataFixtures/ORM/Store/StoreData.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function load(ObjectManager $manager)
*/
$storeDirector = $this->getDirector('store');
$address = $this->getReference('address-home');
$language = $this->getReference('language-es');
$language = $this->getReference('language-en');
$currency = $this->getReference('currency-EUR');

$imagePath = realpath(dirname(__FILE__) . '/images/wallpaper.jpg');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\HttpKernel\KernelInterface;

use Elcodi\Bundle\CoreBundle\Interfaces\DependentBundleInterface;
use Elcodi\Component\Plugin\Interfaces\PluginInterface;
use Elcodi\Plugin\CustomShippingBundle\CompilerPass\MappingCompilerPass;
use Elcodi\Plugin\CustomShippingBundle\DependencyInjection\ElcodiCustomShippingExtension;
use Symfony\Component\HttpKernel\KernelInterface;

/**
* Class ElcodiCustomShippingBundle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ public function __construct(
CarrierRepository $carrierRepository,
CurrencyConverter $currencyConverter,
ZoneMatcher $zoneMatcher
)
{
) {
$this->plugin = $plugin;
$this->carrierRepository = $carrierRepository;
$this->currencyConverter = $currencyConverter;
Expand All @@ -95,7 +94,6 @@ public function addCustomShippingMethods(ShippingCollectionEvent $event)
->plugin
->isEnabled()
) {

return $this;
}

Expand Down Expand Up @@ -157,8 +155,7 @@ private function getAllShippingRangesSatisfiedWithCart(CartInterface $cart)
private function getShippingRangesSatisfiedByCart(
CartInterface $cart,
CarrierInterface $carrier
)
{
) {
$shippingRanges = $carrier->getRanges();
$validShippingRanges = [];

Expand Down Expand Up @@ -187,8 +184,7 @@ private function getShippingRangesSatisfiedByCart(
private function isShippingRangeSatisfiedByCart(
CartInterface $cart,
ShippingRangeInterface $shippingRange
)
{
) {
if ($shippingRange->getType() === ElcodiShippingRangeTypes::TYPE_PRICE) {
return $this->isShippingPriceRangeSatisfiedByCart($cart, $shippingRange);
} elseif ($shippingRange->getType() === ElcodiShippingRangeTypes::TYPE_WEIGHT) {
Expand All @@ -209,8 +205,7 @@ private function isShippingRangeSatisfiedByCart(
private function isShippingPriceRangeSatisfiedByCart(
CartInterface $cart,
ShippingRangeInterface $shippingRange
)
{
) {
$cartPrice = $cart->getProductAmount();
$cartPriceCurrency = $cartPrice->getCurrency();
$shippingRangeFromPrice = $shippingRange->getFromPrice();
Expand Down Expand Up @@ -243,8 +238,7 @@ private function isShippingPriceRangeSatisfiedByCart(
private function isShippingWeightRangeSatisfiedByCart(
CartInterface $cart,
ShippingRangeInterface $shippingRange
)
{
) {
$cartWeight = $cart->getWeight();
$cartRangeFromWeight = $shippingRange->getFromWeight();
$cartRangeToWeight = $shippingRange->getToWeight();
Expand All @@ -270,8 +264,7 @@ private function isShippingWeightRangeSatisfiedByCart(
private function isShippingRangeZonesSatisfiedByCart(
CartInterface $cart,
ShippingRangeInterface $shippingRange
)
{
) {
$deliveryAddress = $cart->getDeliveryAddress();

return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Elcodi package.
*
* Copyright (c) 2014 Elcodi.com
* Copyright (c) 2014-2015 Elcodi.com
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/*
* This file is part of the Elcodi package.
*
* Copyright (c) 2014 Elcodi.com
* Copyright (c) 2014-2015 Elcodi.com
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
namespace Elcodi\Plugin\CustomShippingBundle\Tests\UnitTest\EventListener;

use Doctrine\Common\Collections\ArrayCollection;
use Elcodi\Component\Plugin\Entity\Plugin;
use PHPUnit_Framework_TestCase;
use Prophecy\Argument;

use Elcodi\Component\Cart\Entity\Interfaces\CartInterface;
use Elcodi\Component\Currency\Entity\Currency;
use Elcodi\Component\Currency\Entity\Money;
use Elcodi\Component\Currency\Services\CurrencyConverter;
use Elcodi\Component\Plugin\Entity\Plugin;
use Elcodi\Component\Shipping\Entity\ShippingMethod;
use Elcodi\Component\Shipping\Event\ShippingCollectionEvent;
use Elcodi\Component\Zone\Services\ZoneMatcher;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
use Symfony\Component\Console\Application;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\HttpKernel\KernelInterface;

use Elcodi\Bundle\CoreBundle\Interfaces\DependentBundleInterface;
use Elcodi\Component\Plugin\Interfaces\PluginInterface;
use Elcodi\Plugin\FreePaymentBundle\DependencyInjection\ElcodiFreePaymentExtension;
use Symfony\Component\HttpKernel\KernelInterface;

/**
* Class ElcodiFreePaymentBundle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
use Symfony\Component\Console\Application;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\HttpKernel\KernelInterface;

use Elcodi\Bundle\CoreBundle\Interfaces\DependentBundleInterface;
use Elcodi\Component\Plugin\Interfaces\PluginInterface;
use Elcodi\Plugin\PaypalWebCheckoutBundle\DependencyInjection\ElcodiPaypalWebCheckoutExtension;
use Symfony\Component\HttpKernel\KernelInterface;

/**
* Class ElcodiPaypalWebCheckoutBundle
Expand Down
2 changes: 1 addition & 1 deletion src/Elcodi/Plugin/StripeBundle/ElcodiStripeBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
use Symfony\Component\Console\Application;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\HttpKernel\KernelInterface;

use Elcodi\Bundle\CoreBundle\Interfaces\DependentBundleInterface;
use Elcodi\Component\Plugin\Interfaces\PluginInterface;
use Elcodi\Plugin\StripeBundle\DependencyInjection\ElcodiStripeExtension;
use Symfony\Component\HttpKernel\KernelInterface;

/**
* Class ElcodiStripeBundle
Expand Down

0 comments on commit 66d3681

Please sign in to comment.