Snippet

Shopware 5 PLZ-Bereich (Umkreis) versandkostenfrei für ausgewählte Kategorien


(IFNULL(us.zipcode,ub.zipcode) IS NOT NULL) AND (IFNULL(us.zipcode,ub.zipcode) IN ('32312', '32310', '12345'))
AND
MIN(SELECT 1 FROM s_articles_categories WHERE articleID=a.id AND categoryID IN (22,56)) AS erlaubtekategorie

Drupal 8: Override views row (views-view-fields.html.twig) in views style plugin

In the last days I developed the ZURB Foundation Views integration module for Drupal 8. To match the markup required by foundation accordion we first had to write a views style plugin in our module.

JTL-Shop4 Exportformat mit Varianteneigenschaften im Artikelnamen (z.B. für Idealo)

Nachfolgend das JTL Shop 4 Exportformat am Beispiel Idealo, wenn ihr Name und Wert der Varianten direkt hinter dem Artikelnamen ausgeben möchtet.

Dieser Trick wird z.B. verwendet, um Klicks auf (Kind-)Artikel zu vermeiden, die nur noch in bestimmten Größen lieferbar sind.


{strip}
{assign var="d" value="|"}
{$Artikel->kArtikel}{$d}
{$Artikel->cDeeplink}{$d}

Snippet: Drupal 8 Commerce: Show SKU in product variation inline entity form table

Before our modifications to the IEF table

Today I'd like to share a little snippet with you on how to add or remove fields from the inline entity form line items table in a product edit form.

By default that inline entity form table contains

  • Weight
  • Product variation title
  • Price
  • Status
  • Operations

What we'd like to do in our example is to

JTL Artikel pro Seite Limit 100 Maximum übersteuern (Suche / Kategorien)

Heute ein kleiner Tipp für Anwender von JTL-Shop 3 und JTL-Shop 4:

Drupal 8: Load current entity from controller dynamically *updated*

Today I'd like to discuss a little Drupal 8 snippet to dynamically load an entity from the controller by the current path.

This acts a bit like a Drupal 8 replacement for Drupal 7's menu_get_object().

Use case / example:

VSCode (Visual Studio code) mark dollar sign $ on double click

Visual Studio Code is my new IDE love. It's simple, lightweight but brings great functionality.

One little problem was that when double-clicking a variable with a dollar-sighn ("$") (for example in PHP or JavaScript) not the whole $variable was marked, but only the text without the $.

JTL-Shop 4: AJAX events / hooks / bindings "contentLoaded"

Ein typisches Problem im Umgang mit AJAX ist die (re-)Initialisierung von Scripts auf den nachträglich geladenen Inhalt. Im JTL-Shop 4 stößt man darauf beispielsweise auf Kategorieübersichten bei der Seitennavigation.

Viele Systeme, viele Lösungen

Drupal 7 Snippet: Photoswipe: Only output first image of image field, but show the rest in swipe gallery

Simple snippet to only output the first image of an imagefield in a view and show the rest of the gallery in the photoswipe overlay.

Hint: Don't forget to add the photoswipe-gallery class on the field wrapper in views settings: http://cgit.drupalcode.org/photoswipe/tree/README.txt?h=7.x-2.x

  1. /**
  2.  * Implements hook_views_pre_render().
  3.  */

Drupal 7 Snippet: Add lightbox fallback for image_link_formatter

Little Drupal 7 snippet for the image_link_formatter module (https://www.drupal.org/project/image_link_formatter) to add a fallback to lightbox in size large if no link is given.
Should work the same with other fallbacks (colorbox, etc.).

With some time you could create a clean field formatter from this containing the hard coded values as field display settings.

  1. /**