Skip to content

Instantly share code, notes, and snippets.

View Tomasz-Silpion's full-sized avatar
💭
I may be slow to respond.

Tomasz Gregorczyk Tomasz-Silpion

💭
I may be slow to respond.
View GitHub Profile
@Tomasz-Silpion
Tomasz-Silpion / config.php
Created October 24, 2017 14:36
Get element from multidimensional array by path in php
<?php
/**
* @author Silpion <tomasz@silpion.com.pl>
*/
class Config {
protected $config = [
'a' => [
@Tomasz-Silpion
Tomasz-Silpion / recipients.sql
Created October 30, 2017 16:47
Get Magento queue recipients who received outdated email
SELECT DISTINCT `recipient_email` FROM `core_email_queue` INNER JOIN `core_email_queue_recipients` ON `core_email_queue`.`message_id` = `core_email_queue_recipients`.`message_id` WHERE `processed_at` > '2017-10-30 00:00:00' AND `created_at` < '2017-10-25 00:00:00'
@Tomasz-Silpion
Tomasz-Silpion / hide_children_products.php
Created February 15, 2018 13:16
Hide Magento 1 products with configurable parents
<?php
require_once 'abstract.php';
class Hide_Children_Products extends Mage_Shell_Abstract {
/**
* Hide products having at least one configurable parent
*/
public function run()
@Tomasz-Silpion
Tomasz-Silpion / pca.js
Last active March 21, 2019 13:33 — forked from thomaslorentsen/pca.js
Custom integration of post code anywhere
pca.on("load", function (type, id, control) {
control.listen("populate", function (address) {
console.log('here');
});
});
@Tomasz-Silpion
Tomasz-Silpion / payments.sql
Created July 20, 2016 17:20
Get all customers payment methods between range of dates from Magento database
SELECT
o.grand_total AS 'Order Total',
o.created_at AS 'Payment Day',
p.method AS 'Payment Method',
CONCAT_WS(' ', o.customer_firstname, o.customer_lastname) AS 'Customer Name',
o.increment_id AS 'Order Number'
FROM sales_flat_order o
LEFT JOIN sales_flat_order_payment p ON p.entity_id = o.entity_id
WHERE (o.created_at BETWEEN '2016-01-01' AND '2016-12-31')
@Tomasz-Silpion
Tomasz-Silpion / truncate_woocommerce_data.sql
Created August 14, 2020 19:40
Delete WooCommerce orders and customers
DELETE FROM `wp_woocommerce_order_itemmeta`;
DELETE FROM `wp_woocommerce_order_items`;
DELETE FROM `wp_comments` WHERE `comment_type` = 'order_note';
DELETE FROM `wp_postmeta` WHERE `post_id` IN (SELECT `ID` FROM `wp_posts` WHERE `post_type` = 'shop_order');
DELETE FROM `wp_posts` WHERE `post_type` = 'shop_order';
DELETE FROM `wp_users` WHERE `wp_users`.`ID` NOT IN (SELECT `meta_value` FROM `wp_postmeta` WHERE `meta_key` = '_customer_user') AND `wp_users`.ID NOT IN (SELECT DISTINCT (`post_author`) FROM `wp_posts`);
DELETE FROM `wp_usermeta` WHERE `user_id` NOT IN (SELECT `ID` FROM `wp_users`);
TRUNCATE `wp_woocommerce_order_items`;
TRUNCATE `wp_woocommerce_order_itemmeta`;
@Tomasz-Silpion
Tomasz-Silpion / lestifpc_manadev.patch
Created September 15, 2023 00:02 — forked from peterjaap/lestifpc_manadev.patch
Fix Lesti_Fpc + Manadev SEO Layered Navigation
diff --git a/app/code/community/Lesti/Fpc/Helper/Data.php b/app/code/community/Lesti/Fpc/Helper/Data.php
index 94e9ea1..daec7e1 100644
--- a/app/code/community/Lesti/Fpc/Helper/Data.php
+++ b/app/code/community/Lesti/Fpc/Helper/Data.php
@@ -70,7 +70,13 @@ class Lesti_Fpc_Helper_Data extends Lesti_Fpc_Helper_Abstract
'port' => $request->getServer('SERVER_PORT'),
'full_action_name' => $this->getFullActionName());
$uriParams = $this->_getUriParams();
- foreach ($request->getParams() as $requestParam =>
+ $manadevParams = array();