Right now we have two features, commerce_kickstart_search and commerce_kickstart_lite_search.
Each one has an index for the matching install "flavor" (demo store or no demo store).
Each one also has the exact same set of custom plugins.
The product_ui features duplicate the actual view, the current_search settings, theme tweaks.

Not counting the plugins, removing the duplication would allow us to remove about 400 lines of code, while also killing many
bugs (sometimes fixes were only applied to one version of the code).

Plan:
1) Move the server creation to commerce_kickstart_install(). Instead of a huge export, we solve it in 10 lines of code.
2) Since the indexes depend on the actual fields attached to the product types (at least until we write some code that creates indexes automatically instead of using an export), place them on the product features.
3) All other code (plugins, view, current_search, theme tweaks) goes into commerce_kickstart_search which is enabled for both install flavours.

Comments

bojanz’s picture

Assigned: Unassigned » jsacksick
Status: Active » Needs work

Merged the first version of the code, it's a beast.

TODO:
1) FIx sorts (sorting on title fails on "demo store", sorting on anything fails on "no demo store". Feature appears overridden on the sorts).
2) I guess we should add a Price facet to the "no demo store". If it's the same for both variants, then it can live in commerce_kickstart_search.
3) The price facet on "demo store" appears as "Amount (float)" instead of "Price", that's a regression.

krisrobinson’s picture

Can I ask a question, I've installed commerce_kickstart_search on an existing commerce install (not kickstart) because I wanted to recreate the search you have, but I don't have the option for Price > Amount (float) , only Price > Amount. How do I get the (float) version of the field so that it can be faceted, sorted and indexed?

krisrobinson’s picture

Oh, I got it, the commerce module in commerce_kickstart has been modified, I swapped it out and now I have the (float) version of the price as well to use in the search_api_sorts.

bojanz’s picture

Status: Needs work » Fixed

We're working on making that patch non-required, so that it works with stock Commerce.

My comments in #1 have been addressed.

krisrobinson’s picture

Cool beans.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.