Skip to content

Instantly share code, notes, and snippets.

public function productSearchAction(Request $request)
{
$q = $request->query->get('q');
$q = preg_split('/\s+/', $q);
$dql = array();
$em = $this->getDoctrine()->getManager();
$search = $em->getRepository('DmitroShopBundle:Product');
$qb = $search->createQueryBuilder('prod');
foreach ($q as $i => $_q) {
$dql[] = "prod.name LIKE :q$i";
<?php declare(strict_types=1);
namespace Hrytsenko\PluginExample\Plugin;
use Magento\Catalog\Api\ProductRepositoryInterface;
use Psr\Log\LoggerInterface;
class ProductRepositoryExamplePlugin
@MintayRibkins
MintayRibkins / PaymentFilterExamplePlugin.php
Created February 4, 2020 15:03
PaymentModulePart1Example
<?php declare(strict_types=1);
namespace Hrytsenko\PluginExample\Plugin;
use Exception;
use Magento\Customer\Model\SessionFactory;
use Magento\Payment\Api\PaymentMethodListInterface;
class PaymentFilterExamplePlugin
{
@MintayRibkins
MintayRibkins / component.tw.html
Created December 23, 2020 23:21
Tailwind checkout
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link href="https://tailwindcomponents.com/css/component.ecommerce-checkout.css" rel="stylesheet">
<title>Корзина</title>
</head>
@MintayRibkins
MintayRibkins / cacert.pem
Created October 17, 2023 13:47
gigya peer's certificate issuer has been marked as not trusted by the user.
##
## ca-bundle.crt -- Bundle of CA Root Certificates
##
## Certificate data from Mozilla as of: Sat Dec 29 20:03:40 2012
##
## This is a bundle of X.509 certificates of public Certificate Authorities
## (CA). These were automatically extracted from Mozilla's root certificates
## file (certdata.txt). This file can be found in the mozilla source tree:
## http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1
##
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<title>Trova il tesoro!</title>
</head>
<body>
<h1 id="heading">Trova il tesoro!</h1>
<img id="map" width=400 height=400 src="img.png" alt="">
<p id="distance"></p>
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/** @var \Magento\Framework\View\Element\Template $block */
?>
<?= $block->escapeHtml(__('qualcosa è andato storto')); ?>
<?php
namespace Buffetti\FormHelper\Plugin;
use Magento\Customer\Model\Customer;
use Magento\Customer\Model\CustomerRegistry;
use Magento\Framework\Exception\NoSuchEntityException;
use PHPUnit\Util\Exception;
/**
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\CustomerGraphQl\Model\Resolver\IsEmailAvailable">
<plugin name="CustomerGraphQl"
type="Buffetti\FormHelper\Plugin\IsEmailAvaibleBefore"/>
</type>
<type name="Magento\Customer\Model\CustomerRegistry">
<plugin name="CustomerRegistryOverrideAfter"
type="Buffetti\FormHelper\Plugin\CustomerRegistryOverride"