GithubHelp home page GithubHelp logo

selectj / magento2-fast-product-images Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xumulus/magento2-fast-product-images

0.0 0.0 0.0 65 KB

Magento 2 fast product images, removes loading image for product images

License: MIT License

PHP 0.33% HTML 7.77% JavaScript 91.90%

magento2-fast-product-images's Introduction

Join us in our fight to kill image loaders and spinners. They do nothing to improve the user experience.

Read more about it here.

You can see it live here

magento2-fast-product-images

Magento 2 fast product images removes the loading image from product images.

The default Magento 2 behavior for product images is to load a spinner, and then load all the images in the fotorama gallery. This results in the spinner being up until the dom loads, and js can take over and replace it. It makes even the fastest Magento 2 site seem slow.

This module is quite simple in that it replaces the spinner with the first image in the gallery. So now, the page should simply show the image, and not make you feel like you are waiting for it to load. It has a few challanges in that the JS for fotorama is in the core, as well as there are many themes customizing the gallery template.

If you have changed to your Magento_Catalog/templates/product/view/gallery.phtml file then you surely will need to make some changes to this.

Installation

composer config repositories.magento2-fast-product-images git [email protected]:xumulus/magento2-fast-product-images.git
composer require xumulus/magento2-fast-product-images:dev-master -n
bin/magento module:enable Xumulus_FastGalleryLoad
bin/magento setup:upgrade
bin/magento setup:static-content:deploy

Usage

Once installed, you will then need to enable the module Stores->Config->Xumulus->Fast Gallery Load

There are no admin settings; the module can be disabled if you would like to return to the default behavior.

Theme Modifications

If you are using a packaged theme, and it includes a ../Magento_Catalog/templates/product/view/gallery.phtml, it may require modification.

Genarally the approach is to copy the JavaScript rendered html after a page load, then integrate that into the gallery.phtml file so that it will render the html as needed the first time. This allows us to not have to reengineer fotorama.js and allows things like configurable products to still change the image upon colort selection for example.

Much of these changes could be applied to your gallerty.phtm in your theme.

Future Plans

Were waiting a bit after this to determine next steps. Contact use at [email protected] with questions.

Release Notes: 7/01/2018 Intial builds, expermentation. We understand some of this module could be optimized and code moved to block code etc but have not done that in the intial release.

magento2-fast-product-images's People

Contributors

belias1 avatar chuckxumulus avatar dankoz51 avatar liamkarlmitchell avatar manojxhtml786 avatar manojxumulus avatar smr-deploy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.