Skip to content

Instantly share code, notes, and snippets.

@DominicWatts
DominicWatts / magento-2-send-email-without-transport-builder-or-template-command-line.md
Created July 19, 2024 13:43
Magento 2 send email without transport builder or template command line
use Magento\Framework\Mail\TransportInterfaceFactory;
use Magento\Framework\Mail\Message;

[...]

    protected $mailTransportFactory;

    public function __construct(
@DominicWatts
DominicWatts / magento-2-get-country-using-amasty.md
Created July 18, 2024 11:28
Magento 2 Geo IP get country using Amasty

Geo class

<?php
namespace PixieMedia\General\Helper;

use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Framework\App\Helper\Context;
use Magento\Store\Model\ScopeInterface;
use Amasty\Base\Model\GetCustomerIp;
@DominicWatts
DominicWatts / braintree-test-card-details.md
Created June 17, 2024 14:54
Braintree test card details
Test Value Card Type
378282246310005 American Express
371449635398431 American Express
36259600000004 Diners Club*
6011000991300009 Discover
3530111333300000 JCB
6304000000000000 Maestro
5555555555554444 Mastercard
2223000048400011 Mastercard
@DominicWatts
DominicWatts / magento-2-get-confirgurable-linked-attributes.md
Created June 10, 2024 09:58
Magento 2 get configurable linked attributes

Steps to Determine the Linked Attributes

To identify the attributes linking a configurable product (e.g., product ID 123) to its child products, follow these steps:

Find the Attribute IDs for the Configurable Product:

Query the catalog_product_super_attribute table to get the attribute_id values linked to the configurable product.

@DominicWatts
DominicWatts / stripe-test-card-details.md
Created March 27, 2024 14:16
Stripe Test Card Details
BRAND NUMBER CVC DATE
Visa 4242424242424242 Any 3 digits Any future date
Visa (debit) 4000056655665556 Any 3 digits Any future date
Mastercard 5555555555554444 Any 3 digits Any future date
Mastercard (2-series) 2223003122003222 Any 3 digits Any future date
Mastercard (debit) 5200828282828210 Any 3 digits Any future date
Mastercard (prepaid) 5105105105105100 Any 3 digits Any future date
American Express 378282246310005 Any 4 digits Any future date
American Express 371449635398431 Any 4 digits Any future date
@DominicWatts
DominicWatts / elavon-test-card-details.md
Last active March 27, 2024 14:19
Elavon test card details
Card Card Number CardType Response from Opayo 3D Secure Response from Opayo CV2 Value DATE
VISA 4929000000006 VISA Y 123 Any future date
VISA 4929000005559 VISA N 123 Any future date
VISA 4929000000014 VISA U 123 Any future date
VISA 4929000000022 VISA E 123 Any future date
VISA Corporate 4484000000002 VISA N 123 Any future date
VISA Debit 4462000000000003 DELTA

Enable MSI

php bin/magento module:status | grep Magento_Inventory | grep -v List | grep -v None | grep -v -e '^$' | xargs php bin/magento module:enable

Disable MSI

php bin/magento module:status | grep Magento_Inventory | grep -v List | grep -v None | grep -v -e '^$' | xargs php bin/magento module:disable

@DominicWatts
DominicWatts / windows-pageant-startup-with-keys.md
Created February 6, 2024 20:13
windows pageant startup with keys

startup app

Win + R

Run box

shell:startup

Copy Pageant shortcut

@DominicWatts
DominicWatts / debug-template-binding-errors-for-KnockoutJS.md
Created December 19, 2023 14:38
debug template binding errors for KnockoutJS

what data is available at a certain scope

<div data-bind="text: ko.toJSON($data)"></div>

more readable version

``

@DominicWatts
DominicWatts / onvert .ppk-key-to-OpenSSH-key-under-Linux.md
Created November 29, 2023 16:46
How to convert .ppk key to OpenSSH key under Linux?
sudo apt-get install putty-tools
puttygen key.ppk -O private-openssh -o key