Skip to content

Instantly share code, notes, and snippets.

View deniscsz's full-sized avatar
🎯
Focusing

Denis Colli Spalenza deniscsz

🎯
Focusing
View GitHub Profile
@deniscsz
deniscsz / 1176574-teste.dat
Created October 2, 2026 17:25
Arquivo do EDI RN601 de teste
ITP60103000002610011614130047171500020302036483000614 CENTRO AUTOMOTIVO AUTO SACONTINENTAL DO BRASIL PRO
PP1000501176574 251126 251126 0000
AE3175243520001491752435200014917524352000149
PP203572990000 000000010PNEU 175 65 R14 POWERCONT000023306610 0001251126 09750000
PP215508620000 000000004PNEU 205 60 R16 POWERCONT000037316960 0002251126 09750000
PP215508460000 000000014PNEU 175 70 R14 POWERCONT000027921970 0003251126 09750000
PP203115770000 000000004PNEU 165/70 R14 ECOCONTAC000024851140 0004251126 09750000
PP215508510000 000000008PNEU 185 60 R15 POWERCONT000031997400 0005251126 09750000
@deniscsz
deniscsz / erp-magento-integration.md
Last active March 30, 2026 14:31
Guia de Integracao ERP x Magento 2.4.8 — Pedidos (Orders)
@deniscsz
deniscsz / states_hash.json
Created October 20, 2020 02:16 — forked from mshafrir/states_hash.json
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@deniscsz
deniscsz / github-issue-21646.patch
Created October 9, 2020 00:08
Fixing the error "Not all of your products are available in the requested quantity." when admin try create a shipment with backorder items
From 55dbc56b22f609c1b1a943f71566569f6f7affb0 Mon Sep 17 00:00:00 2001
From: Denis Colli Spalenza <deniscsz@gmail.com>
Date: Thu, 8 Oct 2020 21:01:08 -0300
Subject: [PATCH] Adding support to backorders
---
Model/SourceDeductionService.php | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/Model/SourceDeductionService.php b/Model/SourceDeductionService.php
@deniscsz
deniscsz / importProducts.php
Last active February 11, 2021 05:54
Import Products from PrestaShop export SQL CSV to Magento 1
<?php
define('MAGENTO', realpath(dirname(__FILE__)));
require_once MAGENTO . '/app/Mage.php';
umask(0);
Mage::app();
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$count = 0;
@deniscsz
deniscsz / export-products-prestashop.sql
Last active April 27, 2019 16:36
Export products from Prestashop 1.6 with categories and filtering by shop_id (no-images)
SELECT ps_product.id_product AS 'product_id',
ps_product.upc,
ps_product.reference AS 'sku',
ps_product.price,
ps_product.weight,
ps_product.width,
ps_product.height,
ps_product.depth,
ps_product.active AS 'status',
ps_product.date_add AS 'created_at',
@deniscsz
deniscsz / export-categories-prestashop.sql
Created April 26, 2019 01:29
Export Categories from Prestashop 1.6
SELECT cl.id_category,
c.id_parent as parent_id,
cl.name,
cl.description,
cl.link_rewrite,
cl.id_lang,
c.active,
c.position,
c.level_depth,
c.id_shop_default
@deniscsz
deniscsz / export.sql
Created April 24, 2019 06:32
Export products from Prestashop 1.6 to CSV file
SELECT ps_product.id_product AS 'sku',
ps_product.upc,
ps_product.price,
ps_product.weight,
ps_product.date_add AS 'created_at',
Concat('/img/p/', IF(Char_length(pi.id_image) >= 5, Concat(
Substring(pi.id_image, -5, 1), '/'), ''
), IF(Char_length(pi.id_image) >= 4, Concat(
Substring(pi.id_image, -4, 1), '/'), ''
), IF(Char_length(pi.id_image) >= 3, Concat(
@deniscsz
deniscsz / MPERF-10565.diff
Created April 21, 2019 14:30 — forked from piotrekkaminski/MPERF-10565.diff
MPERF-10565.diff - logging to a file that does not exist issue
diff --git a/app/Mage.php b/app/Mage.php
index 0e650eebb4f..9c18e222689 100644
--- a/app/Mage.php
+++ b/app/Mage.php
@@ -798,9 +798,9 @@ public static function log($message, $level = null, $file = '', $forceLog = fals
',',
(string) self::getConfig()->getNode('dev/log/allowedFileExtensions', Mage_Core_Model_Store::DEFAULT_CODE)
);
- $logValidator = new Zend_Validate_File_Extension($_allowedFileExtensions);
$logDir = self::getBaseDir('var') . DS . 'log';
@deniscsz
deniscsz / attributes.php
Last active January 29, 2019 20:54
Get Attributes displayed into Product View - Magento 1
<?php
$excludeAttr = array();
$attributes = $product->getAttributes();
foreach ($attributes as $attribute) {
if ($attribute->getIsVisibleOnFront() && !in_array($attribute->getAttributeCode(), $excludeAttr)) {
$value = $attribute->getFrontend()->getValue($product);
if (!$product->hasData($attribute->getAttributeCode())) {