Tuesday, February 17, 2015

Observer Pattern

Before you start studying the tutorial on events at here, I highly recommend that you understand the Observer Pattern. Then you'll get easier the idea of events in the Shopware framework.

Basic idea of the Observer Pattern:
When an event is fired, it notifies the listeners that are subscribed to it.

Note: listeners can return values and the values can affect the operation of Web pages. For example, a boolean value (true/false) returned by a listener can cause a Web page to get rendered or not (see the example in the section Controller Actions of the tutorial).

event-listeners
event-listener

Here's a good article that explains the Observer Pattern with a piece of code in JavaScript as an example. Please don't dig deep the code. Capture only the concept of the pattern.

Saturday, February 7, 2015

Here's a good link that explains how to use XDebug for debugging PHP code.

Friday, February 6, 2015

PHP configuration file (socalled php.ini) in the UwAmp server is located at UwAmp\bin\php\CURRENT PHP VERSION\php_source.ini. Why is it called php_source.ini? Why do we need this file while we have php.ini under UwAmp\bin\apache??
UwAmp provides a local server. User and server connect to each other through the port 80.
Note: add the local server to PHPStorm.

Wednesday, February 4, 2015

Basics of plugin development in Shopware

- Specify the Web page of your website that you want to modify.
- Specify an event e that if it's triggered the Web page can be modified.
- Define an event listener function. By the argument of this function we have access to the current state s1 of the Web page.
- After execution of the event listener function, the state of the Web page will change to s2.

basics of plugin development