Redsys Test Cards

If you use Redsys (payment platform used by Spanish banking like CaixaBank, Banco Santander, Banco Sabadell and many others), you may want to have different test cards for your test platform. I want to share with you the ones provided by the official documentation: Type PAN 3DSecure v.2 3DSMethod Authorization Type Authorization 4548812049400004 No No CIP Authorization 5101332200023012 No No – Authorization 374245455400001 No No – Authorization 4918019160034602 Yes Yes Frictionless Authorization 4548814479727229 Yes No Read more…

Apache redirections when switching Magento from Single Store to Multistore

Recently we converted a 10 years old Magento single store to a Magento Multi Store. We wanted to add English language (original language was Spanish). We did this by creating a new store, asigning the code /es/ to the Spanish store and /en/ to the English store. To avoid SEO issues, we had to create some redirection rules: Everything that was on the root path / had to be moved to /es, except for some Read more…

Setting up a LXC / LXD machine for development on Ubuntu/Debian

One of my favourite things I learned working at Smile was using LXC for development. It’s different from Docker in the sense that you don’t configure services and things like that: you just create a exact copy of the environment you’re going to have in production, with all its services included. You can do that with Docker, but it’s not the same. Above all when I’m already used to LXC and don’t see the need Read more…

[Magento 2] Delete All Categories Programmatically

There are a lot of articles on Internet proposing the deletion of all categories using a sql query. I’ve tested one of them and I’ve run into several problems due to this (url keys not deleted correctly, deletion of the Default category…). There is a safer way, using Magento tools. Things you need to know: You’ll need to inject the classes CategoryFactory and Registry Before deleting a category, it’s necessary to use the Registry to Read more…

[Magento 2] Adding product attributes to quote items getProduct function

When calling the function $block->getProduct() in a quote item in the cart page, Magento 2 will return the product and its basic attributes. The attributes that can be retrieved from the product when calling this function in a quote_item page can be found in the file vendor/magento/module-sales/etc/catalog_attributes.xml. From your own module, you can create the file Vendor/Module/etc/catalog_attributes.xml and add the attributes you need:

[Magento 2] Create Multiselect Product Attribute Programmatically

It might be tricky if you want to create a multiselect product attribute in Magento 2. For that, it’s necessary to pass the correct backend model: if you don’t do it your attribute will be created but the values won’t be saved. Taking this Inchoo article as a basis, you just need to know the fields you should pass to your attribute. The 3 important values here are: Type and Input: these 2 values have Read more…

[Magento 2] Display category image in navigation menu

[Edited] I’ve updated the article to do this in a better way Recently I had to do something I thought it was simple to do: add the category images to the navigation menu. However, Magento doesn’t use a template to draw the whole menu but a function that will retrieve all categories and generate the ul/li tree. In Magento 2.1.X you can do this rewriting the _getHtml() function from the class Magento\Theme\Block\Html\Topmenu. This is a Read more…

Press Ctrl+C to copy the following code.
"