summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-07-31 15:12:47 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-07-31 15:12:47 +0700
commit36b776cda52f7186d9630831acbaaceae4ac4c56 (patch)
tree26ad064deda2e8a630c908a53329d09e3434df23
parent01b2fc531d349418ea4b53170688b909c7ea6e8c (diff)
email reminder checkout cart
-rw-r--r--indoteknik_custom/models/website_user_cart.py8
-rwxr-xr-xindoteknik_custom/views/website_user_cart.xml32
2 files changed, 20 insertions, 20 deletions
diff --git a/indoteknik_custom/models/website_user_cart.py b/indoteknik_custom/models/website_user_cart.py
index e4b10178..dd3f87e6 100644
--- a/indoteknik_custom/models/website_user_cart.py
+++ b/indoteknik_custom/models/website_user_cart.py
@@ -131,13 +131,13 @@ class WebsiteUserCart(models.Model):
return result
def action_mail_reminder_to_checkout(self):
- # user_ids = self.search([]).mapped('user_id')
+ user_ids = self.search([]).mapped('user_id')
- user_ids = [101]
+ # user_ids = [1102]
for user in user_ids:
- latest_cart = self.search([('user_id', '=', user), ('is_reminder', '=', False)], order='create_date desc', limit=1)
+ latest_cart = self.search([('user_id', '=', user.id), ('is_reminder', '=', False)], order='create_date desc', limit=1)
- carts_to_remind = self.search([('user_id', '=', user)])
+ carts_to_remind = self.search([('user_id', '=', user.id)])
if latest_cart and not latest_cart.is_reminder:
for cart in carts_to_remind:
check = cart.check_product_flashsale(cart.product_id.id)
diff --git a/indoteknik_custom/views/website_user_cart.xml b/indoteknik_custom/views/website_user_cart.xml
index 7303a221..92dacd98 100755
--- a/indoteknik_custom/views/website_user_cart.xml
+++ b/indoteknik_custom/views/website_user_cart.xml
@@ -150,7 +150,7 @@
<div class="col-3">
<img src="${base_url}api/image/promotion.program/image/${promo[0].program_line_id.program_id.id}" alt="${promo[0].program_line_id.program_id.name}" width="120" height="120" style="object-fit: fill; object-position: center;"/>
</div>
- <div class="col-6" style="margin-top: 1rem; margin-left: 1.5rem;">
+ <div class="col-6" style="margin-top: 0.7rem; padding-left: 1.5rem;">
<div style="font-weight: 600; margin-bottom: 8px;">${promo[0].program_line_id.name}</div>
<div style="display: flex; gap: 20px; align-items: center; margin-bottom: 8px;">
<div style="color: grey; text-decoration: line-through; margin-right: 20px;">
@@ -164,8 +164,8 @@
Berat barang: ${weight} Kg
</div>
</div>
- <div class="col-3">
- <button type="button" class="btn btn-outline-secondary" style="margin-left: 11rem; margin-top: 2.5rem;">${cart.format_integer(cart.qty)}</button>
+ <div class="col-3" style="padding-left: 13rem;">
+ <button type="button" class="btn btn-outline-secondary" style="margin-top: 2.5rem;">${cart.format_integer(cart.qty)}</button>
</div>
</div>
</div>
@@ -176,14 +176,14 @@
<div class="col-3">
<img src="${base_url}api/image/product.template/image_512/${data.product_id.product_tmpl_id.id}" alt="${data.product_id.name}" width="120" height="120" style="object-fit: fill; object-position: center;"/>
</div>
- <div class="col-6" style="margin-top: 1rem; margin-left: 1.5rem;">
+ <div class="col-6" style="margin-top: 0.7rem; padding-left: 1.5rem;">
<div style="font-weight: 400; margin-bottom: 8px;">${data.product_id.name}</div>
<div style="color: grey;">
${data.product_id.default_code} | Berat barang: ${data.product_id.weight} Kg
</div>
</div>
- <div class="col-3">
- <button type="button" class="btn btn-outline-secondary" style="margin-left: 9rem; margin-top: 2.5rem;">${data.qty}</button>
+ <div class="col-3" style="padding-left: 13rem;">
+ <button type="button" class="btn btn-outline-secondary" style="margin-top: 2.5rem;">${data.qty}</button>
</div>
</div>
</div>
@@ -194,14 +194,14 @@
<div class="col-3">
<img src="${base_url}api/image/product.template/image_512/${free.product_id.product_tmpl_id.id}" alt="${free.product_id.name}" width="120" height="120" style="object-fit: fill; object-position: center;"/>
</div>
- <div class="col-6" style="margin-top: 1rem; margin-left: 1.5rem;">
+ <div class="col-6" style="margin-top: 0.7rem; padding-left: 1.5rem;">
<div style="font-weight: 400; margin-bottom: 8px;">${free.product_id.name}</div>
<div style="color: grey;">
${free.product_id.default_code} | Berat barang: ${free.product_id.weight} Kg
</div>
</div>
- <div class="col-3">
- <button type="button" class="btn btn-outline-secondary" style="margin-left: 9rem; margin-top: 2.5rem;">${free.qty}</button>
+ <div class="col-3" style="padding-left: 13rem;">
+ <button type="button" class="btn btn-outline-secondary" style="margin-top: 2.5rem;">${free.qty}</button>
</div>
</div>
</div>
@@ -223,7 +223,7 @@
alt="${cart.product_id.name}" width="120" height="120"
style="object-fit: fill; object-position: center;"/>
</div>
- <div class="col-6">
+ <div class="col-6" style="margin-top: 0.7rem; padding-left: 1.5rem;">
<div style="font-weight: 600; margin-bottom: 8px;">${cart.product_id.name}</div>
<div style="display: flex; gap: 20px; align-items: center; margin-bottom: 8px;">
<div style="color: grey; text-decoration: line-through; margin-right: 10px;">
@@ -237,8 +237,8 @@
${cart.product_id.default_code} | Berat barang: ${cart.product_id.weight} Kg
</div>
</div>
- <div class="col-3">
- <button type="button" class="btn btn-outline-secondary" style="margin-left: 11rem; margin-top: 2.5rem;">${cart.format_integer(cart.qty)}</button>
+ <div class="col-3" style="padding-left: 13rem;">
+ <button type="button" class="btn btn-outline-secondary" style="margin-top: 2.5rem;">${cart.format_integer(cart.qty)}</button>
</div>
</div>
</div>
@@ -252,7 +252,7 @@
alt="${cart.product_id.name}" width="120" height="120"
style="object-fit: fill; object-position: center;"/>
</div>
- <div class="col-6">
+ <div class="col-6" style="margin-top: 0.7rem; padding-left: 1.5rem;">
<div style="font-weight: 600; margin-bottom: 8px;">${cart.product_id.name}</div>
<div style="display: flex; gap: 20px; align-items: center; margin-bottom: 8px;">
<div style="color: red; font-weight: bold;">
@@ -263,8 +263,8 @@
${cart.product_id.default_code} | Berat barang: ${cart.product_id.weight} Kg
</div>
</div>
- <div class="col-3">
- <button type="button" class="btn btn-outline-secondary" style="margin-left: 11rem; margin-top: 2.5rem;">${cart.format_integer(cart.qty)}</button>
+ <div class="col-3" style="padding-left: 13rem;">
+ <button type="button" class="btn btn-outline-secondary" style="margin-top: 2.5rem;">${cart.format_integer(cart.qty)}</button>
</div>
</div>
</div>
@@ -302,7 +302,7 @@
<tr>
<td style="text-align: center; padding: 20px;">
<a href="https://indoteknik.com/shop/cart" style="background-color: #FFC107; color: black; padding: 10px 20px; text-decoration: none; border-radius: 4px; display: inline-block;">Cek Keranjang</a>
- <a href="https://indoteknik.com/shop/checkout?voucher=PASTIHEMAT" style="background-color: #FF0000; color: white; padding: 10px 20px; text-decoration: none; border-radius: 4px; margin-left: 10px; display: inline-block;">Bayar Sekarang</a>
+ <a href="https://indoteknik.com/shop/checkout?voucher=PASTIHEMAT?utm_source=email-reminder" style="background-color: #FF0000; color: white; padding: 10px 20px; text-decoration: none; border-radius: 4px; margin-left: 10px; display: inline-block;">Bayar Sekarang</a>
</td>
</tr>