npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@graphcommerce/algolia-products

v9.0.2

Published

An implementation of Algolia Products through the GraphQL Mesh.

Downloads

1,669

Readme

Algolia Magento 2

An implementation of Algolia Products through the GraphQL Mesh.

Prerequisites

Make sure the Magento 2 module is correctly installed and working.

Installation

  1. Find current version of your @graphcommerce/next-ui in your package.json.

  2. yarn add @graphcommerce/[email protected] (replace 9.0.0 with the version of the step above)

  3. Configure the following (configuration values) in your graphcommerce.config.js:

    const config = {
      algolia: {
        applicationId: 'your-algolia-application-id', // Stores > Configuration > Algolia Search > Credentials and Basic Setup > Application ID
        indexNamePrefix: 'default_', // Stores > Configuration > Algolia Search > Credentials and Basic Setup > Index name prefix
        searchOnlyApiKey: 'blabla', // Stores > Configuration > Algolia Search > Credentials and Basic Setup > Search-only (public) API key
        catalogEnabled: false, // start with search and if everything works as expected, you can move on to the catalog.
      },
    }

Configuration

  1. Setup the fields that you want to index in algolia Stores > configuration > Algolia Search > Products > Products
  2. Configure your aggregations/filters, make sure that the aggregation fields are also indexed in step 2 Stores > Configuration > Algolia Search > Instant Search Results Page > Facets
  3. Make sure the aggregations fields are made filterable(Use in layerd Navigation), so the attributeList query can retrieve the labels. Stores > Products > Attributes
  4. To configure sorting options, enable Virtual Replica's. Stores > Configuration > Algolia Search > Instant Search Results Page > Use Virtual Replica

Customer Group Pricing

const config = {
  algoliaCustomerGroupPricingEnabled: true,
}

To enable customer group pricing, make sure customers groups prices are mapped to algolia. Stores > Configuration > Algolia Search > Advanced > Enable Customer Groups.

⚠️ Warning: Catalog price rules for a specific customer group do not seem to be indexed.It seems only: [Product] > Advanced Pricing > Customer Group Price gets indexed.

Note: The GraphQL API does not expose the customer group_id by default. We're doing an additional REST API call to get the value. This means a somewhat slower (few hundred ms) when the Customer is loaded.

Customization

By default algoliaFacetsToAggregations and algoliaHitToMagentoProduct can be plugged in.

Algolia for Catalog

Sorting is defined by Algolia and can not be configured per category as each sorting option is a separate (virtual) index.

Suggestions

To get query suggestions/autocomplete enter your Algolia dashboard > Search > configure > Query Suggestions > new Query Suggestions Index. This will create a new index which will be used for suggestions

Don't mind to use the suggestions setting in magento admin. It will create a suggestions index but it will not record suggestions. This requires instantSearch