Skip to content

Instantly share code, notes, and snippets.

View andreregino's full-sized avatar

André Regino andreregino

View GitHub Profile
<models>
  <catalog>
      <rewrite>
          <layer_filter_category>Loja_Modulo_Model_Layer_Filter_Category</layer_filter_category>
      </rewrite>
  </catalog>
</models>

core/Mage/Catalog/Model/Layer/Filter/Category.php

 ionic cordova build --release android

Se der erro do TSC

npm install --save-dev @angular/tsc-wrapped

Removing bullet decoration for ul and li

ul {
  list-style-type: none;
}

Except last child

&amp;:not(:last-child)

Criando uma modal que exibirá uma imagem qualquer no centro

HTML

<div class="modal-size-chart">
  <img src="caminho-do-icone-de-fechar-a-modal.jpg" class="close-modal">
  <div class="size-chart-content">
    <img src="caminho-da-imagem-a-ser-exibida-na-modal.jpg">
  </div>
</div>
@andreregino
andreregino / rewrite.markdown
Last active February 5, 2018 02:56
Uso da função rewrite do wp

Função Rewrite

function rewrite_custom() {
  flush_rewrite_rules();
  
  // 3 parâmetros na url, faz rewrite para index?products
  add_rewrite_rule('catalogo/([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)?', 'index.php?products=$matches[3]', 'top');
  
 // 2 parâmetros, faz rewrite para index?subgrupo

jQuery

Verify if value "value" is inside array "arr"

jQuery.inArray("value", arr);

Get html object by name

@andreregino
andreregino / cart_get_products.markdown
Last active February 13, 2018 03:26
Métodos relacionados ao carrinho

CART

Pega todos os itens que estão atualmente no carrinho

$items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();
foreach($items as $item) {
        $peso = $item->getWeight();
}
<div style="width:310px; height: 135px;border: 1px solid #d8d1d1;">
<img src="components/html.png" style="float: left">
<img src="components/css.png" style="float: left">
<img src="components/js.png" style="float: right;">
<img src="components/gulp.png" style="float: left;">
<img src="components/sass.png" style="float: right; clear: left;">
</div>
<div style="width:310px; height: 320px;border: 1px solid #d8d1d1;">
<img src="components/html.png" style="float: left">
<img src="components/css.png" style="float: left">
<img src="components/js.png" style="float: right; clear: left;">
<img src="components/gulp.png" style="float: left;clear: right;">
<img src="components/sass.png" style="float: left;clear: left;">
</div>
<!DOCTYPE html>
<html>
<head>
<title>Testes com Float e Clear</title>
</head>
<body>
<div style="width:300px; height: 300px">
<img src="components/html.png"/>
<img src="components/css.png" />
<img src="components/js.png"/>