Skip to content

Instantly share code, notes, and snippets.

View deniscsz's full-sized avatar
🎯
Focusing

Denis Colli Spalenza deniscsz

🎯
Focusing
View GitHub Profile
if($("#shipping_postcode").size() > 0) {
$(document).ready(function(){
GER_localizacao = 'http://www.vacamarela.com/lojadoamigo/'
$("#shipping_postcode").keyup(function(){
resultado = GER_localizacao+'webservices.php?cep='+$(this).val();
if($(this).val().length > 7){
$.ajax({
url:resultado,
type:'GET',
dataType: 'xml',
@deniscsz
deniscsz / mysql4-install-0.1.1.php
Created August 19, 2012 01:40
Arquivo que altera o BD
<?php
$installer = $this;
$installer->startSetup();
$setup = Mage::getModel('customer/entity_setup', 'core_setup');
$setup->addAttribute('customer', 'tipopessoa', array(
'type' => 'int',
'input' => 'select',
@deniscsz
deniscsz / Tipopessoa.php
Created August 19, 2012 02:37
Novoatributo\Model\Entity\Tipopessoa.php
<?php
class Alexbraga_Novoatributo_Model_Entity_Tipopessoa extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
{
public function getAllOptions()
{
if ($this->_options === null) {
$this->_options = array();
$this->_options[] = array(
'value' => '',
'label' => 'Escolha a opco..'
<onepagecheckout_setup>
<setup>
<module>IWD_OnepageCheckout</module>
<class>Mage_Customer_Model_Entity_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</onepagecheckout_setup>
<?php
$installer = $this;
$installer->startSetup();
$setup = Mage::getModel('customer/entity_setup', 'core_setup');
$setup->addAttribute('customer', 'tipopessoa', array(
'type' => 'int',
'input' => 'select',
<customer_account_create>
<reference name="customer_form_register">
<action method="setTemplate"><template>novoatributo/persistent/customer/form/register.phtml</template></action>
</reference>
</customer_account_create>
<customer_account_edit>
<reference name='customer_edit'>
<action method="setTemplate"><template>novoatributo/customer/form/edit.phtml</template></action>
</reference>
</customer_account_edit>
package com.phonegap.plugin.localnotification;
import java.util.Calendar;
import org.json.JSONArray;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.util.Log;
@deniscsz
deniscsz / Frete Fácil
Created October 9, 2012 13:42
Calculando que todos os produtos tem apenas UM custo de envio.
/**
* calculates total value from quote
*
* @return int|float
*/
public function getShippingPrice() {
/**
* get quote items
*/
$items = Mage::getSingleton('checkout/cart')->getItems();
@deniscsz
deniscsz / Frete Fácil
Created October 9, 2012 14:00
Calculando que os produtos terão custo de envio de 3 em 3 unidades.
/**
* calculates total value from quote
*
* @return int|float
*/
public function getShippingPrice() {
/**
* get quote items
*/
$items = Mage::getSingleton('checkout/cart')->getItems();
@deniscsz
deniscsz / mask-phone
Created November 19, 2012 11:27
Mascara de Tel com 9 dígitos
$('input[name*="[telephone]"]').keydown( function(e){
if (e.keyCode >= 9){
length = this.value.length;
if (length == 0)
this.value += "(";
if (length == 3)
this.value += ")";
/*
Testa para ver se o ddd começa com 11 e coloca maxlength para 14