Skip to content

Instantly share code, notes, and snippets.

View vbuck's full-sized avatar

Rick Buczynski vbuck

View GitHub Profile
@vbuck
vbuck / build-acl.php
Created June 13, 2022 15:44
Magento 2 ACL Report Generator: Utility for creating a flat list of all ACL entries in a given installation. Useful for analyzing and comparing permissions structures to other platforms or use cases.
<?php
/**
* Utility for creating a flat list of all ACL entries in a given installation. Useful for analyzing and comparing permissions structures to other platforms or use cases.
*
* How to use:
* [SEPARATOR="{value}"] php build-acl.php
*
* Runtime or environment variables:
* SEPARATOR - Optional. Specifies the resource hierarchy separator. Default: "." (dot-notation)
*/
@vbuck
vbuck / adobe-cloud-magerun-dev-console.sh
Created December 22, 2021 17:03
Use N98-Magerun Dev Console in Adobe Cloud Environments
cd /tmp
curl -O https://files.magerun.net/n98-magerun2.phar
chmod +x ./n98-magerun2.phar
XDG_CONFIG_HOME="/tmp" ./n98-magerun2.phar dev:console --root-dir=$MAGENTO_CLOUD_DIR
@vbuck
vbuck / config.php
Created December 14, 2021 19:47
wct-pipeline-magento2-app-config
<?php
return [
'modules' => [
'Magento_AdminAnalytics' => 1,
'Magento_Store' => 1,
'Magento_AdminGwsConfigurableProduct' => 1,
'Magento_AdminGwsStaging' => 1,
'Magento_Directory' => 1,
'Magento_AdobeIms' => 1,
'Magento_AdobeImsApi' => 1,
@vbuck
vbuck / load-blocks-from-url-params.html
Created July 1, 2021 16:40
Magento 2: Dynamically Load Blocks from URL Parameters
<script type="application/javascript">
/**
* Edit each block of conditions below based on your requirements
*/
var conditions = [
{
'parameter': 'utm_source',
'value': 'google',
'blockId': 'block-segment-a'
@vbuck
vbuck / magento-config-diff-generator.php
Created March 18, 2021 15:12
Calculate the diff between 2 Magento core_config_data tables and generate as SQL
<?php
namespace MagentoTools;
class Generator
{
private $config = [
'type' => CsvSnapshotConfig::class,
'left' => null,
'right' => null,
diff --git a/app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php b/app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php
index ff31aa4ba90..b279408ba8e 100644
--- a/app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php
+++ b/app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php
@@ -188,6 +188,7 @@ class CommonTaxCollector extends AbstractTotal
* @param bool $priceIncludesTax
* @param bool $useBaseCurrency
* @param string $parentCode
+ * @param bool $useOriginalPrice
* @return \Magento\Tax\Api\Data\QuoteDetailsItemInterface
@vbuck
vbuck / gist:ee728c235f258d99552000c463c41e6b
Created October 18, 2016 20:34
WP Smush "Bulk Smush Pusher"
// Execute in your console while WP Smush is open to bulk smush in intervals of 50 automatically
var smushTimer = setInterval( function() { !jQuery('.wp-smush-button').attr('disabled') ? jQuery('.wp-smush-button').click() : console.log('smush-check'); }, 3000);
@vbuck
vbuck / Navigation.php
Created August 3, 2015 19:14
The Missing Magento Customer Account Navigation Block
<?php
/**
* Customer account navigation block extensions.
*
* PHP Version 5
*
* @category Class
* @package Vbuck_Common
* @author Rick Buczynski <me@rickbuczynski.com>