Skip to content

feat: add slider on gallery images#4446

Merged
HardeepAsrani merged 7 commits intodevelopmentfrom
feat/pro/2508
Nov 21, 2025
Merged

feat: add slider on gallery images#4446
HardeepAsrani merged 7 commits intodevelopmentfrom
feat/pro/2508

Conversation

@girishpanchal30
Copy link
Contributor

Summary

Add the vertical slider on a desktop and the horizontal slider on a mobile device to the gallery image of a single product.

Will affect the visual aspect of the product

YES

Screenshots

Desktop View:
image

Mobile View:
image

Check before Pull Request is ready:

Closes https://github.com/Codeinwp/neve-pro-addon/issues/2508

@girishpanchal30 girishpanchal30 added the pr-checklist-skip Allow this Pull Request to skip checklist. label Oct 30, 2025
@pirate-bot pirate-bot added the pr-checklist-complete The Pull Request checklist is complete. (automatic label) label Oct 30, 2025
@pirate-bot
Copy link
Collaborator

pirate-bot commented Oct 30, 2025

Plugin build for 5fbedfe is ready 🛎️!

@poonam279
Copy link

@girishpanchal30, Could we remove the text like “Slide 1 of 6” that appears in the mobile view?

Markup 2025-10-31 at 15 28 17

@poonam279
Copy link

@vytisbulkevicius, are we going to provide this feature in Neve free theme? I noticed that the gallery layout and gallery slider options are already available through the Sparks plugin.

Markup 2025-10-31 at 15 45 58

@girishpanchal30, When the Sparks plugin is active, there are a few conflicts:

  1. The arrows are not centered properly.
Markup on 2025-10-31 at 15:57:38
  1. Enabling the Gallery Thumbnails Slider option in Sparks overrides the default feature we implemented in this PR.

  2. If we do not enable the Gallery Thumbnails Slider option in Sparks and select the Left Grid Layout, then the gallery layout breaks on mobile.

Screenshot on 2025-10-31 at 16-07-03

@vytisbulkevicius
Copy link
Contributor

@poonam279 yes, this should be available in Free. It's fine to still have the option in Sparks to control it, I forgot about this as well actually but I don't see a problem having it in Sparks with control.

package.json Outdated
"gzip": false,
"running": false,
"limit": "33 KB",
"limit": "34.1 KB",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we have a little bit of problem. We need to find some creative solution in the written JS to make sure we get smallest size.

You can check with AI some variations of the code that can produce a smaller code when minified.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Soare-Robert-Daniel I have updated the code to reduce the file size with the latest commit. Please check it and let me know if any changes are needed.

@girishpanchal30
Copy link
Contributor Author

@poonam279 I have fixed the conflicts when the Sparks for WooCommerce plugin is active.


if ( class_exists( 'WooCommerce', false ) && is_woocommerce() ) {
wp_register_script( 'neve-shop-script', NEVE_ASSETS_URL . 'js/build/modern/shop.js', array(), NEVE_VERSION, true );
wp_register_script( 'neve-shop-script', NEVE_ASSETS_URL . 'js/build/modern/shop.js', array( 'jquery' ), NEVE_VERSION, true );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is an interesting discussion.

Using jQuery allowed us to reduce the size of the script, but we introduced a new dependancie that needs to be loaded in the page, so the total size will be this script + jQuery script size.

But jQuery is also loaded by WooCommerce, thus we can ignore its script size since it will be always present.

@HardeepAsrani, what do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I missed this, but yea, I agreed if Woo loads JS so it's not an issue for us to use as well.

@poonam279
Copy link

@girishpanchal30, there is still an issue when we do not enable the Gallery Thumbnails Slider option in Sparks and select the Left Grid Layout, then the gallery layout breaks on mobile.
Markup on 2025-11-17 at 15:13:02
Screenshot 2025-11-17 at 3 10 50 PM

@girishpanchal30
Copy link
Contributor Author

@poonam279 I have fixed it with the latest commit. Please check and let me know if any changes are needed.

@poonam279
Copy link

@girishpanchal30, I have noticed several issues with this commit.

  1. When we do not enable the Gallery Thumbnails Slider option in Sparks and select the Left Layout:
    The mobile layout appears like this
Screenshot on 2025-11-18 at 11-34-09 The desktop view doesn't have the arrows at the correct place. Also, it shouldn't show the slider as the slider option is not enabled in the Spark Markup on 2025-11-18 at 11:36:42
  1. When we enable the Gallery Thumbnails Slider option in Sparks and select the Normal Grid Layout:
    The desktop layout appears like this
Markup 2025-11-18 at 11 44 07
  1. Also, the slider doesn’t appear on the first load (without Sparks). It only shows up after reloading the page. Here’s a screencast for reference: https://vertis.d.pr/i/3xLDHa

This is the test instance where you can check the issues:
Admin area URL: https://chewturn.s2-tastewp.com/wp-admin
Username: poonam
Password: jgVhT4V7Khc

@girishpanchal30
Copy link
Contributor Author

@poonam279, I have fixed all the mentioned issues with the latest commit.

@poonam279
Copy link

@girishpanchal30, The latest commit fixed previous issues but there are some new issues.

The slider still works even when the Gallery Thumbnails Slider option is disabled in Sparks and Normal Grid Layout is selected. Also, the horizontal layout appears on desktop:

Markup on 2025-11-18 at 22:34:58

When we enable the Gallery Thumbnails Slider option in Sparks and select the Normal Grid Layout, the gallery doesn't appear on desktop and mobile.

Markup on 2025-11-18 at 22:36:55

@girishpanchal30
Copy link
Contributor Author

@poonam279 I have fixed it with the latest commit.

@poonam279
Copy link

Thank you @girishpanchal30, this commit fixed many issues but one is still there.

If you have the Sparks plugin active and the default Normal layout selected, the Horizontal layout still appears on desktop. On mobile, it works as expected.

Markup on 2025-11-20 at 00:27:18

@girishpanchal30
Copy link
Contributor Author

@poonam279 I have fixed it with the latest commit. Please check and let me know if any changes are needed.

@HardeepAsrani HardeepAsrani merged commit 8cd27f3 into development Nov 21, 2025
17 of 18 checks passed
@HardeepAsrani HardeepAsrani deleted the feat/pro/2508 branch November 21, 2025 17:08
@pirate-bot
Copy link
Collaborator

🎉 This PR is included in version 4.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Nov 26, 2025
girishpanchal30 added a commit that referenced this pull request Dec 16, 2025
vytisbulkevicius added a commit that referenced this pull request Dec 17, 2025
Revert "feat: add slider on gallery images (#4446)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-checklist-complete The Pull Request checklist is complete. (automatic label) pr-checklist-skip Allow this Pull Request to skip checklist. released Indicate that an issue has been resolved and released in a particular version of the product.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants