Skip to content

Instantly share code, notes, and snippets.

View vanWittlaer's full-sized avatar

Benny Poensgen vanWittlaer

View GitHub Profile
@vanWittlaer
vanWittlaer / gist:89dd99c94e3b4077e60b8b5f2a2c080f
Created February 4, 2020 16:31
Controlling sitemap.xml output via config.php (since SW 5.5)
'sitemap' => [
'excluded_urls' => [
[
// Possible resources:
// - product (\Shopware\Models\Article\Article::class)
// - campaign (\Shopware\Models\Emotion\Emotion::class)
// - manufacturer (\Shopware\Models\Article\Supplier::class)
// - blog (\Shopware\Models\Blog\Blog::class)
// - category (\Shopware\Models\Category\Category::class)
// - static (\Shopware\Models\Site\Site::class)
@vanWittlaer
vanWittlaer / gist:9415b199012908ab38f6cb16e911d17e
Created January 20, 2020 15:10
Gitlab runner running out of space (in /var/lib/docker/overlay2)
SSH to the runner and execute 'docker system prune --all --volumes --force' - this will wipe any unused docker stuff.
@vanWittlaer
vanWittlaer / jquery.presetFacet.js
Last active October 22, 2019 14:53
To preset a filter facet (here: 'immediate delivery') in Shopware5
;(function ($, window, document, undefined) {
'use strict';
window.onload = function () {
document.getElementById('delivery').checked = true;
$('#delivery').triggerHandler('change');
};
})(jQuery, window, document, undefined);
@vanWittlaer
vanWittlaer / truncate_articles.sql
Created May 22, 2019 09:43
Shopware 5.5 - reset article and related data
SET foreign_key_checks = 0;
TRUNCATE shopware.s_addon_premiums;
TRUNCATE shopware.s_articles;
TRUNCATE shopware.s_articles_also_bought_ro;
TRUNCATE shopware.s_articles_attributes;
TRUNCATE shopware.s_articles_avoid_customergroups;
TRUNCATE shopware.s_articles_categories;
TRUNCATE shopware.s_articles_categories_ro;
TRUNCATE shopware.s_articles_categories_seo;
TRUNCATE shopware.s_articles_details;
@vanWittlaer
vanWittlaer / gist:39d738877f0e6aa275ebff2925b1227b
Created August 27, 2018 14:37
cURL a website like Google bot
curl -v -L --user-agent "Googlebot/2.1 (+http://www.google.com/bot.html)" https://vanwittlaer.de
@vanWittlaer
vanWittlaer / gist:92ca82c19d39ea38089af2a5459599db
Created July 16, 2018 09:21
Using the addAttribute method for the ListProduct class
class ListProductService implements ListProductServiceInterface
{
/**
* @var ListProductServiceInterface
*/
private $service;
/** @var Container */
private $container;