Skip to content

Instantly share code, notes, and snippets.

@rohithmeethal
rohithmeethal / create custom log files for shopware 6 plugins
Last active August 27, 2025 10:20
create custom log files for shopware 6 plugins
new file src/Resources/config/packages/monolog.yaml
```
monolog:
channels: ['my_plugin_log']
handlers:
my_plugin_log:
type: rotating_file
path: '%kernel.logs_dir%/my_plugin_log%kernel.environment%.log'
level: info
@rohithmeethal
rohithmeethal / Search and replaces
Last active May 1, 2025 13:26
Shopware 6 admin components upgrade notes
'/administration/static/img/empty-states/products-empty-state.svg' => '/administration/administration/static/img/empty-states/products-empty-state.svg'
<sw-card-view slot="content"> => <template #content><sw-card-view>
<sw-entity-single-select v-model= => <sw-entity-single-select v-model:value
<sw-single-select v-model= => <sw-single-select v-model:value=
@rohithmeethal
rohithmeethal / ProductSubscriber.php
Last active December 21, 2022 17:52
In Shopware 6, how to know if written product is new or existing fromr product written event
<?php
declare(strict_types=1);
namespace MyPlugin\Subscriber;
use Shopware\Core\Content\Product\ProductEvents;
use Shopware\Core\Framework\DataAbstractionLayer\Event\EntityWrittenEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
<?php
/**
* Shopware 5
* Copyright (c) shopware AG
*
* According to our dual licensing model, this program can be used either
* under the terms of the GNU Affero General Public License, version 3,
* or under a proprietary license.
*
* The texts of the GNU Affero General Public License with an additional
@rohithmeethal
rohithmeethal / installation.md
Created June 9, 2021 10:38
Latest version php7.4-imagick with 260 format support.
  1. Remove all the imagemagick in the system : sudo apt remove imagemagick php7.4-imagick && sudo apt autoremove
  2. Install latest version of imagemagick using imei https://softcreatr.github.io/imei/ (Took 8 minutes in a 8 core system)
  3. Install pecl and php7.4-dev sudo apt install php7.4-dev php-pear
  4. Install php imagick using pecl sudo pecl install imagick
  5. Enable module sudo phpenmod imagick
  6. Restart the server sudo service php7.4-fpm restartor sudo service apache2 restart
@rohithmeethal
rohithmeethal / gist:a7e03c49a0f0e43f2aa5fcfc0987577e
Created April 30, 2020 19:18
virtual-box-internet-and-ssh
If you want to access vb guest using ssh also have internet access from vb guest.
Then you need to add two network cards to guest one NAT network and one HOST only adapter.
#!/bin/bash
export TERM=xterm-256color
function tinkerwatch(){
clear;
tail -n $(expr $(wc -l $1 | awk '{ print $1 }') - 1) $1 | php artisan tinker
}
tinkerwatch $1
@rohithmeethal
rohithmeethal / .zshrc
Created March 29, 2020 10:03
Setting up permission to make it writable for apache group while in users directory
function fixpermissions(){
sudo chgrp -R www-data $1
sudo chown -R $(whoami):www-data $1
sudo chmod -R g+s $1
sudo chmod -R 775 $1
}
add this to your .zshrc or bashrc
use it like "fixperssmissions foldername"
@rohithmeethal
rohithmeethal / multiple php version
Created March 29, 2020 09:06
For development system setup
follow this guide https://devanswers.co/run-multiple-php-versions-on-apache/
TLDR:
sudo apt install php7.2 php7.2-fpm
sudo a2enmod actions alias proxy_fcgi fcgid
two ways to activate php version :
1) for using virtual host file method
@rohithmeethal
rohithmeethal / Headset microphone fix for ASUS FX 553 VD ubuntu.txt
Created March 24, 2020 19:18
Headset microphone fix for ASUS FX 553 VD ubuntu
Add this line "options snd-hda-intel model=alc233-asus"
At end of file "/etc/modprobe.d/alsa-base.conf"