Skip to content

Instantly share code, notes, and snippets.

@rodrigowebjump
rodrigowebjump / subcategories.phtml
Created June 20, 2016 17:49
Magento show subcategories of current category
<?php
$_categoryModel = Mage::getSingleton('catalog/layer')->getCurrentCategory();
$_categories = $_categoryModel->getCollection()
->addAttributeToSelect(array('name', 'thumbnail', 'image', 'description',))
->addAttributeToFilter('is_active', 1)
->addIdFilter($_categoryModel->getChildren())
;
if(empty($_categories)){
return;
@rodrigowebjump
rodrigowebjump / Vagrantfile
Created February 12, 2016 17:51
Scotch Box - Corrige problema de queda no MySQL no vagrant do https://box.scotch.io/
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "scotch/box"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.hostname = "scotchbox"
config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=666"]
@rodrigowebjump
rodrigowebjump / shell_delete_unused_images
Created November 9, 2015 12:18 — forked from aleron75/shell_delete_unused_images
Delete no more used Product Images on Magento
<?php
require_once 'abstract.php';
class Mage_Shell_CheckImages extends Mage_Shell_Abstract
{
const CATALOG_PRODUCT = '/catalog/product';
const CACHE = '/cache/';
protected function _glob_recursive($pattern, $flags = 0)
@rodrigowebjump
rodrigowebjump / rt_customer
Created November 9, 2015 12:16 — forked from aleron75/rt_customer
Magento runtime for Customer
<?php
// Prevent this script to be called via HTTP
if (isset($_SERVER['REQUEST_METHOD']))
{
die('Permission denied.');
}
// Avoid any time limit
set_time_limit(0);
<block type="cms/block" name="block_name">
<action method="setBlockId"><id>block_code</id></action>
</block>
{{block type="cms/block" block_id="block_code"}}
{{block type="catalog/product_list" category_id="79" template="catalog/product/list_random.phtml"}}
@rodrigowebjump
rodrigowebjump / index.php
Last active August 29, 2015 14:27
[magento] multidomain-multistore-multistoreview setup with visible language codes

Use these snippets to setup a magento installation with the following structure:

@rodrigowebjump
rodrigowebjump / WSSoapClient.php
Last active August 22, 2018 16:33 — forked from Turin86/WSSoapClient.php
Do request using cURL with disabled ssl cert check
<?php
/**
* This class can add WSSecurity authentication support to SOAP clients
* implemented with the PHP 5 SOAP extension.
*
* It extends the PHP 5 SOAP client support to add the necessary XML tags to
* the SOAP client requests in order to authenticate on behalf of a given
* user with a given password.
*
* This class was tested with Axis and WSS4J servers.
@rodrigowebjump
rodrigowebjump / brand_on_product_page
Last active August 29, 2015 14:08
Brand or Manufacturer logo to product pages Adicionar logo da marca na página dos produtos
http://www.magentocommerce.com/wiki/4_-_themes_and_template_customization/catalog/how_to_add_a_brand_or_manufacturer_logo_to_your_product_pages
@rodrigowebjump
rodrigowebjump / Git - Fix case sensitive filename in MacOS
Created October 31, 2014 04:43
Git - Fix case sensitive filename in MacOS Corrige problema com letras maiúsculas e minúsculas no MacOS
https://coderwall.com/p/mgi8ja
Launch Disk Utility
Choose "New Image"
Enter a nice Name for your Volume, e.g "Workspace"
Set the size to something that will most likely fit your needs (resizing is a whole another story)
Select "Mac OS Extended (Case-sensitive, Journaled)" in "Format".
Select "Single Partition - Apple Partition Map" in "Partitions"
Ensure "sparse bundle disk image" is set in "Image Format".
Save it somewhere on your hard drive
@rodrigowebjump
rodrigowebjump / Magento ACL - Reset Admin user role and resources permission to all
Created October 24, 2014 19:42
Magento (ACL) Reset Admin user, role and resources permission to all
http://magentopaper.blogspot.com.br/2013/05/how-to-reset-magento-admin-user-role.html
How to reset magento Admin user, role and resources permission to all?
scenario 1: All resource permissions were set to none for the admin role
Solution:
Step 1: Get current admin role details
view plainprint?
SELECT * FROM admin_role WHERE role_name = 'Administrators'