Skip to content

Instantly share code, notes, and snippets.

View danielchicote's full-sized avatar
💭
Uruk, Atenas, Maguncia, Localhost

Daniel Chicote danielchicote

💭
Uruk, Atenas, Maguncia, Localhost
View GitHub Profile
@danielchicote
danielchicote / gist:32be9862a342a579f29a2af79cdff01a
Created February 18, 2021 08:55 — forked from su-v/gist:9965739
Inkscape / SVG on GitHub
@danielchicote
danielchicote / ICS.php
Created November 14, 2019 05:58 — forked from jakebellacera/ICS.php
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*

Magento Snippets

Set all categories to is_anchor 1

Find attribute_id

SELECT * FROM eav_attribute where attribute_code = 'is_anchor'

Update all of them with anchor_id from above (usually is ID 51)

UPDATE `catalog_category_entity_int` set value = 1 where attribute_id = 51
@danielchicote
danielchicote / scrub-magento.sql
Created October 5, 2018 04:12 — forked from molotovbliss/scrub-magento.sql
Magento, Scrub Customer emails, phone numbers, passwords, and other EAV values
-- After dumping a production database, needing to scrub customer data to remove emails, phone numbers,
-- reset passwords, and/or specific attributes from the EAV tables. Change IDs and values accordingly
-- DO NOT BLINDLY COPY/PASTE RUN without customizing for your needs first! For Magento 1.x
-- NOTE: if you need to target a specific EAV use something similar and NOTE the attribute_id!
update customer_entity_text set value = concat('[email protected]') where attribute_id = 267 and entity_type_id = 1;
-- Set all customer passwords to password123
update customer_entity_varchar set value = '15d590025cf0bc5c7db18292ca8c73342d3a7706f0deb5589431e3a137b420cf:jK' where attribute_id = 12 and entity_type_id = 1;
@danielchicote
danielchicote / media-catalog-product-cache.md
Created October 5, 2018 04:10 — forked from molotovbliss/media-catalog-product-cache.md
Deconstructing the cache image path in Magento 1.x/2.x

Deconstructing the cache image path in Magento 1.x/2.x

/media/catalog/product/cache/1/image/9df78eab33525d08d6e5fb8d27136e95/m/e/me-d1_2.jpg
|___________________________|_|_____|________________________________|_|_|__________|
             |               |   |                  |                 | |     |
       Cache Directory       |   |                  |                 | |     |
Mage/Catalog/Model/Product/Media/Config.php         |                 | |     |
getBaseMediaPath()           |   |                  |                 | |     |
                             |   |                  |                 | |     |
@danielchicote
danielchicote / debugging-tips-tricks-magento-1x.md
Created October 5, 2018 04:09 — forked from molotovbliss/debugging-tips-tricks-magento-1x.md
Debugging tips & tricks with Magento 1.x Commerce

Magento testing scenarios

For use after an upgrade to verify the correct working of Magento

SHIP IT

Frontend

General

  • Activate all logs on the server (PHP, MySQL, Magento, mail, etc)
  • Check meta tags in HTML

Magento Code Snippets

Download extension manually using mage

./mage config-set preferred_state stable
./mage clear-cache
./mage sync
./mage download community Module_Name