Skip to content

Instantly share code, notes, and snippets.

@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 / magento-format-number.php
Created September 16, 2014 13:39
Magento format number locale Magento formatar número respeitando a localização
<?php echo Zend_Locale_Format::toNumber($_interest, array('locale' => new Zend_Locale(Mage::app()->getLocale()->getLocale()))); ?>
@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 / Enable pdf extension in Magento Wysiwyg CMS
Created August 25, 2014 22:31
Enable pdf extension in Magento Wysiwyg CMS.
Create a new module and in config.xml do the follow:
<?xml version="1.0"?>
<config>
<modules>
<Company_Module>
<version>0.1.0</version>
</Company_Module>
</modules>
<adminhtml>
@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 / 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