How to Calculate Costs on Purchase Orders

Duoplane Retailer accounts
Available on Professional, Premium, and Enterprise plans

Duoplane offers the flexibility to use templates with calculations, allowing you to dynamically and automatically determine item, shipping, and handling costs on purchase orders. This is particularly useful when item costs vary based on specific conditions, such as supplier agreements, quantity thresholds, or other factors.

This guide will walk you through how to use templates to dynamically calculate costs in Duoplane on both a global level and a vendor level. Please note when using a vendor level template this will override whatever is in the global level template where applicable.

 

Edit global item, shipping, and handling cost templates

  1. Login to your Duoplane Retailer account
  2. Navigate to Settings > Order Processing
  3. Look for the section at the bottom labeled "other options"
  4. Write the rules which you'd like cost calculations to follow, using Liquid template language
  5. Click "Save" when done

Edit vendor level item, shipping, and handling cost templates

  1. Login to your Duoplane Retailer account
  2. Navigate to the Vendors directory
  3. Locate the Wholesale account section and click "Edit"
  4. Look for the section labeled "order processing" which has three template fields:
    • item cost template
    • shipping cost template
    • handling cost template
  5. Write the rules which you'd like cost calculations to follow, using Liquid template language
  6. Click "Save" when done

Item cost template examples

This template calls on the order item as order_item and the inventory item as product_inventory. Information about liquid objects in Duoplane can be referred to in the article here >> Liquid Template Objects and Placeholders 

An example use case for using the item cost template could be if your vendor has reduced the cost of an item by 20% during a sale period, for products that have the word "SALE" in the product name. Below is an item cost template that could be used to accomplish this.

{% if order_item.name contains "SALE" %}
  {{ product_inventory.cost | times: 0.80 | with_precision: 2
{% else %}
  {{ product_inventory.cost }}
{% endif %}

 

Shipping and handling cost template examples

This template calls on the shipment as shipment.

An example use case would be if your supplier has a $7 standard shipping cost for all orders, with exceptions for a few SKUs "ABC" and "XYZ"—if those SKUs are included the shipping cost should instead be $10. Below is a shipping cost template that could be used to accomplish this.

Please note a handling cost template could be written the exact same way.

{% assign high_end_shipping_skus = '["CGB-18-BLK","CGB-18-WHT","CGB-18-RED","CGB-18-SEAF","CGB-28-BLK","CGB-28-WHT","CGB-28-RED","CGB-28-SEAF"]' | json_parse %}

{% assign high_end_shipping_skus = '["ABC","XYZ"]' | json_parse %}
{% assign shipping_cost = 7.00 %}
{% for shipment_item in shipment.shipment_items %}
{% if high_end_shipping_skus contains shipment_item.order_item.retailer_sku %}
{% assign shipping_cost = 10.00 %}
{% endif %}
{% endfor %}
{{ shipping_cost }}

 

There are many possibilities of how to calculate cost that can be explored. If you need help writing a template please reach out to support@duoplane.com for assistance.

Related to