Shopify themes, liquid, logos, and UX
hi,
I have a manual payment option on the website (cash on delivery)
i would like to send a personalized email for order confirmation when a user chooses Cash on delivery
which is the variable I should put in the logic sequence?
so I think in the HTML of the email it should be something like
if variable_gateway == cashondelivery => do something
Solved! Go to the solution
This is an accepted solution.
If you have activated the Cash on Delivery (COD) payment method on your payments settings in Shopify you should leave "Cash on Delivery (COD)", otherwise if you have created a custom payment method for COD you should change it to the text the you see on your Shopify Payments settings
Regarding the message, here's the updated code with the message you indicated:
{%- assign order_is_cash_on_delivery = false -%}
{%- for transaction in transactions -%}
{%- if transaction.status == "success" or transaction.status == "pending" -%}
{%- if transaction.gateway == "Cash on Delivery (COD)" -%}
{%- assign order_is_cash_on_delivery = true -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- if order_is_cash_on_delivery -%}
<p>la spedizione in contrassegno prevede un ammontare di €4 aggiuntivo</p>
{%- endif -%}
Hope this helps!
Marco
Here's the code snippet you can use to show a message on your notification emails for Cash on Delivery orders:
{%- assign order_is_cash_on_delivery = false -%}
{%- for transaction in transactions -%}
{%- if transaction.status == "success" or transaction.status == "pending" -%}
{%- if transaction.gateway == "Cash on Delivery (COD)" -%}
{%- assign order_is_cash_on_delivery = true -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- if order_is_cash_on_delivery -%}
INSERT YOUR CUSTOM CASH ON DELIVERY CODE HERE
{%- endif -%}
You can add your custom COD code in place of the INSERT YOUR CUSTOM CASH ON DELIVERY CODE HERE
Hope this helps!
Marco
Hi Marco,
thank you so much for the response on the topic !
I shoud write in italian "la spedizione in contrassegno prevede un ammontare di €4 aggiuntivo"
and another thing:
in the website the manual payment cod is put as "Contrassegno" (italian meaning of Cash on delivery)
should I change also this {%- if transaction.gateway == "Cash on Delivery (COD)" -%} ?
This is an accepted solution.
If you have activated the Cash on Delivery (COD) payment method on your payments settings in Shopify you should leave "Cash on Delivery (COD)", otherwise if you have created a custom payment method for COD you should change it to the text the you see on your Shopify Payments settings
Regarding the message, here's the updated code with the message you indicated:
{%- assign order_is_cash_on_delivery = false -%}
{%- for transaction in transactions -%}
{%- if transaction.status == "success" or transaction.status == "pending" -%}
{%- if transaction.gateway == "Cash on Delivery (COD)" -%}
{%- assign order_is_cash_on_delivery = true -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- if order_is_cash_on_delivery -%}
<p>la spedizione in contrassegno prevede un ammontare di €4 aggiuntivo</p>
{%- endif -%}
Hope this helps!
Marco
thank you so much!
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024