summaryrefslogtreecommitdiff
path: root/src/pages/google_merchant
diff options
context:
space:
mode:
authorHATEC\SPVDEV001 <tri.susilo@altama.co.id>2023-10-09 11:35:14 +0700
committerHATEC\SPVDEV001 <tri.susilo@altama.co.id>2023-10-09 11:35:14 +0700
commit07601d9d59b70cd1f200a9a6ebf1d01801990960 (patch)
tree9290c2f754238eff3758ac0c474a87487773f35e /src/pages/google_merchant
parentec2bbfeaa09d6fb01bbe4ad97cc978b5a68500ff (diff)
parentdc6d6df514375c7002686e31e6270f828b5a0ccf (diff)
Merge branch 'master' into CR/Pricelist
# Conflicts: # src/pages/shop/product/variant/[slug].jsx
Diffstat (limited to 'src/pages/google_merchant')
-rw-r--r--src/pages/google_merchant/products/[page].js7
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`