summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-10-06 08:54:54 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-10-06 08:54:54 +0700
commit5e32d98379f4269d32123b8156b3f955300fcc6c (patch)
treeb78ce6a22a1580c6b751f22c1413086b3dddfb3a /src
parentdfd6ad0174f6d01279106286946fa2d9d0a99ca5 (diff)
Add label on merchant xml
Diffstat (limited to 'src')
-rw-r--r--src/pages/google_merchant/products/[page].js5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pages/google_merchant/products/[page].js b/src/pages/google_merchant/products/[page].js
index eeda4347..352b2989 100644
--- a/src/pages/google_merchant/products/[page].js
+++ b/src/pages/google_merchant/products/[page].js
@@ -45,7 +45,10 @@ export async function getServerSideProps({ res, query }) {
'g:condition': { '#text': 'new' },
'g:availability': { '#text': availability },
'g:brand': { '#text': product.manufacture?.name || '' },
- 'g:price': { '#text': `${Math.round(product.lowestPrice.price * 1.11)} IDR` }
+ 'g:price': { '#text': `${Math.round(product.lowestPrice.price * 1.11)} IDR` },
+ 'g:custom_label_0': {
+ '#text': product.stockTotal > 0 ? 'Stok Tersedia' : 'Stok Tidak Tersedia'
+ }
}
if (product.lowestPrice.discountPercentage > 0) {
item['g:sale_price'] = {