Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to filter by discounts, on sale and new products #880

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

Hlavtox
Copy link
Contributor

@Hlavtox Hlavtox commented Jul 17, 2023

Questions Answers
Description? Adds a new feature that allows filtering for new products, discounted products or products with "On sale" flag.
Type? new feature
BC breaks? no
Deprecations? no
Fixed ticket?
How to test? Try this new filter, try to upgrade the module.

Description

  • Adds a new feature that adds possibility to filter by some new product special things.
    • You can filter out products that are new.
    • You can filter out products that are discounted.
    • You can filter out products that have "On sale" label on them.
  • I named a group of these new features "Highlights".

Screenshot

Snímek obrazovky 2023-07-17 094147


This change is Reviewable

@Hlavtox Hlavtox changed the title Add highlights feature Add possibility to filter by discounts, on sale and new products Jul 17, 2023
@Hlavtox Hlavtox force-pushed the extras branch 5 times, most recently from 6218850 to 263ed3a Compare July 17, 2023 12:01
@Hlavtox Hlavtox marked this pull request as ready for review July 17, 2023 12:32
@Hlavtox Hlavtox force-pushed the extras branch 2 times, most recently from d961aa5 to 263ed3a Compare July 18, 2023 09:15
Copy link
Contributor

@kpodemski kpodemski left a comment

Choose a reason for hiding this comment

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

Only one question.

I kinda like "Highlights", but a few alternatives I see:

  • Products types (although it's confusing with product types like pack, combination, etc.)
  • Products selections
  • Shopping choices
  • Specific products


if (!isset($doneCategories[(int) $idCategory]['q'])) {
$filterData['layered_selection_highlights'] = ['filter_type' => Converter::WIDGET_TYPE_CHECKBOX, 'filter_show_limit' => 0];
$doneCategories[(int) $idCategory]['e'] = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

e like "extra properties"? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, forgotten

Copy link

@MatShir MatShir left a comment

Choose a reason for hiding this comment

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

Small request: We should separate the new and the discounts part 🙏

@ps-jarvis ps-jarvis added the waiting for author Waiting for author's feedback label Jul 18, 2023
@kpodemski
Copy link
Contributor

@MatShir what do you mean? it is about showing products with different state, on discount, on sale, new products - how would you like to split this?

@l-delin
Copy link

l-delin commented Jul 19, 2023

Hello @Hlavtox :-)

As @MatShir said, it would be nice to have two separate parts for the two "types" of labels so it's not too confusing. By that, I mean that Discounted & On sale products should not be in the same section as New products, because they don't share common properties.
I liked your proposition with the use of "highlights" but in an ecommerce context, it doesn't work. We need to use words users are familiar with.
There's a second point: how can we translate it? It works fine in English, but for languages like French, you'd need to split it into two words and it would take too much space.

So, considering this, here's what we propose:

Instead of the Highlights category, two categories: Deals and Selection.

The Deals section is dedicated to Discounted and On sale products.
And, as a personal suggestion: Ultimately, "Flash sales" could be added to this category as well.

The Selection section contains a selection of specific products. In this case, the New products category.
Again, suggestion: categories such as season-themed or holiday-themed product collections could be added to this category. (e.g.: "Christmas collection", "Summer collection", etc.)

So it would look like this:

Deals:

  • Discounted
  • On Sale

Selection:

  • New products

What do you think? 🏎

@Hlavtox Hlavtox force-pushed the extras branch 4 times, most recently from 2e9c1fe to 457d2f0 Compare August 3, 2023 05:54
@Hlavtox Hlavtox removed the waiting for author Waiting for author's feedback label Sep 27, 2023
@Hlavtox
Copy link
Contributor Author

Hlavtox commented Sep 27, 2023

@MatShir @kpodemski It's ready for review.

  • I went for facet name "Selections" and putting three values there. After Slack discussion, it doesn't make sense to have a separate category with one filter.
  • This filter is now enabled on new module install. For existing users, it's not.
  • When installing this module, I moved the stock, price and selections filter to the top. As they are the most important.
  • The filters work like this, if enabled - ((On sale OR Discounted) AND New product)

How it looks
Snímek obrazovky 2023-09-27 142901

@MatShir
Copy link

MatShir commented Sep 27, 2023

Looks good to me !

@Hlavtox Hlavtox requested a review from a team October 3, 2023 08:24
@florine2623 florine2623 self-assigned this Oct 4, 2023
Copy link
Contributor

@florine2623 florine2623 left a comment

Choose a reason for hiding this comment

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

Hello @Hlavtox ,

Tested on 8.0.x, 8.1.x and develop branches.

Upgrade to 3.14.0 OK ✅

New filter Selections works fine ^^

There's just this option that I do not have :
When installing this module, I moved the stock, price and selections filter to the top. As they are the most important.

Screenshot 2023-10-04 at 15 24 53

Could you check ? ^^

@florine2623 florine2623 added waiting for author Waiting for author's feedback and removed Waiting for QA labels Oct 4, 2023
@florine2623 florine2623 removed their assignment Oct 4, 2023
@Hlavtox
Copy link
Contributor Author

Hlavtox commented Oct 4, 2023

Hi @florine2623, it works only on clean installs when there never was faceted search. For existing installs, there will be no change.

Copy link
Contributor

@florine2623 florine2623 left a comment

Choose a reason for hiding this comment

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

@Hlavtox ,

Indeed after Uninstalling the module and reinstalling with the PR, the 3 elements are on top the the filter list ^^

QA ✅
Thanks!

@florine2623 florine2623 self-assigned this Oct 4, 2023
@florine2623 florine2623 added QA ✔️ and removed Waiting for QA waiting for author Waiting for author's feedback labels Oct 4, 2023
@kpodemski kpodemski added this to the 3.14.0 milestone Oct 4, 2023
@kpodemski kpodemski merged commit d8c8f50 into PrestaShop:dev Oct 4, 2023
11 checks passed
@kpodemski
Copy link
Contributor

well done 👏🏻 thanks @Hlavtox

@MatShir
Copy link

MatShir commented Oct 5, 2023

Hi @florine2623, it works only on clean installs when there never was faceted search. For existing installs, there will be no change.

Even after a module upgrade ? what needs to be done for this part to be on top ? @Hlavtox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants