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 / 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 <[email protected]>
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())) {
@deniscsz
deniscsz / schema.xml
Created October 10, 2018 13:18
Feed XML schema
<item>
<title> {{var name}} </title>
<link>
{{var url}}
</link>
<description>
<![CDATA[ {{var description}} ]]>
</description>
<g:id>
{{var sku}}
@deniscsz
deniscsz / delete_customers_and_orders_from_magento.sql
Created September 22, 2018 17:39 — forked from joostvanveen/delete_customers_and_orders_from_magento.sql
Delete all customers and orders from Magento 1*
--
-- This query delelets all customers and orders from your
-- Magento 1.* install. Handy, if you have a bloated
-- Magento database and you need to do a bit
-- of cleaning up for use on a local machine.
--
-- Replace PREFIX_ with your current Magento table prefix.
--
-- USE AT OWN RISK. ALWAY BACKUP YOUR DATABASE FIRST.
--