Skip to content

Instantly share code, notes, and snippets.

View rickbenetti's full-sized avatar

Rick Benetti rickbenetti

View GitHub Profile
<?php
$_product = $this->getProduct();
$_attributes = Mage::helper('core')->decorateArray($this->getAllowAttributes());
?>
<?php if ($_product->isSaleable() && count($_attributes)):?>
<?php //Irá exibir o valor do atributo no label como: Cor, Tamanho, Dimensões e etc... ?>
<div class="options">
<label for="super_attribute[<?php echo $_attribute->getAttributeId() ?>]"><?php echo $_attribute->getProductAttribute()->getAttributeCode(); ?></label>
<div class="dropdown-select">
<select name="super_attribute[<?php echo $_attribute->getAttributeId() ?>]" id="attribute<?php echo $_attribute->getAttributeId() ?>" class="required-entry super-attribute-select">
<?php // Check to see if the item is in stock
if($_product->stock_item->is_in_stock == 1):
echo $this->__('Availability') ?>: <strong><?php echo $this->__('In stock') ?></strong> ?>
<?php else: ?>
<strong><a href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) ?>contacts/" title="<?php echo $this->__('Email') ?>"><?php echo $this->__('Email') ?></a></strong> <?php echo $this->__('or Call for Availability') ?>&nbsp;1-222-333-444
<?php endif; ?>
@rickbenetti
rickbenetti / localhost - permissions
Created August 19, 2014 15:51
From http://stackoverflow.com/questions/18352682/correct-file-permissions-for-wordpress Just correct folder and files permissions for magento and wordpress to.
chown -R _www:_www * # Let apache be owner
sudo find . -type d -exec chmod 755 {} \; # rwxr-xr-x
sudo find . -type f -exec chmod 644 {} \; # rw-r--r--
@rickbenetti
rickbenetti / delay-submenu.js
Created June 15, 2014 13:25
Delay to show submenu
$('#main-menu .main-menu .nav-item').hover(function() {
if ($(this).find('.submenu-container').length > 0) {
$(this).addClass("nav-selected");
$(this).find('.submenu-container').show();
}
}, function() {
var object = $(this);
setTimeout(function()
{
$(object).find('.submenu-container').hide();
<?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 / 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",
@rickbenetti
rickbenetti / toplinks.xml
Created February 28, 2014 18:15
Remove links from Top.Links menu
@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 <[email protected]>
*
**/
@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 / 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