Show/Hide Downpay Conditionally
Learn how to show or hide Downpay deposits on the product page for specific regions or customers
Overview
Setup instructions
Examples
You can conditionally prevent Downpay from initializing on the product page based on custom conditions. To do this, set the following variable in javascript inside your theme:
window.downpay.disabledOnFirstLoad
2.0 Themes include a liquid block that may be used for this functionality.
- Navigate to the Shopify theme editor and to the product page template
- Click Add block and choose Custom Liquid
- Use the examples below or your own workflow to hide Downpay based on specific rules
This workflow is useful for various use cases:
Enable Downpay only for your internal sales team to use to create orders for phone orders. This workflow is often used to circumvent Shopify's draft orders not supporting partial payment
Enable only certain customers to leave a deposit
Assign a customer tag to the specific customers that should be able to see Downpay
Follow the theme setup above to add a liquid block to your product template
Copy the code below into the liquid block and adjust the tag to fit your setup.
Click Save
This will only work with a product that only has one purchase option in Downpay (non variant purchase options).
This script will hide Downpay on products that are tagged with a specific tag. This is useful when you want to hide Downpay on specific add on product pages. Use this code and adjust to suit the tag you use on your store.
For example, if you would like to show Downpay deposit options to only customers shopping from the French Market, you would add the following code to your theme.liquid file or your main product liquid template.
On this page:
Overview
Setup instructions
Examples
Overview
You can conditionally prevent Downpay from initializing on the product page based on custom conditions. To do this, set the following variable in javascript inside your theme:
window.downpay.disabledOnFirstLoad
Setup instructions
2.0 Themes Setup
2.0 Themes include a liquid block that may be used for this functionality.
- Navigate to the Shopify theme editor and to the product page template
- Click Add block and choose Custom Liquid
- Use the examples below or your own workflow to hide Downpay based on specific rules
Examples
Show Downpay to logged in customers with a specific customer tag
This workflow is useful for various use cases:
Enable Downpay only for your internal sales team to use to create orders for phone orders. This workflow is often used to circumvent Shopify's draft orders not supporting partial payment
Enable only certain customers to leave a deposit
Assign a customer tag to the specific customers that should be able to see Downpay
Follow the theme setup above to add a liquid block to your product template
Copy the code below into the liquid block and adjust the tag to fit your setup.
{% unless customer.tags contains "vip" %}
<script>
window.downpay = window.downpay || {};
window.downpay.disabledOnFirstLoad = true;
</script>
{% endunless %}
Click Save
Show Downpay only when a product is sold out
This will only work with a product that only has one purchase option in Downpay (non variant purchase options).
{% if product.selected_or_first_available_variant.inventory_quantity >= 1 %}
<script>
window.downpay = window.downpay || {};
window.downpay.disabledOnFirstLoad = true;
</script>
{% endif %}
Don't show Downpay on certain product with a specific tag
This script will hide Downpay on products that are tagged with a specific tag. This is useful when you want to hide Downpay on specific add on product pages. Use this code and adjust to suit the tag you use on your store.
{% unless product.tags contains "addon" %}
<script>
window.downpay = window.downpay || {};
window.downpay.disabledOnFirstLoad = true;
</script>
{% endunless %}
Show Downpay to a specific market
For example, if you would like to show Downpay deposit options to only customers shopping from the French Market, you would add the following code to your theme.liquid file or your main product liquid template.
{% if localization.market.handle == 'fr' %}
<script>
window.downpay = window.downpay || {};
window.downpay.disabledOnFirstLoad = true;
</script>
{% endif %}
Updated on: 26/10/2024
Thank you!