Fixing issues after changing product attribute type from varchar to text

Fixing issues after changing product attribute type from varchar to text

In some cases there is a need to change the backend type of a catalog product attribute from varchar to text. The purpose of this change is to get more than 255 characters space for a string value. In this article I will cover the situation when problems occur after changing the backend type of an attribute. The Problem If the backend type of an attribute is changed, e.g. via install/upgrade script, Magento does not automatically copy and clean up old values….

Read More Read More

PSR-7 Standard – Part 1 – Overview

PSR-7 Standard – Part 1 – Overview

This post is part of series: Part 1: Overview Part 2: Request and URI Part 3: Response Part 4: File Uploads Part 5: HTTP-Client Part 6: Server Request Part 7: Middleware Part 8: Usage in a Magento module This is the first post of my new PSR-7 series. If you already use PSR-7 in your daily life as programmer you can skip the first part of this post. What is PSR-7? PSR-7 is a standard defined by the PHP-FIG. It don’t like to repeat…

Read More Read More

Solving a 2006 MySQL error connection timeout in Magento1

Solving a 2006 MySQL error connection timeout in Magento1

In my recent task I was testing a web crawler script which uses Magento database information for the crawling requests. I have encountered the following error: Fatal error: Uncaught exception ‘PDOException’ with message ‘SQLSTATE[HY000]: General error: 2006 MySQL server has gone away’ in lib/Zend/Db/Statement/Pdo.php:228 The Problem This error occured after around 45 minutes of script runtime. The script was written in a way that it was possible that there is no database interaction for a longer period. In consequence to that…

Read More Read More

Deploying Magento2 – Jenkins Build-Pipeline [2/4]

Deploying Magento2 – Jenkins Build-Pipeline [2/4]

This post is part of series: History and Overview of Magento2 Deployment Jenkins Build-Pipeline Setup (building assets, controlling the deployment) Releasing to Production (delivering code and assets, managing releases) Future Prospect (cloud deployment, artifacts) Recap In the post Deploying Magento2 & History / Overview [1/4] we showed an overview of our deployment for Magento2 and this post will go into more detail on what is happing on the Build-Server and how it is done. So to get you up to speed, this is…

Read More Read More

Deploying Magento2 – History & Overview [1/4]

Deploying Magento2 – History & Overview [1/4]

Quite recently we have updated the deployment of our Magento2 projects to a more flexible and reusable way. Originally I wanted to create one post to present you our deployment setup, the systems involved, the workflow & process and some code that might be interesting. While describing this subject I decided to create a series of posts to cover those parts as it was just getting to extensive for one post. I am planing to cover the following topics in separate posts: History and…

Read More Read More

How to add alternative HTTP headers to Magento 2?

How to add alternative HTTP headers to Magento 2?

If you have more than one frontend server running in your business, it’s needed to load balance the traffic between the nodes. In this case we have a new instance between the browser and the web-server. Often it’s a system like HAProxy or Varnish. If the load balancer or proxy receives a request from a browser, it forwards it to backend server in the internal network. The IP address of the client is than added to a forward header which contains…

Read More Read More

How to Create a Category Image Attribute in Magento 2

How to Create a Category Image Attribute in Magento 2

Creating a custom Category Attribute with an image upload is quite common feature requirement in our shops. So this blog-post will be about the steps you have to take to create a custom category attribute with an image upload in Magento 2. The post turned out to be quite long, but I wanted to provide a complete description of all steps necessary. So stay with us if your interested 🙂 Our Module is called `Dev98_CategoryAttributes` and the image attribute will be called…

Read More Read More

How to create attribute-options in Magento2

How to create attribute-options in Magento2

Recently we had to create Configurable Products in our Product Import. To create those products we had to make sure that all simple products are generated before the configurable products and that all the attribute options for our configurable attribute are available. So this post will focus on how to create those attribute options and a problem where we had to spend some time figuring out. Preface We need to create those attribute options before we call $this->magentoImporter->validateSource($dataSource); otherwise the…

Read More Read More

How to adjust increment-ids in Magento 2

How to adjust increment-ids in Magento 2

Maybe almost every Magento developer has had the task to customize the increment-ids for orders or customers in Magento. Recap Magento 1 In Magento 1 you had to change the column increment_prefix  in the table eav_entity_store . I am sure there are modules out there that let you achieve that in convenient way. We have done that by using Setup-scripts most of the time. When a new store is created you need set the increment_prefix afterwards and do so for all entities that you…

Read More Read More

Creating Configurable Products

Creating Configurable Products

Basically there are different ways for creating Configurable Products in Magento2 (like in Magento1). You can create it using the Admin Panel, using a Setup\InstallData or Setup\UpgradeData class or during a custom import. ADDING THE ATTRIBUTE Let’s assume we are creating our attribute using the Setup\UpgradeData class in our module. The code we might initially create could look something like the following: protected function addAttributeDiameter() { $this->eavSetup->addAttribute( ProductModel::ENTITY, ‘dev98_diameter’, [ ‘type’ => ‘int’, ‘backend’ => ”, ‘frontend’ => ”, ‘label’ =>…

Read More Read More