Skip to content

Instantly share code, notes, and snippets.

View OliverSkroblin's full-sized avatar

Oliver Skroblin OliverSkroblin

View GitHub Profile
#Resources/views/storefront/element/cms-element-sales-channel-switch.html.twig
{% set element = element.assign({
type: 'image',
}) %}
<a href="{{ path('frontend.redirect_to_sales_channel') }}">
{% sw_include '@Storefront/storefront/element/cms-element-image.html.twig' %}
</a>
@OliverSkroblin
OliverSkroblin / bunny_cdn.yaml
Last active November 16, 2024 22:33
bunnny cdn
shopware:
cdn:
url: "https://cdn.goblin-coders.de"
filesystem:
public: &bunnycdn
type: "bunnycdn"
url: "https://cdn.goblin-coders.de"
config:
endpoint: "https://storage.bunnycdn.com"
apiKey: "secret-ftp-password"
@OliverSkroblin
OliverSkroblin / monolog.yaml
Created October 31, 2024 10:01
Monolog configuration
monolog:
channels:
- deprecation
handlers:
main:
type: stream
path: '%kernel.logs_dir%/%kernel.environment%.log'
level: debug
channels: ['!event', '!deprecation']
deprecation:
@OliverSkroblin
OliverSkroblin / shopware.yaml
Last active November 11, 2024 15:36
Cluster configuration
shopware:
# if version < 6.6.8.0
cart:
redis_url: '%env(REDIS_URL)%'
compress: true
compression_method: 'zstd'
# else
redis:
@OliverSkroblin
OliverSkroblin / symfony-flex-devenv.md
Last active November 16, 2024 14:23
Shopware setup with symfony flex and devenv

Shopware via symfony-flex and devenv

The following setup uses symfony-flex, the shopware-receipe, devenv and direnv to setup shopware locally.

All information in this gist file are based on the above library/github documentations and the following shopware documentations:

Start a nix shell (if you don't have composer or php) to have all required php composer stuff to install shopware via composer

<?php declare(strict_types=1);
namespace Shopware\Tests\Unit\Common\Stubs\DataAbstractionLayer;
use Shopware\Core\Framework\Context;
use Shopware\Core\Framework\DataAbstractionLayer\Entity;
use Shopware\Core\Framework\DataAbstractionLayer\EntityCollection;
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
use Shopware\Core\Framework\DataAbstractionLayer\Search\AggregationResult\AggregationResultCollection;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
<?php declare(strict_types=1);
namespace Shopware\Core\Framework\DataAbstractionLayer\Doctrine;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver\Statement;
use Doctrine\DBAL\Exception\RetryableException;
use Shopware\Core\Framework\Feature;
class RetryableQuery