Skip to content

Commit

Permalink
Update docs (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrsmutti authored Dec 11, 2019
1 parent 45d187d commit 48de64c
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 25 deletions.
112 changes: 87 additions & 25 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,54 +5,116 @@ a more complete search experience.

:loudspeaker: **Disclaimer:** Don't fork this project; use, contribute, or open issue with your feature request.

### store.search.v2
## Table of Contents

Add the `store.search.v2` block to your `blocks.json`, like:
- [Usage](#usage)
- [Custom Search Page URL](#custom-search-page-url)
- [Order Options](#order-options)
- [Catalog Integration](#catalog-integration)
- [Blocks API](#blocks-api)
- [Configuration](#configuration)
- [Troubleshooting](#troubleshooting)
- [Contributing](#contributing)

## Usage

This app uses our store builder with the blocks architecture. To know more about Store Builder [click here.](https://help.vtex.com/en/tutorial/understanding-storebuilder-and-stylesbuilder#structuring-and-configuring-our-store-with-object-object)

To use this app you need to import it in your dependencies on the `manifest.json`.

```json
{
"dependencies": {
"vtex.search": "0.x"
}
}
```

Then, add the `store.search.v2` block into your app theme.

```json
"store.search.v2": {
"blocks": ["search-result"]
{
"store.search.v2": {
"blocks": ["search-result-layout"]
}
}
```

### Custom Search Page URL

This will provide your store with a new route `/search` that will handle all search navigation
from now on, but first you need to redirect the `search-bar` requests to this new route, using
the `customPageUrl` prop on the `search-bar` component.
from now on, but first, you need to redirect the `search-bar` requests to this new route, using
the `customSearchPageUrl` prop on the `search-bar` component.

```json
"search-bar": {
"props": {
"customSearchPageUrl": "/search?_query=${term}"
{
"search-bar": {
"props": {
"customSearchPageUrl": "/search?_query=${term}"
}
}
}
```

### Order Options

We don't yet support some of the ordering options that are supported by the current search implementation,
so they should be hidden so that it doesn't confuse your costumers. You can hide ordering options by
so they should be hidden so that it doesn't confuse your customers. You can hide ordering options by
passing them to the `hiddenOptions` prop on the `order-by` component.

```json
"order-by": {
"props": {
"hiddenOptions": [
"OrderByReleaseDateDESC",
"OrderByNameASC",
"OrderByNameDESC"
]
{
"order-by": {
"props": {
"hiddenOptions": [
"OrderByReleaseDateDESC",
"OrderByNameASC",
"OrderByNameDESC"
]
}
}
}
```

### Catalog Integration

For this new search experience to work properly a Token and App Key need to be generated and sent
to `[email protected]`. We will continue our case-by-case conversation via this e-mail once this
step is done. You can follow an in-depth tutorial on how to create both the Token and the App Key
[here](https://help.vtex.com/tutorial/criar-appkey-e-apptoken-para-autenticar-integracoes).

You'll also need to set up the affiliate API endpoint, you can follow [this tutorial](https://help.vtex.com/tutorial/configuring-affiliates--tutorials_187)
on how to properly set up this step.

The Search endpoint used for the affiliate API should be:

```
http://api.biggylabs.com.br/track-api/v2/affiliate
```

If you end up having any questions about this step, feel free to send an e-mail to `[email protected]`
with the subject `[YOUR STORE] Search App - Catalog Integration`.

## Blocks API

When implementing this app as a block, various inner blocks may be available.

```json
{
"store.search.v2": {
"allowed": ["search-result", "search-result-layout"]
}
}
```

### XML Integration indexing
### Configuration

At the moment, the only way to index the products of the store into this new search experience is
by creating a XML document that contains the entire catalog.
:hammer: Work in Progress...

This can be accomplished by using the `Catalog > XML Integration` page in the admin.
## Troubleshooting

Create a new XML following closely to the image below:
You can check if others are passing through similar issues [here](https://github.com/vtex-apps/search/issues). Also, feel free to [open issues](https://github.com/vtex-apps/search/issues/new) or contribute with pull requests.

![XML Integration](./images/XML.jpg)
## Contributing

We're working on closely integrating into the VTEX Catalog, so that this step may be bypassed in
the future!
Check it out [how to contribute](https://github.com/vtex-apps/awesome-io#contributing) with this project.
Binary file removed docs/images/XML.jpg
Binary file not shown.

0 comments on commit 48de64c

Please sign in to comment.