Skip to content

Instantly share code, notes, and snippets.

View rickbenetti's full-sized avatar

Rick Benetti rickbenetti

View GitHub Profile
@rickbenetti
rickbenetti / columns-head.phtml
Last active December 18, 2015 00:59
## Magento1column.php, 2columns-left.php, 2columns-right.php and 3columns.php use this head tagging.Price produto page taggingHead content to add rich snippets to all pages by home or product page.
<?php if ( Mage::registry('current_product') ) : ?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->getLang() ?>" lang="<?php echo $this->getLang() ?>" prefix="og: http://ogp.me/ns#" itemscope itemtype="http://schema.org/Product">
<?php elseif( Mage::getSingleton('cms/page')->getIdentifier() == 'home' && Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms' ): ?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->getLang() ?>" lang="<?php echo $this->getLang() ?>" prefix="og: http://ogp.me/ns#" itemscope itemtype="http://schema.org/Store">
<?php endif; ?>
@rickbenetti
rickbenetti / .gitcontg
Created June 5, 2013 20:39
Configuração básica do .gitconfig
[user]
email = youremail@domain.com
name = Your Name or Nickname
[push]
default = matching
[alias]
ps = push
pl = pull
pom = pull origin master
poh = pull origin homologa
@rickbenetti
rickbenetti / wpconfig-define-options
Created July 22, 2013 00:36
wp-config.php all define options
<?php
if( stristr( $_SERVER['SERVER_NAME'], "dev" ) ) {
// Dev Environment
define( 'DB_NAME', 'project_dev' );
define( 'DB_USER', 'project_dev_user' );
define( 'DB_PASSWORD', 'password' );
define( 'DB_HOST', 'localhost' );
define( 'WP_HOME', 'http://project.dev');
define( 'WP_SITEURL', WP_HOME);
// Dev will always want debug on and caching off
@rickbenetti
rickbenetti / qty-magento.php
Created September 27, 2013 23:10
Bloco para adicionar funcionalidade de incremento e decremento no box de quantidade na tela de produto.
<div class="qty-box">
<label for="qty"><sup>*</sup> <?php echo $this->__('Qty') ?></label>
<div class="qty-wrapper">
<input type="text" name="qty" id="qty" maxlength="3" value="<?php echo $this->getProductDefaultQty() * 1 ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />
<div class="actions">
<a class="btn-increment" href="javascript:void(0);" title="<?php echo $this->__('Increment Value')?>"><?php echo $this->__('Increment Value')?></a>
<a class="btn-decrement" href="javascript:void(0);" title="<?php echo $this->__('Decrement Value')?>"><?php echo $this->__('Decrement Value')?></a>
</div>
</div>
</div>
@rickbenetti
rickbenetti / navigation.php
Created October 2, 2013 18:38
Para remover links do menu dentro da área de usuário no magento basta adicionar o unset no arquivo em: app/design/frontend/[NomePacote]/default/template/customer/account/navigation.phtml
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
@rickbenetti
rickbenetti / php_reindexer.php
Created November 1, 2013 16:52
Indexação de base do Magento via php
Is there a way to stop a magento indexer process?
php -f indexer.php reindex all
Stock Status Index process is working now. Please try run this process later.
Product Prices Index process is working now. Please try run this process later.
Catalog URL Rewrites Index process is working now. Please try run this process later.
Product Flat Data Index process is working now. Please try run this process later.
Category Flat Data Index process is working now. Please try run this process later.
Category Products Index process is working now. Please try run this process later.
Catalog Search Index Index process is working now. Please try run this process later.
Stock Status index was rebuilt successfully
@rickbenetti
rickbenetti / head.phtml
Last active September 7, 2023 07:41
Add header rich snippets to your Magento Store
<?php
/**
*
* Copyright (c) 2013 Studio Boz
*
* @project_name Studio Boz
* @copyright Copyright (c) 2013 Studio Boz (http://studioboz.com.br)
* @author Rick Benetti <rick@studioboz.com.br>
*
**/
@rickbenetti
rickbenetti / toplinks.xml
Created February 28, 2014 18:15
Remove links from Top.Links menu
@rickbenetti
rickbenetti / preferences.json
Last active November 24, 2015 11:30
Sublime Text 3 Preferences
{
"always_prompt_for_file_reload": false,
"always_show_minimap_viewport": false,
"animation_enabled": true,
"atomic_save": true,
"auto_close_tags": true,
"auto_complete": true,
"auto_complete_commit_on_tab": false,
"auto_complete_delay": 50,
"auto_complete_selector": "source - comment, meta.tag - punctuation.definition.tag.begin",
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php