Skip to content

Instantly share code, notes, and snippets.

View deivisonarthur's full-sized avatar

Deivison Arthur Lemos Serpa deivisonarthur

View GitHub Profile
@deivisonarthur
deivisonarthur / container.php
Last active August 29, 2015 14:20
Atualiza o container dos produtos configurados. Esse problema dá quando se importa produtos configurados e não exibe o preço, somente entrando no admin e salvando cada um dos produtos é que é exibido o preço. Isso se dá porque faltou algum campo obrigatório na importação e quando se entra pelo admin ele ja vem selecionado a primeira opção, assim…
<?php
/*
Executar via cron com o comando php container.php
*/
require_once('app/Mage.php');
umask(0);
#Mage::app('default');
Mage::app();
@deivisonarthur
deivisonarthur / gist:cd306c1fb5b8ac10d859
Created April 9, 2015 23:28
Para tratar o erro do mcrypt pelo shell : PHP Fatal error: Call to undefined function mcrypt_module_open() in .../lib/Varien/Crypt/Mcrypt.php on line 63
sudo aptitude install mcrypt
sudo aptitude install php5-mcrypt
execute e veja se agora existe na listagem o mcrypt
php -m
fonte: http://askubuntu.com/questions/350942/cannot-get-mcrypt-for-php5
@deivisonarthur
deivisonarthur / configurable.php
Created February 12, 2015 02:58
Para erros de import dos produtos configuraveis do magento (Quando se faz necessário entrar no produto pelo admin e salvar para que ele aprareça)
<?php
require_once('app/Mage.php');
umask(0);
#Mage::app('default');
Mage::app();
#Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$collection = Mage::getResourceModel('catalog/product_collection')
->addAttributeToSelect('entity_id')
@deivisonarthur
deivisonarthur / gist:fc3ee625831e257c5154
Created February 11, 2015 00:46
Remover validação do método de pagamento Mundipagg para reload do review com desconto
jQuery('input[name="payment[method]"]').on('click', function () {
jQuery('#mundipagg_cc_type').removeClass('required-entry validate-cc-type-select');
jQuery('#mundipagg_cc_parcelamento').removeClass('required-entry validate-type-select');
jQuery('#mundipagg_cc_number').removeClass('validate-cc-number validate-cc-type');
jQuery('#mundipagg_cc_owner').removeClass('required-entry');
jQuery('#mundipagg_cc_cpf').removeClass('required-entry');
jQuery('#mundipagg_expiration').removeClass('validate-cc-exp required-entry');
jQuery('#mundipagg_expiration_yr').removeClass('required-entry');
jQuery('#mundipagg_cc_cid').removeClass('cvv required-entry validate-cc-cvn');
@deivisonarthur
deivisonarthur / setup.php
Created November 12, 2014 03:58
Como remover atributos das categorias do magento (atributo fdp criado por theme comprada) ERRO: Modelo base "neoshopsettings/blockposition" não encontrado para o atributo "category_block_position" - da template neoshop do themeforest
<?php
include_once 'app/Mage.php';
//Mage::app('default');
Mage::app();
$installer = Mage::getResourceModel('catalog/setup','catalog_setup');
@deivisonarthur
deivisonarthur / Atributo-Tipopessoa.php
Last active September 21, 2016 23:43
OSC 6 Pro - Remoção do atributo tipopessoa do OSC 4 antigo da tabela eav-attribute (O erro apresentando: Falha ao carregar módulo da configuração. Exemplo do erro http://screencast.com/t/Y9KmWizPsob2) - Adicione esse arquivo na raiz do magento, rode ele pelo navegador e depois o exclua.
<?php
include_once 'app/Mage.php';
//Mage::app('default');
Mage::app();
$installer->startSetup();
@deivisonarthur
deivisonarthur / mysql4-upgrade-2.0.0-2.0.1.php
Created October 1, 2014 05:51
OSC 6 Pro - Forçando o SETUP 1 (Incluindo os Estados)
include_once 'app/Mage.php';
//Mage::app('default');
Mage::app();
$installer = Mage::getResourceModel('sales/setup', 'default_setup');
//$installer = $this;
$installer->startSetup();
/**
By Klaus Wuestefeld
1) Torne-se excelente.
Seja realmente bom em alguma coisa. Não fique só choramingando ou
querendo progredir às custas dos outros. Não pense q pq vc sentou 4
anos numa faculdade ouvindo um professor falar sobre software q vc
sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo
aula. Ele pratica. Instrumentistas geniais nao aprendem a tocar tendo
aula. Eles praticam. Pratique. Chegue em casa depois do trabalho e da
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE `catalog_category_entity`;
TRUNCATE TABLE `catalog_category_entity_datetime`;
TRUNCATE TABLE `catalog_category_entity_decimal`;
TRUNCATE TABLE `catalog_category_entity_int`;
TRUNCATE TABLE `catalog_category_entity_text`;
TRUNCATE TABLE `catalog_category_entity_varchar`;
TRUNCATE TABLE `catalog_category_product`;
TRUNCATE TABLE `catalog_category_product_index`;
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE `catalog_product_bundle_option`;
TRUNCATE TABLE `catalog_product_bundle_option_value`;
TRUNCATE TABLE `catalog_product_bundle_selection`;
TRUNCATE TABLE `catalog_product_entity_datetime`;
TRUNCATE TABLE `catalog_product_entity_decimal`;
TRUNCATE TABLE `catalog_product_entity_gallery`;
TRUNCATE TABLE `catalog_product_entity_int`;
TRUNCATE TABLE `catalog_product_entity_media_gallery`;