Download the PHP package rollpix/module-configurable-gallery without Composer

On this page you can find all versions of the php package rollpix/module-configurable-gallery. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package module-configurable-gallery

Rollpix_ConfigurableGallery

Magento 2 module for managing galleries on configurable products via color mapping. Images and videos are uploaded once on the configurable parent, tagged to a color option, and the gallery is filtered client-side when a swatch is selected.

Compatibility: Magento 2.4.7+ · PHP 8.1 – 8.4


Problem

In apparel stores a configurable product is typically color × size (e.g. 8 colors × 6 sizes = 48 simple SKUs). The visual variant is color, not size, yet Magento forces image management at the simple-product level. This means:

Solution

  1. Single upload point — images live on the configurable parent.
  2. Explicit color tag — each image/video is mapped to an option_id via associated_attributes.
  3. Optional propagation — parent-to-children inheritance for SEO/feeds.
  4. Centralised stock filter — colors without stock are hidden or dimmed.
  5. Gallery-agnostic — adapters for Fotorama, Rollpix Gallery, Amasty, and Hyva.

Installation

Via Composer (recommended)

Manual

Copy the module to app/code/Rollpix/ConfigurableGallery/ then run:

Hyva compatibility

If using Hyva Theme, also enable the companion sub-module:


Configuration

Stores > Configuration > Rollpix > Galeria Configurable

General

Field Default Description
Enable Module Yes Global on/off switch
Selector Attributes color Priority-ordered list of swatch attributes used for image mapping. The module uses the first attribute that matches the product's super attributes (variants).
Show Generic Images Yes Display untagged images alongside the selected color's images
Preselect Variant (PDP) Yes Automatically select the first in-stock color on the product detail page
Preselect Variant (PLP) Yes Automatically select the first in-stock color on category listing pages
Deep Link by Color Yes Allow #color=318 or ?color=rojo URL parameters
Update URL on Select Yes Update the URL hash when a swatch is clicked
SEO-friendly URL by Color No Clean URLs like /product/color/rojo instead of ?color=rojo. Requires Deep Link enabled.
Dropdown Support No Enables color-based gallery filtering when the selector attribute renders as a native <select> dropdown (instead of swatches). Useful for clients who prefer dropdowns over visual swatches. When OFF the module has zero functional impact on the native dropdown flow.

Stock

Field Default Description
Filter by Stock Yes Hide/dim colors that have no salable simples
Out-of-Stock Behavior Hide hide removes images from the gallery; dim adds a CSS class

Propagation

Field Default Description
Propagation Mode Disabled disabled / automatic / manual
Roles to Propagate image, small_image, thumbnail Image roles assigned on propagated images
Clean Before Propagate Yes Remove previously propagated images before re-propagating

Cart / Checkout

Field Default Description
Cart Image Override Yes Show the selected color's image in cart, mini-cart, and checkout
Run With the Module Disabled No Let the cart image override run even when General > Enable Module is No. Opt-in escape hatch for stores that only want the cart/checkout thumbnail fixed, without the PDP gallery and PLP swatch behaviour. Requires Cart Image Override = Yes.

Advanced

Field Default Description
Debug Mode No Verbose logging to var/log/rollpix_gallery.log
Gallery Adapter Auto Force a specific adapter (fotorama / rollpix / amasty) or auto-detect

Usage

1. Map images to colors

Edit a configurable product in the admin. In the Images and Videos panel each media entry shows a color dropdown. Select the color option each image belongs to, or leave as "All Colors" for generic/brand images.

Auto-detection from filename: When uploading images whose filenames contain a color name, the module automatically assigns the color. For example, rojo_frente.jpg is assigned to "Rojo", campera_azul_marino.jpg to "Azul Marino". Auto-detected assignments are highlighted in yellow so you can verify and correct if needed. Supports Spanish accents, compound colors, and partial matches.

Note: The color selector appears after saving the product. Newly uploaded images do not have a database ID yet, so the dropdown is injected once the product is saved and the page reloads.

The module works automatically on all configurable products that have at least one matching selector attribute. No per-product toggle is needed.

2. Color preselection

When the page loads, the module automatically selects a color and filters the gallery. The priority order is:

  1. URL parameter — #color=318 or ?color=rojo
  2. First color with stock — when stock filter is enabled
  3. First color by position — fallback when stock filter is disabled
  4. First visible swatch (DOM) — leverages Magento's native stock validation for swatch visibility

When the user deselects a swatch, the gallery shows images from all in-stock colors (respecting the stock filter), not all images.

3. Deep linking

Share URLs with a pre-selected color:

SEO-friendly URLs

When enabled in General > URL SEO-friendly por Color, the module generates clean, crawlable URLs:

