Magento has recently merged an architecture proposal with the goal of removing non-composer modules.
At first this seems like a good idea, but I think there are some problems.
Magento listens to the community. That is a good thing.
# you need these installed if you want to: | |
sudo apt-get update | |
# resize images | |
sudo apt-get install imagemagick -y | |
# compress jpg and png files | |
sudo apt-get install jpegoptim optipng | |
# compress video's | |
sudo apt-get install ffmpeg | |
mysql -u <user> -p <db> -h <host> -e "SELECT distinct case when value like '/%' then concat('.',value) else value end FROM catalog_product_entity_media_gallery" | awk '{print $1}' | xargs ls | grep "cannot access" |
<?php | |
use Magento\Framework\App\Bootstrap; | |
require __DIR__ . '/app/bootstrap.php'; | |
$params = $_SERVER; | |
$bootstrap = Bootstrap::create(BP, $params); | |
$objectManager = $bootstrap->getObjectManager(); |
CREATE TABLE catalog_product_entity_int_old LIKE catalog_product_entity_int; | |
INSERT INTO catalog_product_entity_int_old SELECT * FROM catalog_product_entity_int; | |
DELETE FROM catalog_product_entity_int | |
WHERE value_id IN | |
(SELECT cpei.value_id | |
FROM catalog_product_entity_int_old cpei | |
WHERE cpei.attribute_id NOT IN | |
(SELECT eea.attribute_id | |
FROM eav_entity_attribute eea |
SELECT * FROM `catalog_product_entity` | |
LEFT JOIN `catalog_product_entity_int` ON `catalog_product_entity`.`entity_id` = `catalog_product_entity_int`.`entity_id` | |
WHERE `catalog_product_entity`.`type_id` = 'simple' AND `catalog_product_entity_int`.`attribute_id` = (SELECT `attribute_id` FROM `eav_attribute` WHERE `attribute_code` = 'visibility') AND `catalog_product_entity_int`.`value` = 1 AND `catalog_product_entity`.`entity_id` NOT IN | |
( | |
SELECT `product_id` FROM `catalog_product_super_link` | |
) |
<?php | |
/** | |
* Requires php >= 5.5 | |
* | |
* Use this script to convert utf-8 data in utf-8 mysql tables stored via latin1 connection | |
* This is a PHP port from: https://gist.github.com/njvack/6113127 | |
* | |
* BACKUP YOUR DATABASE BEFORE YOU RUN THIS SCRIPT! | |
* | |
* Once the script ran over your databases, change your database connection charset to utf8: |
<?php | |
namespace Yourcompany\Yourmodule\Controller\Test; | |
use Magento\Framework\Api\Data\VideoContentInterface; | |
use Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface; | |
use Magento\Framework\App\Action\Context; | |
use Magento\ProductVideo\Model\Product\Attribute\Media\ExternalVideoEntryConverter; | |
use Magento\Store\Model\Store; | |
use Magento\Framework\Exception\InputException; | |
use Magento\Framework\Exception\StateException; |
<?php | |
ini_set('display_errors', '1'); | |
ini_set('error_reporting', E_ALL); | |
use Magento\Framework\App\Bootstrap; | |
require 'app/bootstrap.php'; | |
$bootstrap = Bootstrap::create(BP, $_SERVER); | |
$objectManager = $bootstrap->getObjectManager(); |
Magento has recently merged an architecture proposal with the goal of removing non-composer modules.
At first this seems like a good idea, but I think there are some problems.
Magento listens to the community. That is a good thing.
<!-- AOS --> | |
Step 1: follow: https://michalsnik.github.io/aos/ | |
Step 2: Add | |
<link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet"> | |
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script> | |
Step 3: add jquery dependency (requirejs-config.js) | |
var config = { | |
shim: { | |
jquery: { |