diff options
Diffstat (limited to 'src/pages/google_merchant')
| -rw-r--r-- | src/pages/google_merchant/products/[page].js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/pages/google_merchant/products/[page].js b/src/pages/google_merchant/products/[page].js index eeda4347..d6309090 100644 --- a/src/pages/google_merchant/products/[page].js +++ b/src/pages/google_merchant/products/[page].js @@ -47,6 +47,13 @@ export async function getServerSideProps({ res, query }) { 'g:brand': { '#text': product.manufacture?.name || '' }, 'g:price': { '#text': `${Math.round(product.lowestPrice.price * 1.11)} IDR` } } + + if (product.stockTotal == 0) { + item['g:custom_label_0'] = { '#text': 'Stok Tidak Tersedia' } + } else { + item['g:custom_label_1'] = { '#text': 'Stok Tersedia' } + } + if (product.lowestPrice.discountPercentage > 0) { item['g:sale_price'] = { '#text': `${Math.round(product.lowestPrice.priceDiscount * 1.11)} IDR` |
