Skip to content

Instantly share code, notes, and snippets.

View roman204's full-sized avatar
🎯
Focusing

Roman Hutterer roman204

🎯
Focusing
View GitHub Profile
@roman204
roman204 / Chooser.php
Created November 9, 2022 07:40
overwrite cms block chooser to get storeView into grid
<?php
namespace CopeX\LandingPageIdentifier\Block\Adminhtml\Page\Widget;
use Magento\Backend\Block\Template\Context;
use Magento\Backend\Helper\Data;
use Magento\Cms\Model\Page;
use Magento\Cms\Model\PageFactory;
use Magento\Cms\Model\ResourceModel\Page\CollectionFactory;
use Magento\Framework\View\Model\PageLayout\Config\BuilderInterface;
@roman204
roman204 / configurator-frame.js
Last active June 18, 2020 15:27
handle the iframe height via postMessage
define([
'jquery',
], function ($) {
// modified from same-domain version at www.dyn-web.com/tutorials/iframes/height/
function setIframeHeightCO(id, ht) {
var ifrm = document.getElementById(id);
// some IE versions need a bit added or scrollbar appears
ifrm.style.height = ht + 4 + "px";
}
@roman204
roman204 / test.html
Last active June 7, 2020 11:20
POC for sending data to parent window when the document is embedded via iframe, it uses the postMessage function
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
// Get height of document
function getDocHeight(doc) {
@roman204
roman204 / composer.json replace magento 2.3.3
Last active October 16, 2019 06:31
this is a replacement list for composer.json fileis removes the 3rdparty modules from magento which are not required
"replace": {
"magento/module-advanced-pricing-import-export": "*",
"magento/module-amqp": "*",
"magento/module-analytics": "*",
"magento/module-authorizenet": "*",
"magento/module-bundle-import-export": "*",
"magento/module-catalog-analytics": "*",
"magento/module-customer-analytics": "*",
"magento/module-customer-import-export": "*",
"magento/module-cybersource": "*",
@roman204
roman204 / check.php
Created May 23, 2018 13:03
diff magento2 modules from config.local.php and config.prod.php
<?php
$local = include('config.local.php');
$prod = include('config.prod.php');
echo "modules in local but not in prod" . PHP_EOL;
foreach($local['modules'] as $module => $value){
if(!isset($prod['modules'][$module])){
echo $module . PHP_EOL;
}
@roman204
roman204 / default.xml
Created March 27, 2018 09:01
layout file for search field when Magento2 got Smile_ElasticSuite and Ultimo Theme
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="footer_links" remove="true" />
<referenceContainer name="header-wrapper">
<block class="Smile\ElasticsuiteCore\Block\Search\Form\Autocomplete" name="top.search" as="topSearch" template="Smile_ElasticsuiteCore::search/form.mini.phtml">
<arguments>
<argument name="rendererList" xsi:type="array">
<item name="term" xsi:type="array">
<item name="title" xsi:type="string" translate="true">Search terms</item>
@roman204
roman204 / form.mini.phtml
Last active January 30, 2019 08:16
template for form.mini.phtml when Smile_ElasticSuite and Ultimo is used in Magento2
<?php
/**
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Smile Elastic Suite to newer
* versions in the future.
*
*
* @category Smile
* @package Smile\ElasticsuiteCore
@roman204
roman204 / checkModules.php
Created January 13, 2018 20:28
compare module of magento2 in config.dev.php and config.prod.php
<?php
/**
* CopeX GmbH https://copex.io
* Created by PhpStorm.
* User: roman
* Date: 13.01.18
* Time: 21:23
*/
$dev = include 'config.dev.php';
@roman204
roman204 / .gitlab-ci.yml
Last active October 22, 2017 08:02
magento2 gitlab-CI config
image: copex/ci
before_script:
# Install ssh-agent if not already installed, it is required by Docker.
- which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
# Run ssh-agent (inside the build environment)
- eval $(ssh-agent -s)
# Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
- ssh-add <(echo "$SSH_PRIVATE_KEY")
@roman204
roman204 / review.phtml
Created April 14, 2017 08:56
IE11 Fix for magento1 review is not defined
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php