Skip to content

Commit cf7f2cd

Browse files
committed
Regenerated Algolia search key
1 parent 04c7d9e commit cf7f2cd

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@
5454
- JSDoc comments
5555
- WooCommerce cart session is automatically deleted after 48 hours to prevent GraphQL session expiration errors
5656

57+
## Known limitations
58+
59+
Overall the application is working as intended, but it has not been tested extensively in a production environment. More testing and debugging is required before deploying it in a production nevironment.
60+
61+
With that said, keep the following in mind:
62+
63+
- Currently only simple products and variable products work without any issues. External/affilate products are not working.
64+
5765
## TODO
5866

5967
- Display product variation name in cart / checkout

components/Search/AlgoliaSearchBox.component.jsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@ const AlgoliaSearchBox = () => {
2525
<div className="">
2626
<InstantSearch
2727
indexName={WOO_CONFIG.ALGOLIA_INDEX_NAME}
28-
searchClient={searchClient}
28+
searchClient={searchClient}
2929
>
3030
{/*We need to conditionally add a border because the element has position:fixed*/}
31-
3231
<SearchBox
33-
aria-label="Søk her"
32+
aria-label="Søk her"
3433
translations={{
3534
submitTitle: 'Søk',
3635
resetTitle: 'Slett søketekst',

utils/config/nextConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
export const WOO_CONFIG = {
66
GRAPHQL_URL: 'https://woo.dfweb.no/graphql',
77
ALGOLIA_APP_ID: '7L9M5Y0B1K',
8-
ALGOLIA_PUBLIC_API_KEY: '925cc92373120f1bf477bb8ce0e71649',
8+
ALGOLIA_PUBLIC_API_KEY: '1536a3704dfa8b3e42f82e5f95601d47',
99
ALGOLIA_INDEX_NAME: 'dfweb',
1010
PLACEHOLDER_IMAGE_URL: 'https://via.placeholder.com/272',
1111
};

utils/context/AppContext.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ export const AppContext = React.createContext([{}, () => {}]);
66
* Provides a global application context for the entire application with the cart contents
77
* @param {Object} props
88
*/
9-
export const AppProvider = (props) => {
9+
export const AppProvider = ({ children }) => {
1010
const [cart, setCart] = useState(null);
1111

1212
useEffect(() => {
13-
// Check if we are inside of the browser before we access the localStorage
13+
// Check if we are client-side before we access the localStorage
1414
if (process.browser) {
1515
let cartData = localStorage.getItem('woocommerce-cart');
1616
cartData = null !== cartData ? JSON.parse(cartData) : '';
@@ -19,7 +19,7 @@ export const AppProvider = (props) => {
1919
}, []);
2020
return (
2121
<AppContext.Provider value={[cart, setCart]}>
22-
{props.children}
22+
{children}
2323
</AppContext.Provider>
2424
);
2525
};

utils/functions/functions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ const isProductInCart = (existingProductsInCart, productId) => {
143143
};
144144

145145
/**
146-
* Remove Item from the cart.
146+
* Remove item from the cart.
147147
*
148148
* @param {Integer} productId Product Id.
149149
* @return {any | string} Updated cart

0 commit comments

Comments
 (0)