From d8ac722b56e3968c166fa17f8db3a323c7322ace Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Fri, 6 Oct 2023 08:55:49 +0700 Subject: Add label on google merchant xml --- src/pages/google_merchant/products/[page].js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/pages') 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'] = { -- cgit v1.2.3