diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-10-06 08:55:49 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-10-06 08:55:49 +0700 |
| commit | d8ac722b56e3968c166fa17f8db3a323c7322ace (patch) | |
| tree | d690362c9ede9576830a79b4d33a6167ba243f9b /src | |
| parent | ee47abc95060bcb27307f5d594e7275eae84d8f0 (diff) | |
Add label on google merchant xml
Diffstat (limited to 'src')
| -rw-r--r-- | src/pages/google_merchant/products/[page].js | 5 |
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'] = { |
