Skip to content

Commit

Permalink
Merge branch '1.3' into 1.4
Browse files Browse the repository at this point in the history
* 1.3:
  [Product Review] fixed review validation when edited by admin
  Using channel code in shipping method configuration as this is what the flat rate calculator in the core bundle is expecting
  • Loading branch information
pamil committed Jan 25, 2019
2 parents 977081b + 631febe commit 45bf7be
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docs/book/orders/shipments.rst
Expand Up @@ -56,7 +56,7 @@ At the end add it to the system using a repository.
$shippingMethod->setCode('DHL');
$shippingMethod->setCalculator(DefaultCalculators::FLAT_RATE);
$shippingMethod->setConfiguration(['amount' => 50]);
$shippingMethod->setConfiguration(['channel_code' => ['amount' => 50]]);
$zone = $this->container->get('sylius.repository.zone')->findOneByCode('US');
$shippingMethod->setZone($zone);
Expand All @@ -67,6 +67,7 @@ In order to have your shipping method available in checkout add it to a desired

.. code-block:: php
$channel = $this->container->get('sylius.repository.channel')->findOneByCode('channel_code');
$channel->addShippingMethod($shippingMethod);
Shipping Zones
Expand Down
Expand Up @@ -5,7 +5,7 @@ Feature: Editing product reviews
I want to edit a product review

Background:
Given the store has customer "Mike Ross" with email "ross@teammike.com"
Given there is a customer "Mike Ross" with an email "ross@teammike.com" and a password "thePassword"
And the store has a product "Lamborghini Gallardo Model"
And this product has a review titled "Awesome" and rated 4 with a comment "Nice product" added by customer "ross@teammike.com"
And I am logged in as an administrator
Expand Down
Expand Up @@ -17,6 +17,7 @@
<import resource="services/email.xml" />
<import resource="services/listener.xml" />
<import resource="services/menu.xml" />
<import resource="services/form.xml" />
</imports>

<services>
Expand Down
20 changes: 20 additions & 0 deletions src/Sylius/Bundle/AdminBundle/Resources/config/services/form.xml
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
This file is part of the Sylius package.
(c) Paweł Jędrzejewski
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
-->

<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<parameters>
<parameter key="sylius.form.type.product_review.validation_groups" type="collection">
<parameter>sylius</parameter>
</parameter>
</parameters>
</container>
Expand Up @@ -17,7 +17,7 @@
<constraint name="NotBlank">
<option name="message">sylius.review.title.not_blank</option>
<option name="groups">
<value>sylius_review</value>
<value>sylius</value>
</option>
</constraint>
<constraint name="Length">
Expand Down

0 comments on commit 45bf7be

Please sign in to comment.