Skip to content

Instantly share code, notes, and snippets.

View pjedrzejewski's full-sized avatar

Paweł Jędrzejewski pjedrzejewski

View GitHub Profile
@pjedrzejewski
pjedrzejewski / search_filter_sets.yml
Created January 3, 2017 09:41
LakionSyliusElasticSearchBundle
lakion_sylius_elastic_search:
filter_sets:
t_shirts:
filters:
color:
type: option
options:
code: tshirt_color
size:
type: option
@pjedrzejewski
pjedrzejewski / cart.yml
Created February 18, 2016 14:23
Simplified cart actions
sylius_shop_add_to_cart:
path: /cart/
methods: [POST]
defaults:
_controller: sylius.controller.cart_item:createAction
_sylius:
factory:
method: createForCart
arguments:
- 'expr:service('sylius.context.cart').getCart()'
<?php
namespace AppBundle\Tests\Controller;
use Lakion\ApiTestCase\JsonApiTestCase;
use Symfony\Component\HttpFoundation\Response;
class ProductApiTest extends JsonApiTestCase
{
/**
@pjedrzejewski
pjedrzejewski / Symfony3Forms.php
Created December 11, 2015 09:01
Issues with removing form type names in Symfony 3.0.
<?php
class ResourceAutocompleteType extends AbstractType
{
// ...
private $resourceName;
public function __construct($resourceName)
{
Feature: Custom text printing
In order to sell more customized products
As a Customer
I want to customize my product
Background:
Given there is default currency configured
Scenario: Entering custom text when adding product to the cart
Given there is a product "Nike T-Shirt", which cost is 10 EUR
@pjedrzejewski
pjedrzejewski / config.yml
Created September 30, 2014 12:15
Sylius scrutinizer config
filter:
paths:
- 'src/*'
excluded_paths:
- 'src/Sylius/Bundle/*/spec/*'
- 'src/Sylius/Bundle/*/Tests/*'
- 'src/Sylius/Component/*/spec/*'
- 'src/Sylius/Component/*/Tests/*'
- 'app/*'
tools:
@pjedrzejewski
pjedrzejewski / sylius.sh
Last active December 15, 2015 00:38
Sylius quick start
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar create-project sylius/sylius -s dev
$ cd sylius
$ vi sylius/config/container/parameters.yml # And put your values!
$ php sylius/console doctrine:database:create
$ php sylius/console doctrine:schema:create
$ php sylius/console doctrine:fixtures:load # If you want to load sample data.
@pjedrzejewski
pjedrzejewski / config.yml
Created March 7, 2013 10:21
Sylius Scrutinizer-CI configuration.
tools:
php_code_sniffer:
filter:
excluded_paths: [spec/*]
php_cs_fixer:
filter:
excluded_paths: [spec/*]
php_mess_detector:
filter:
excluded_paths: [spec/*]
@pjedrzejewski
pjedrzejewski / ItemResolver.php
Created February 12, 2013 20:18
Adding domains and hosting services.
<?php
namespace App\Bundle\AppBundle\Resolver;
use App\Bundle\AppBundle\Entity\Domain;
use Doctrine\Common\Persistence\ObjectRepository;
use Sylius\Bundle\CartBundle\Model\CartItemInterface;
use Sylius\Bundle\CartBundle\Resolver\ItemResolverInterface;
use Sylius\Bundle\CartBundle\Resolver\ItemResolvingException;
use Symfony\Component\HttpFoundation\Request;
@pjedrzejewski
pjedrzejewski / ItemResolver.php
Last active December 12, 2015 06:29
Adding different item types to cart.
<?php
namespace App\Bundle\AppBundle\Resolver;
use Doctrine\Common\Persistence\ObjectRepository;
use Sylius\Bundle\CartBundle\Model\CartItemInterface;
use Sylius\Bundle\CartBundle\Resolver\ItemResolverInterface;
use Sylius\Bundle\CartBundle\Resolver\ItemResolvingException;
use Symfony\Component\HttpFoundation\Request;