use Magento\Cms\Model\Template\FilterProvider;
use Magento\Framework\App\State;
use Magento\Framework\View\Design\Theme\ThemeProviderInterface;
use Magento\Framework\View\DesignInterface;
use Magento\Store\Model\ScopeInterface;
use Magento\Framework\App\Config\ScopeConfigInterface;
// Replace with your actual PayPal API credentials
$api_username = "";
$api_password = "";
$api_signature = "";
// PayPal API endpoint (sandbox or live)
$api_endpoint = "https://api-3t.paypal.com/nvp"; // Live endpoint
// For sandbox testing: $api_endpoint = "https://api-3t.sandbox.paypal.com/nvp";
<script>
require(['jquery'], function($) {
$(document).ready( function() {
var checkExist = setInterval(function() {
if ($('.element__class').length) {
// do something
clearInterval(checkExist);
}
}, 500); // check every 500ms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* php bin/rule.check.php "XYZ" | |
*/ | |
use Magento\Framework\App\Bootstrap; | |
require __DIR__ . '/../app/bootstrap.php'; | |
$params = $_SERVER; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# phtml somewhere | |
<?php $myCmsBlock = $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('my_cms_block')->toHtml() ?> | |
<script type="text/javascript"> | |
var my_cms_block = <?php echo json_encode($myCmsBlock)?>; | |
</script> | |
# html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install docker in Debian 11/WSL2 | |
# uses systemd-genie since docker requires systemd but it's not available for WSL | |
# this is an alternative to Docker Desktop | |
# prerequisites | |
sudo apt-get update | |
sudo apt-get dist-upgrade | |
sudo apt-get install ca-certificates curl wget gnupg lsb-release apt-transport-https | |
# systemd-genie requires dotnet runtime, add Microsoft repo |