The attribute code segment is dynamic (uses the resolved selector attribute for each product). Labels are slugified with accent normalization (Marrón → marron, Azul Marino → azul-marino).

A custom Magento router intercepts these paths, resolves the product via url_rewrite, and preselects the color. When the user clicks a swatch, the URL updates via replaceState to the new color path. Old #color= and ?color= formats remain supported as fallback.


Gallery Adapters

The module auto-detects the active gallery system and loads the appropriate adapter.

Priority Gallery Swatches Detected by
1 Rollpix ProductGallery Magento native Rollpix_ProductGallery enabled
2 Amasty Gallery Amasty Swatches Amasty_Conf enabled
3 Fotorama (native) Magento native Default fallback
4 Hyva Gallery Hyva Swatches Hyva_Theme enabled (via HyvaCompat sub-module)

Detection can be overridden via Configuration > Advanced > Gallery Adapter.


PLP (Product Listing Page)

When propagation is disabled, the module activates PLP plugins so that swatch clicks on category pages still show the correct color image.

Plugin Purpose Conditional on
SwatchImagePlugin Swap thumbnail on swatch click Always active
HoverSliderCompatPlugin Filter HoverSlider images by color Rollpix_HoverSlider installed
ImageFlipCompatPlugin Update flip-hover image by color Rollpix_ImageFlipHover installed

Compatibility plugins check ModuleManager::isEnabled() internally and return unmodified results when the target module is absent.


CLI Commands

Diagnose

Reports global config, catalog statistics, color mapping status, stock status, and potential issues per product. Scans all configurable products (no per-product opt-in required).

Propagate

Copies images from configurable parents to simple children filtered by color. Propagated images are flagged so they are not confused with manually uploaded images.

Clean

Removes ALL images from simple children of configurable products. Useful for resetting propagated images or debugging.

Migrate

Mode Description
diagnose Report current state without changes
consolidate Move images from simples to the configurable parent, dedup by color (one child per color)
auto-map Auto-assign colors to unmapped images by filename/label pattern matching

Options: --product-id, --all, --dry-run, --clean (remove existing configurable images before consolidating).


Architecture

Two-layer design

Frontend initialization flow

  1. gallery_data.phtml outputs window.rollpixGalleryConfig (color mapping, stock data, config) and window.rollpixGalleryImages (enriched gallery images with value_id and associatedAttributes).
  2. The swatch-renderer mixin creates a GallerySwitcher and FotoramaAdapter, then calls init() which resolves the default color and dispatches the first filter event.
  3. _ensureGalleryFiltered() uses two strategies to guarantee the filter is applied:
    • gallery:loaded event — re-applies the filter after Magento resets Fotorama.
    • Polling — detects Fotorama readiness in case gallery:loaded already fired before the mixin loaded (RequireJS timing).
  4. Once initialized, the mixin blocks all native gallery updates (updateBaseImage, _processUpdateGallery) so the module is the sole gallery controller.

Key conventions

Database

One column added to catalog_product_entity_media_gallery_value:

Column Type Format
associated_attributes TEXT, nullable attribute{ID}-{OPTION_ID} (e.g. attribute92-318)

Two legacy EAV attributes (created by earlier data patches, now hidden from admin via HideGalleryProductAttributes):

Attribute Status Notes
rollpix_gallery_enabled Hidden No longer used; module is always active for all configurables
rollpix_default_color Hidden No longer used; preselection is automatic based on stock and position

File Structure


Compatibility

Module Role
Magento_Swatches Base for Fotorama adapter
Magento_ConfigurableProduct Configurable product structure
Rollpix_ProductGallery Dedicated gallery adapter
Rollpix_HoverSlider PLP slider compatibility plugin
Rollpix_ImageFlipHover PLP flip-hover compatibility plugin
Amasty_Conf Amasty Color Swatches Pro adapter
Hyva_Theme Alpine.js adapter (HyvaCompat sub-module)

When the module is globally disabled, all behaviour falls back to stock Magento with zero overhead.


Changelog

v1.0.60

v1.0.59

v1.0.58

v1.0.38

v1.0.37

v1.0.36

v1.0.35

v1.0.34

v1.0.33

v1.0.32

v1.0.31

v1.0.30

v1.0.29

v1.0.28

v1.0.27

v1.0.26

v1.0.25

v1.0.24

v1.0.23

v1.0.16 – v1.0.22

v1.0.15

v1.0.14

v1.0.13

v1.0.12

v1.0.11

v1.0.10

v1.0.9

v1.0.8

v1.0.7

v1.0.6

v1.0.5


License

Proprietary — Rollpix


All versions of module-configurable-gallery with dependencies

PHP Build Version
Package Version
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rollpix/module-configurable-gallery contains the following files

Loading the files please wait ...