Skip to content

Instantly share code, notes, and snippets.

View toan-tam's full-sized avatar

Toan Tam toan-tam

View GitHub Profile
@toan-tam
toan-tam / affiliate_campaign_insert.sql
Created August 18, 2021 07:03
affiliate_campaign_insert.sql
TRUNCATE mageplaza_affiliate_campaign;
INSERT INTO `mageplaza_affiliate_campaign` (`campaign_id`, `name`, `description`, `status`, `website_ids`, `affiliate_group_ids`, `from_date`, `to_date`, `display`, `sort_order`, `conditions_serialized`, `actions_serialized`, `commission`, `discount_action`, `discount_amount`, `discount_qty`, `discount_step`, `discount_description`, `free_shipping`, `apply_to_shipping`, `created_at`, `updated_at`, `apply_discount_on_tax`, `customer_group_ids`, `stop_rules_processing`)
VALUES
(1, 'FHCB Affiliates', 'Default program for the Family Home Christian Books system.', 1, '1', '1,2,3,4,5,6', NULL, NULL, 1, 0, '{\"type\":\"Magento\\\\SalesRule\\\\Model\\\\Rule\\\\Condition\\\\Combine\",\"attribute\":null,\"operator\":null,\"value\":\"1\",\"is_value_processed\":null,\"aggregator\":\"all\",\"conditions\":[{\"type\":\"Magento\\\\SalesRule\\\\Model\\\\Rule\\\\Condition\\\\Product\\\\Found\",\"attribute\":null,\"operator\":null,\"value\":\"1\",\"is_value_processed\":null,\"aggregator\
@toan-tam
toan-tam / affiliate_transaction_insert.sql
Created August 14, 2021 17:50
affiliate_transaction_insert.sql
INSERT INTO `mageplaza_affiliate_transaction` (`transaction_id`, `account_id`, `customer_id`, `TYPE`, `amount`, `status`, `order_id`, `order_increment_id`, `store_id`, `created_at`)
VALUES
(70, 35, 500010, 1, 10.0000, 3, 111, '500012', 1, '2014-08-01 10:16:44'),
(71, 35, 500017, 1, 5.0000, 3, 112, '500013', 1, '2014-08-01 11:39:42'),
(72, 35, 100, 1, 37.4975, 4, 113, '500014', 1, '2014-08-01 13:32:34'),
(73, 35, 500050, 1, 15.0000, 3, 114, '500015', 1, '2014-08-01 16:19:57'),
(92, 35, 500079, 1, 0.0000, 4, 142, '500043', 1, '2014-08-11 17:32:40'),
(93, 35, 500079, 1, 0.0000, 4, 143, '500045', 1, '2014-08-11 17:48:18'),
(94, 35, 500084, 1, 0.0000, 4, 153, '500049', 1, '2014-08-11 19:08:17'),
(96, 35, 500086, 1, 0.0000, 4, 155, '500051', 1, '2014-08-11 19:41:02'),
@toan-tam
toan-tam / affiliate_account_insert.sql
Last active August 18, 2021 08:40
affiliate_account_insert.sql
INSERT INTO `mageplaza_affiliate_account` (`account_id`, `customer_id`, `code`, `group_id`, `balance`, `total_commission`, `total_paid`, `status`, `email_notification`, `tree`, `created_at`, `mobile_number`, `image`)
VALUES
(35, 89, '1441-1024', 1, 242.5890, 0.0000, 0.0000, 1, 0, 35, '2014-07-23 16:39:49', '517-648-2248', 'https://familyhomechristianbooks.com/media/affiliateplus/avatar/david-profile-image.jpg'),
(105, 500064, '1941-1094', 1, 31077.8175, 0.0000, 0.0000, 1, 1, 105, '2014-08-07 09:17:19', '404-299-1621', 'http://familyhomechristianbooks.com/media/affiliateplus/avatar/biblestorylogo2.JPG'),
(106, 500065, '1921-1095', 1, 12.7150, 0.0000, 0.0000, 1, 0, 106, '2014-08-07 13:13:51', '7049569194', NULL),
(113, 500073, '1921-1102', 1, 103.6350, 0.0000, 0.0000, 1, 1, 113, '2014-08-08 14:21:23', '8643951560', NULL),
(115, 500075, '1941-1104', 1, 45.4750, 0.0000, 0.0000, 1, 1, 115, '2014-08-11 16:42:02', NULL, 'https://familyhomechristianbooks.com/media/affiliateplus/avatar/angeline-johnson.jpg'),
(1
@toan-tam
toan-tam / hanging-sql-query.sql
Created July 17, 2021 05:21
hanging-sql-query.sql
This file has been truncated, but you can view the full file.
INSERT INTO
`transit_catalog_product_index_eav_temp`
SELECT
`e`.`entity_id` AS `parent_id`,
`i`.`attribute_id`,
`i`.`store_id`,
`i`.`value`,
`l`.`child_id` AS `source_id`
FROM
`catalog_product_relation` AS `l`
@toan-tam
toan-tam / .magento.app.yaml-build-hook
Last active May 5, 2022 08:05
.magento.app.yaml build hook
# We run build hooks before your application has been packaged.
build: |
set -e
echo "\n================================== Install and configure Baler - Start =================================="
echo "================= Install and configure Baler - Upgrade node version 14.4.0 - Start ================="
unset NPM_CONFIG_PREFIX
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | dash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
<?php
require_once __DIR__ . '/../app/bootstrap.php';
use \Magento\Framework\Api\SortOrder;
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
/** @var \Magento\Framework\App\State $appState */
$appState = $objectManager->get('\Magento\Framework\App\State');
$appState->setAreaCode(\Magento\Framework\App\Area::AREA_FRONTEND);
@toan-tam
toan-tam / module-catalog-search-fix-insert-into-hanging.patch
Last active April 21, 2020 22:12
Magento 2.3.2 EE - Patch for `INSERT INTO search_tmp_` search issue: https://github.com/magento/magento2/issues/15545
Index: Model/Search/FilterMapper/CustomAttributeFilter.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- Model/Search/FilterMapper/CustomAttributeFilter.php (date 1574535757476)
+++ Model/Search/FilterMapper/CustomAttributeFilter.php (date 1574535757476)
@@ -98,8 +98,21 @@
$attributes[] = $attributeId;