geschrieben von
am 9. Februar 2017 - 2:39

It surprised me that over a year after Magento 2’s introduction I haven’t had an opportunity to create a new form component using the UI Component system. In the extensions and themes I’ve helped folks port over it made a lot more sense to just convert the old PHP rendered HTML to the new extension. When time is money known technology trumps new, fancy, and undocumented technology.

Having a chance to touch the backend form generation code this week, any doubts I had about my previous approach with clients evaporated. Whether you call it a technology demo or a mess, form components perfectly encapsulate a lot of the the problems Magento developers face with Magento 2’s incomplete rendering layer.

This quickie’s intent is to provide a high level overview of how forms get setup in Magento2 ’s UI Component system. If there are concepts below that confuse you the Magento 2 UI…

geschrieben von Igor Furseev
am 8. Februar 2017 - 15:03

This post is a short inside-out of the newly released Magento 1 SUPEE-9652 security patch. The patch prohibits an injection of executable code to the Magento email “Reply To” param, if the “Return Path” for emails is enabled. So let’s check what it does.

Basically, the patch changes only one file: lib/Zend/Mail/Transport/Sendmail.php, updating the content of the \Zend_Mail_Transport_Sendmail::_sendMail method to:

public function _sendMail() { if ($this->parameters === null) { set_error_handler(array($this, '_handleMailErrors')); $result = mail( $this->recipients, $this->_mail->getSubject(), $this->body, $this->header); restore_error_handler(); } else { if(!is_string($…
geschrieben von
am 7. Februar 2017 - 22:15

For backend UI Components, the rendered x-magento-init JSON argument contains two top level keys: types and components

{ "*": { "Magento_Ui/js/core/app": { "types": {/*...*/}, "components": {/*...*/} } } }

The Magento_Ui/js/core/app module/application uses the data in components to instantiated a nested tree of uiClass based objets and register them as KnockoutJS view models (accessible via Magento’s customer KnockoutJS scope binding). It was never clear to me what the types information was for. I’ve sort of figured that out – or at least enough that I’m not mystified anymore.

In a components object, I came across the following configuration for a UI Component.

"components": { /*...*/ "cms_page_form": { "type": "cms_page_form", "name": "cms_page_form", "children": {...}, "dataScope": "data", "config": { "namespace": "…
geschrieben von Brendan Tull
am 7. Februar 2017 - 22:10
How to Change Magento 2 Increment ID for Orders, Invoices, Credit Memos and Shipments

Some merchants want to customize order numbers or invoice numbers to be different than what Magento 2 produces by default. They might want the numbers to contain more information, or they might have an existing format that shouldn’t be changed. Perhaps the numbers need to pick up where they left off from a previous website (or maybe they just don’t look pretty enough). These numbers each have an Increment ID, and the values used to create them are stored in the database and are not configurable from admin, so we’ll need a little SQL to make our customizations. Without further ado…

We can individually adjust the following properties of increment IDs for Orders, Invoices, Creditmemos, & Shipments:

  • Prefix
  • Suffix
  • Step
  • Start-value
  • Pad-length

The Prefix, Suffix, Start-value, and Step are stored in the…

geschrieben von Tim Hahn
am 7. Februar 2017 - 15:24

Bei Magento tut sich gerade so einiges: Zum einen fördert ein neuer Investor das weltweite Wachstum der E-Commerce-Plattform. Zum anderen ist aus Magento Analytics nun Magento Business Intelligence geworden. Was das im Einzelnen bedeutet? Wir haben die News im Doppelpack zusammengefasst: News 1: Hillhouse Capital investiert in Magento Commerce Um das globale Wachstum und die

The post Magento-News im Doppelpack: Neuer Investor und Business Intelligence appeared first on Regalsprecher.

geschrieben von Stjepan Udovicic
am 7. Februar 2017 - 13:32

Session is something that PHP developers use in their everyday work. But how many of you did took some time to actually consider where are they stored and how does that impact your application? Should you even care? Does number of sessions influence performance of your application?

Setting up the test for file-based sessions

To test this, lets create some code. Keep in mind that same apply to larger applications such us Magento as well, but for the purposes of this article, we will keep it simple:

<?php   // Start profiling $start = microtime(true);   // Set header header('Content-type: text/plain');   // Adjust session config ini_set('session.save_path', __DIR__ . '/sessions/'); ini_set('session.gc_probability', 1); ini_set('session.gc_divisor', 10); ini_set('session.gc_maxlifetime', 3000);   // Init session session_start();   // End profiling $duration = (microtime(true) - $…
geschrieben von Fabian Schmengler
am 7. Februar 2017 - 9:19
This is my weekly Kata post. Read the first one to learn what it is all about.

Last week: Karate Chop

This is going to be a longer post because my goal was to follow the kata description and try out five different approaches. I will explain all of them:

Approach 1: Object oriented PHP

My goal in this approach was to use as little PHP functions as possible and implement the algorithm in an object oriented way

The final solution had the following classes:

interface IntegerHaystack { public function positionOf(int $needle) : int; public function isEmpty() : bool; } class SortedIntegers implements IntegerHaystack { public function __construct(int ...$integers) { ... } ... } class SortedIntegersRange implements IntegerHaystack { public function __construct(SortedIntegers $sortedIntegers, int $indexFrom, int $indexTo) { ... } ... } class…
geschrieben von Fabian Schmengler
am 7. Februar 2017 - 9:19
Dies ist mein wöchentlicher Kata Post. Lies den ersten um zu erfahren, worum es hier geht.

Letzte Woche: Karate Chop

Das wird ein längerer Post, da es mein Ziel war, der Kata Beschreibung zu folgen und fünf verschiedene Ansätze zu probieren. Ich werde alle erklären:

Ansatz 1: Objektorientiert, PHP

Mein Ziel war es hier, so wenig wie mögliche PHP Funktionen zu nutzen und den Algorithmus objektorientiert zu implementieren.

Die finale Lösung hatte die folgenden Klassen:

interface IntegerHaystack { public function positionOf(int $needle) : int; public function isEmpty() : bool; } class SortedIntegers implements IntegerHaystack { public function __construct(int ...$integers) { ... } ... } class SortedIntegersRange implements IntegerHaystack { public function __construct(SortedIntegers $sortedIntegers, int $indexFrom, int $indexTo) { ... } ... } class…
geschrieben von
am 7. Februar 2017 - 6:39
mattwellss/magento-composer-autoloader:

For folks still playing “wait and see” with Magento 2, (i.e. most current Magento systems), and who are using some sort of Composer workflow (not most Magento 1 systems), this is a small autoloader optimization that fixes Magento 1’s selfish “if I try to load someone else’s class and it doesn’t exist I’ll explode” autoloader.

geschrieben von
am 4. Februar 2017 - 6:17

So, over the summer I covered how to invoke a function returning RequireJS modules via an x-magento-init script. Today I discovered there’s a syntax for doing this with an object returning RequireJS module. If you’ve got an x-magento-init that looks like this

<script type="text/x-magento-init"> { "*": { "Package_Namespace\/js\/example": {/* ... config object ... */} } } </script>

just define a module that looks like this

#File: app/code/Package/Namespace/view/web/frontend/js/example.js define([], function(){ return { /* ... other methods and properties */, 'Package_Namespace\/js\/example':function(configObject){ //magento will call this function } } });

That is – if your RequireJS module returns a non-function, and that non-function is an object with a…

geschrieben von
am 3. Februar 2017 - 23:24

One of the challenges Magento 2, (and all “full stack” oriented frameworks), face is data synchronization between the front end and the server. Server data will always represent the “source of truth” for any particular piece of data, but good front end developers will always be looking to reduce to number of round trips they make to the server. Magento 2 faces an additional cultural challenge in that it remains a PHP framework, and most developers doing Magento 2 work are going to rely on its many code injection features to change how server side data is saved. In other words, reducing a client side round trip may work out of the box, but may result in stale data if new server side code runs during ajax requests.

I’ve notice that, whenever a developer asks for help along these lines the mysterious sections.xml files are often…

geschrieben von
am 3. Februar 2017 - 20:44
How to clear billing form validation errors when using Magento UI components:

A “quick” (har har) answer from me on how to reset a form field’s validation state in the Magento 2 checkout application. This is also a nice example of how, no matter how far we progress with computers doing things for us, it’s always going to be useful to reason about how a computer does the things it does. Without the Magento 2 documentation I’ve written, or the tooling I’ve built, there’s no way this question gets answered without an individual developer spending days or weeks on it.

If you want to be successful with any customizable/programmatic information system – hire developers who know what they’re doing…

geschrieben von Covos
am 3. Februar 2017 - 14:16
Dies als kleine Randnotiz: Wir haben gerade in einem RWD Template die Anzeige der Vergleichsbox von rechts nach links umgestellt und hatten dann das Problem, dass zwar „gesagt“ wurde, dass der Artikel erfolgreich zur Vergleichsliste hinzugefügt wurde, angezeigt wurde er … Weiterlesen →
geschrieben von Christian Münch
am 3. Februar 2017 - 12:41

Kundendaten und Zahlungsinformationen von mehr als tausend deutschen Online-Shops befinden sich derzeit in den Händen von Cyber-Kriminellen. Wie das Bundesamt für Sicherheit in der Informationstechnik (BSI) kürzlich meldete, wurden zahlreiche Magento-basierte Onlineshops in Deutschland mit einer Malware infiziert. Sicherheitslücken wurden genutzt, um einen manipulierten Skimming-Code einzuschleusen, der die Daten während des Bestellvorgangs unbemerkt „abfängt“.Doch derartige

The post Mein Shop ist sicher – stimmt das? appeared first on Regalsprecher.

geschrieben von
am 3. Februar 2017 - 1:42

A useful code snippet that came out of a discussion on the Patreon slack today.

requirejs([ 'Magento_Checkout/js/model/quote', 'Magento_Checkout/js/model/shipping-rate-registry' ], function(quote, rateRegistry){ //get address from quote observable var address = quote.shippingAddress(); //changes the object so observable sees it as changed address.trigger_reload = new Date().getTime(); //create rate registry cache //the two calls are required //because Magento caches things //differently for new and existing //customers (a FFS moment) rateRegistry.set(address.getKey(), null); rateRegistry.set(address.getCacheKey(), null); //with rates cleared, the observable listeners should //update everything when the rates are updated quote.shippingAddress(address); });

The program, (which could be (and should be) easily ported into a define module) will trigger an update…

geschrieben von SB
am 2. Februar 2017 - 17:01
USEr first! Make your shop great again! Wann haben Sie das letzte Mal selbst eine Bestellung in Ihrem Shop getätigt? Und damit meinen wir nicht die provisorische Funktionalitätsprüfung, sondern eine BEWUSSTE Bestellung. Sollten Sie jetzt noch immer darüber nachdenken, ist … Weiterlesen →
geschrieben von Andreas von Studnitz
am 1. Februar 2017 - 9:17

In Entwicklerkreisen hört man von vielen Personen, dass die Arbeit mit Magento 2 anspruchsvoll ist. Auch für mich als langjährigen Magento-1-Entwickler war die Umstellung auf Magento 2 nicht einfach. Mit den verschiedenen, zur Verfügung stehenden Ressourcen kann man sich diesen Lernprozess erleichtern.
In wenigen Wochen haben es zwei meiner Teamkollegen und ich geschafft, Magento-2-Entwickler zu werden. Wie uns das gelungen ist, beschreibt dieser Artikel. Erst Ende Oktober habe ich mit der Entwicklung des ersten Magento-2-Projektes begonnen und habe bereits Mitte Dezember eine Entwicklerschulung zu Magento 2 gehalten.

Magento-1-Erfahrung

Auch wenn Magento 2 teilweise völlig andere Entwicklungsmethoden aufweist, ist viel Erfahrung mit Magento 1 sehr hilfreich beim Erlernen von…

geschrieben von Fabian Schmengler
am 1. Februar 2017 - 0:10
Dies ist mein wöchentlicher Kata Post. Lies den ersten um zu erfahren, worum es hier geht.

Letzte Woche: Word Wrap

In PHP/Behat habe ich “scenario outlines” kennen gelernt, die viel von den Wiederholungen in Feature Dateien beseitigen.

Vollständiges Ergebnis:

Feature: Word Wrap In order to display text on tiny screens I want to wrap lines of a long text Scenario Outline: Wrap text When I wrap <text> at <col> columns Then I should retrieve the wrapped string <wrapped> Examples: | text | col | wrapped | | | 1 | | | word | 2 | wo\nrd | | word | 3 | wor\nd | | word | 4 | word | | word | 5 | word | | word word | 4 | word\nword | | word word | 5 | word\nword | | word word | 7 | word\nword | | word word | 8 | word\nword | | word word | 9 | word word…
geschrieben von Fabian Schmengler
am 1. Februar 2017 - 0:10
This is my weekly Kata post. Read the first one to learn what it is all about.

Last week: Word Wrap

In PHP/Behat I learned about scenario outlines, which remove a lot of repetition in feature files. Full result:

Feature: Word Wrap In order to display text on tiny screens I want to wrap lines of a long text Scenario Outline: Wrap text When I wrap <text> at <col> columns Then I should retrieve the wrapped string <wrapped> Examples: | text | col | wrapped | | | 1 | | | word | 2 | wo\nrd | | word | 3 | wor\nd | | word | 4 | word | | word | 5 | word | | word word | 4 | word\nword | | word word | 5 | word\nword | | word word | 7 | word\nword | | word word | 8 | word\nword | | word word | 9 | word word | | abcdefg hij klmno p qurstuvwx yz | 4 | abcd\nefg\nhij\nklmn\…
geschrieben von Kostyantyn Systalyuk
am 31. Januar 2017 - 16:01

Most of the testing tools are too complicated. For a long time we’ve been looking for an automatic testing framework to meet our needs. We tried a lot of frameworks like Selenide and CasperJS but they were not exactly what we’ve been looking for. Not so long ago, we’ve discovered a tool Codeception and I want to introduce you to it.

Codeception is a powerful but at the same time, a very simple tool that covers your projects with auto-tests. It was created based on a famous testing framework – PHPUnit.

There are three types of tests: Acceptance tests, Functional tests, and Unit tests.

In this blog post I will cover acceptance tests, which can help you emulate a customer behavior on your web store and check different scenarios in order to make sure that the website works properly.

How to…