Skip to content

Instantly share code, notes, and snippets.

View pablocattaneo's full-sized avatar

Pablo Cattaneo pablocattaneo

View GitHub Profile
@pablocattaneo
pablocattaneo / wrapping_text_around_images.css
Last active September 16, 2017 00:07
Imágen con texto alrededor. La imagen debe tener float left pero no el párrafo no. Wrapping Text Around Images
.wrapperImgAndParagraph img{
float: left;
}
.wrapperImgAndParagraph p{
float: none;
}
@pablocattaneo
pablocattaneo / include_extra_wordpress_file.php
Created February 22, 2016 18:29
Incluir un archivo en Wordpress. Include a custom wordpress file in the wordpress way.
<?php get_template_part('file_name_widhout_extension'); ?>
@pablocattaneo
pablocattaneo / add_custom_class_wordpress.php
Created February 22, 2016 18:32
Agregar una custom class al body en Wordpress Add custom class to the body in Wordpress
<?php
$id_cat_notas_la_plaza = get_category_by_slug( 'notas-la-plaza-de-tu-mascotas' );
if ( in_category( $id_cat_notas_la_plaza )){
body_class('single-notas-la-plaza-de-tu-mascotas');
}else{
body_class();
}
?>
<body <?php get_template_part('file_name_where_the_last_code_was_wrote'); ?> >
@pablocattaneo
pablocattaneo / config.xml
Created February 23, 2016 19:45
Source: C:\xampp\htdocs\magento-c4arg2-2\src\main\php\webapp\app\code\local\Topgroup\Vuelta\etc\config.xml Setear las url de las custom pages. Set custom pages's url
<config>
<modules>
<Topgroup_Vuelta>
<version>1.0.0</version>
</Topgroup_Vuelta>
</modules>
<frontend>
<routers>
<vuelta>
In phpMyAdmin a 'Search' feature is available:
Select particular database not table.
Click 'Search' tab
Enter the search term you want
Select the tables you want to search in
@pablocattaneo
pablocattaneo / date.php
Created March 4, 2016 14:15
Date Wordpress Translate
<?php echo date_i18n('F'); ?>
@pablocattaneo
pablocattaneo / add_css_or_js_cms_page_magento.xml
Last active September 16, 2017 00:06
Agrega archivos js y css a una página especifica del cms. El código debe ser agregado en CMS -> Pages -> Manage Content -> Design -> Custom Layout Update XML. Add js and css files in a specific cms page. The code must be add in CMS -> Pages -> Manage Content -> Design -> Custom Layout Update XML.
<reference name="head">
<action method="addItem">
<type>skin_js</type>
<name>js/das-una-mano.js</name>
</action>
<action method="addCss">
<stylesheet>css/carrefour/cms/cms.css</stylesheet>
</action>
</reference>
@pablocattaneo
pablocattaneo / remove_css_or_js_cms_page_magento.xml
Last active September 16, 2017 00:06
Elimina archivos js y css a una página especifica del cms. El código debe ser agregado en CMS -> Pages -> Manage Content -> Design -> Custom Layout Update XML. Remove js and css files in a specific cms page. The code must be add in CMS -> Pages -> Manage Content -> Design -> Custom Layout Update XML.
<reference name="head">
<action method="removeItem">
<type>skin_css</type>
<name>css/frescos.css</name>
</action>
<!-- Evita que se cargue el recurso de la carpeta js que se carga en el theme que está activado -->
<action method="removeItem">
<type>skin_js</type>
<name>js/lib/bxslider/config_pft.js</name>
</action>
@pablocattaneo
pablocattaneo / get_category_id_filtering_by_name.php
Created March 18, 2016 15:42
Obtiene el ID de una categoría por su nombre. Get category ID filtering by name.
$category = Mage::getResourceModel('catalog/category_collection')->addFieldToFilter('name', 'clothing');
$cat= $category->getData();
$categoryid = $cat[0][entity_id];
@pablocattaneo
pablocattaneo / get_image_category_by_id.php
Last active September 16, 2017 00:06
Obtiene la imagen de una categoría por su ID. Get category image by ID.
$_helper = $this->helper('catalog/output');
$_category = Mage::getModel('catalog/category')->load(CATEGORYID);// get your category here.
$_imgHtml = '';
if ($_imgUrl = $_category->getImageUrl()) {
$_imgHtml = '<p class="category-image"><img src="'.$_imgUrl.'" alt="'.$this->htmlEscape($_category->getName()).'" title="'.$this->htmlEscape($_category->getName()).'" /></p>';
$_imgHtml = $_helper->categoryAttribute($_category, $_imgHtml, 'image');
echo $_imgHtml;
}