File tree Expand file tree Collapse file tree 3 files changed +14
-14
lines changed Expand file tree Collapse file tree 3 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ export default {
6666 },
6767 error (error ) {
6868 this .remoteError = error
69+ window .location .reload (true )
6970 },
7071 },
7172 },
Original file line number Diff line number Diff line change 11{
22 "name" : " nuxtjs-woocommerce" ,
3- "version" : " 1.0.13 " ,
3+ "version" : " 1.0.14 " ,
44 "private" : true ,
55 "scripts" : {
66 "dev" : " nuxt" ,
Original file line number Diff line number Diff line change 88 <NuxtLink
99 class =" text-black cursor-pointer hover:underline"
1010 :to =" {
11- path: '/product/' + item.product_name,
11+ path: '/product/' + convertProductNameToSlug( item.product_name) ,
1212 query: { id: item.objectID },
1313 }"
1414 >
3333</template >
3434
3535<script >
36- // TODO
37- /*
38- Replace empty spaces with dash (-)
39-
40- const trimmedProductName = product_name.replace(/ /g, '-');
41- */
4236import {
4337 AisInstantSearchSsr ,
4438 AisRefinementList ,
@@ -72,12 +66,6 @@ export default {
7266 }),
7367 ],
7468 layout: ' Layout' ,
75- serverPrefetch () {
76- return this .instantsearch .findResultsState (this ).then ((algoliaState ) => {
77- this .$ssrContext .nuxt .algoliaState = algoliaState
78- })
79- },
80-
8169 head () {
8270 return {
8371 link: [
@@ -95,5 +83,16 @@ export default {
9583
9684 this .instantsearch .hydrate (results)
9785 },
86+ methods: {
87+ convertProductNameToSlug (productName ) {
88+ const productNameSlug = productName .replace (/ / g , ' -' ).toLowerCase ()
89+ return productNameSlug
90+ },
91+ },
92+ serverPrefetch () {
93+ return this .instantsearch .findResultsState (this ).then ((algoliaState ) => {
94+ this .$ssrContext .nuxt .algoliaState = algoliaState
95+ })
96+ },
9897}
9998 </script >
You can’t perform that action at this time.
0 commit comments