Skip to content

Instantly share code, notes, and snippets.

Avatar

Mohamed Kaïd mokadev

View GitHub Profile
@mokadev
mokadev / README.md
Created Sep 30, 2020 — forked from leek/_Magento2_DeleteTestData.md
Magento 2 - Delete All Test Data
View README.md

These set of scripts are for Magento 2. For Magento 1, see this Gist.

@mokadev
mokadev / magento-nginx.conf
Created Aug 19, 2020 — forked from gwillem/magento-nginx.conf
Battle-tested Nginx configuration for Magento (source: www.hypernode.com)
View magento-nginx.conf
# This is an annotated subset of the Nginx configuration from our Magento production platform @ www.hypernode.com
# See https://www.byte.nl/blog/magento-cacheleak-issue
# !!!! If you are a Hypernode customer, do not use this config as it will result in duplicate statements. !!!!!
user app;
worker_processes 4;
pid /var/run/nginx.pid;
events {
View install-0.1.0.php
<?php
$installer = Mage::getResourceModel('catalog/setup', 'catalog_setup');
if (!$installer->getAttributeId(Mage_Catalog_Model_Product::ENTITY, 'attribute_name')) {
$installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'attribute_name', array( // TABLE.COLUMN: DESCRIPTION:
'label' => 'Label', // eav_attribute.frontend_label admin input label
'group' => 'General', // (not a column) tab in product edit screen
'sort_order' => 0 // eav_entity_attribute.sort_order sort order in group
'backend' => 'module/class_name', // eav_attribute.backend_model backend class