From 857ba27d9df9361fb0e8f4b77004e8c9a2b86110 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 6 Jun 2023 16:14:55 +0700 Subject: Change page animation and google merchant price include --- src/pages/google_merchant/products/[page].js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/pages/google_merchant') diff --git a/src/pages/google_merchant/products/[page].js b/src/pages/google_merchant/products/[page].js index aaa4dde4..6f41ce35 100644 --- a/src/pages/google_merchant/products/[page].js +++ b/src/pages/google_merchant/products/[page].js @@ -42,10 +42,12 @@ export async function getServerSideProps({ res, query }) { 'g:condition': { '#text': 'new' }, 'g:availability': { '#text': 'in_stock' }, 'g:brand': { '#text': product.manufacture?.name || '' }, - 'g:price': { '#text': `${product.lowestPrice.price} IDR` } + 'g:price': { '#text': `${Math.floor(product.lowestPrice.price * 1.11)} IDR` } } if (product.lowestPrice.discountPercentage > 0) { - item['g:sale_price'] = { '#text': `${product.lowestPrice.priceDiscount} IDR` } + item['g:sale_price'] = { + '#text': `${Math.floor(product.lowestPrice.priceDiscount * 1.11)} IDR` + } } productItems.push(item) }) -- cgit v1.2.3 From 2feb295e892d2f443e9f8cfa67b33285314da16f Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 20 Jun 2023 17:13:24 +0700 Subject: Update merchant xml price to exclude price --- src/pages/google_merchant/products/[page].js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/pages/google_merchant') diff --git a/src/pages/google_merchant/products/[page].js b/src/pages/google_merchant/products/[page].js index 6f41ce35..4a7d95c6 100644 --- a/src/pages/google_merchant/products/[page].js +++ b/src/pages/google_merchant/products/[page].js @@ -42,11 +42,11 @@ export async function getServerSideProps({ res, query }) { 'g:condition': { '#text': 'new' }, 'g:availability': { '#text': 'in_stock' }, 'g:brand': { '#text': product.manufacture?.name || '' }, - 'g:price': { '#text': `${Math.floor(product.lowestPrice.price * 1.11)} IDR` } + 'g:price': { '#text': `${Math.floor(product.lowestPrice.price)} IDR` } } if (product.lowestPrice.discountPercentage > 0) { item['g:sale_price'] = { - '#text': `${Math.floor(product.lowestPrice.priceDiscount * 1.11)} IDR` + '#text': `${Math.floor(product.lowestPrice.priceDiscount)} IDR` } } productItems.push(item) -- cgit v1.2.3 From 9bbb8d45420eca5a5987a43b55c2a4bec01f19fe Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Thu, 22 Jun 2023 13:39:23 +0700 Subject: xml google merchnt --- src/pages/google_merchant/products/[page].js | 3 ++- src/pages/google_merchant/products/index.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/pages/google_merchant') diff --git a/src/pages/google_merchant/products/[page].js b/src/pages/google_merchant/products/[page].js index 4a7d95c6..f9eac45d 100644 --- a/src/pages/google_merchant/products/[page].js +++ b/src/pages/google_merchant/products/[page].js @@ -1,6 +1,7 @@ import { createSlug } from '@/core/utils/slug' import toTitleCase from '@/core/utils/toTitleCase' import productSearchApi from '@/lib/product/api/productSearchApi' +import variantSearchApi from '@/lib/product/api/variantSearchApi' import _ from 'lodash-contrib' import { create } from 'xmlbuilder' @@ -18,7 +19,7 @@ export async function getServerSideProps({ res, query }) { orderBy: 'popular', fq: 'image_s:["" TO *]' } - const products = await productSearchApi({ query: _.toQuery(queries) }) + const products = await variantSearchApi({ query: _.toQuery(queries) }) const productItems = [] products.response.products.forEach((product) => { diff --git a/src/pages/google_merchant/products/index.js b/src/pages/google_merchant/products/index.js index a1f59d39..d3cdc514 100644 --- a/src/pages/google_merchant/products/index.js +++ b/src/pages/google_merchant/products/index.js @@ -1,4 +1,5 @@ import productSearchApi from '@/lib/product/api/productSearchApi' +import variantSearchApi from '@/lib/product/api/variantSearchApi' import _ from 'lodash-contrib' const limit = 5000 @@ -9,7 +10,7 @@ export async function getServerSideProps() { priceFrom: 1, fq: 'image_s:["" TO *]' } - const products = await productSearchApi({ query: _.toQuery(queries) }) + const products = await variantSearchApi({ query: _.toQuery(queries) }) const { numFound } = products.response const pageTotal = Math.ceil(numFound / limit) -- cgit v1.2.3 From 70c599121d97394bf0aa686ef541ec3d7fe54cf1 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Mon, 3 Jul 2023 10:08:13 +0700 Subject: fixing url --- src/pages/google_merchant/products/[page].js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pages/google_merchant') diff --git a/src/pages/google_merchant/products/[page].js b/src/pages/google_merchant/products/[page].js index f9eac45d..1e70d24f 100644 --- a/src/pages/google_merchant/products/[page].js +++ b/src/pages/google_merchant/products/[page].js @@ -23,7 +23,7 @@ export async function getServerSideProps({ res, query }) { const productItems = [] products.response.products.forEach((product) => { - const productUrl = createSlug('/shop/product/', product.name, product.id, true) + const productUrl = createSlug('/shop/product/variant/', product.name, product.id, true) const productId = product.code != '' ? product.code : product.id const regexHtmlTags = /(<([^>]+)>)/gi product.description = product.description?.replace(regexHtmlTags, ' ').trim() -- cgit v1.2.3 From a995acd0881ef6825c0862e71dea33110bbdf1dd Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 4 Jul 2023 10:02:39 +0700 Subject: Update harga exclude di google merchant xml --- src/pages/google_merchant/products/[page].js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/pages/google_merchant') diff --git a/src/pages/google_merchant/products/[page].js b/src/pages/google_merchant/products/[page].js index 1e70d24f..65e1ebbe 100644 --- a/src/pages/google_merchant/products/[page].js +++ b/src/pages/google_merchant/products/[page].js @@ -43,11 +43,11 @@ export async function getServerSideProps({ res, query }) { 'g:condition': { '#text': 'new' }, 'g:availability': { '#text': 'in_stock' }, 'g:brand': { '#text': product.manufacture?.name || '' }, - 'g:price': { '#text': `${Math.floor(product.lowestPrice.price)} IDR` } + 'g:price': { '#text': `${Math.floor(product.lowestPrice.price * 1.11)} IDR` } } if (product.lowestPrice.discountPercentage > 0) { item['g:sale_price'] = { - '#text': `${Math.floor(product.lowestPrice.priceDiscount)} IDR` + '#text': `${Math.floor(product.lowestPrice.priceDiscount * 1.11)} IDR` } } productItems.push(item) -- cgit v1.2.3 From 40b5e915d5675ed8d0e6f18860fb8f5e6a7ce59b Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 4 Jul 2023 14:48:03 +0700 Subject: Update availability on google merchant xml --- src/pages/google_merchant/products/[page].js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/pages/google_merchant') diff --git a/src/pages/google_merchant/products/[page].js b/src/pages/google_merchant/products/[page].js index 65e1ebbe..5a417807 100644 --- a/src/pages/google_merchant/products/[page].js +++ b/src/pages/google_merchant/products/[page].js @@ -34,6 +34,8 @@ export async function getServerSideProps({ res, query }) { product.description = defaultProductDescription } + const availability = product?.stockTotal > 0 ? 'in_stock' : 'preorder' + const item = { 'g:id': { '#text': productId }, 'g:title': { '#text': toTitleCase(product.name) }, @@ -41,7 +43,7 @@ export async function getServerSideProps({ res, query }) { 'g:link': { '#text': productUrl }, 'g:image_link': { '#text': product.image }, 'g:condition': { '#text': 'new' }, - 'g:availability': { '#text': 'in_stock' }, + 'g:availability': { '#text': availability }, 'g:brand': { '#text': product.manufacture?.name || '' }, 'g:price': { '#text': `${Math.floor(product.lowestPrice.price * 1.11)} IDR` } } -- cgit v1.2.3 From 5bbd819d1af2ec38826e925fe7a067534c6125af Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 4 Jul 2023 16:10:54 +0700 Subject: Update availability on google merchant xml to backorder --- src/pages/google_merchant/products/[page].js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pages/google_merchant') diff --git a/src/pages/google_merchant/products/[page].js b/src/pages/google_merchant/products/[page].js index 5a417807..05286e83 100644 --- a/src/pages/google_merchant/products/[page].js +++ b/src/pages/google_merchant/products/[page].js @@ -34,7 +34,7 @@ export async function getServerSideProps({ res, query }) { product.description = defaultProductDescription } - const availability = product?.stockTotal > 0 ? 'in_stock' : 'preorder' + const availability = product?.stockTotal > 0 ? 'in_stock' : 'backorder' const item = { 'g:id': { '#text': productId }, -- cgit v1.2.3 From 3f68c2837f7f1ba6d934d5070ba09100d6e3574b Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Thu, 6 Jul 2023 08:12:50 +0700 Subject: Update google merchant availability to in_stock --- src/pages/google_merchant/products/[page].js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pages/google_merchant') diff --git a/src/pages/google_merchant/products/[page].js b/src/pages/google_merchant/products/[page].js index 05286e83..52b87389 100644 --- a/src/pages/google_merchant/products/[page].js +++ b/src/pages/google_merchant/products/[page].js @@ -34,7 +34,7 @@ export async function getServerSideProps({ res, query }) { product.description = defaultProductDescription } - const availability = product?.stockTotal > 0 ? 'in_stock' : 'backorder' + const availability = 'in_stock' const item = { 'g:id': { '#text': productId }, -- cgit v1.2.3