Choose your language

Choose your login

Support

Assign a cost script to each product

This page applies to:

Now that you have created your cost scripts and checked them on your test products (or in a sandbox room), you are ready to assign them to your real products. It’s important to note that as soon as you assign a cost script to a published product, the Cost Estimate will be visible to the customer.

  1. In the Operator interface, in the bottom left corner of the screen, click Settings.
  2. Click the Products tab.
  3. In the Cost script column, select the cost script you want to apply to each product.
  4. Check what the cost estimate looks like by creating a new order.
My cost estimate details aren't showing on the New Order form

If the cost estimate details are not displayed on the New Order form, and you had no syntax errors in the cost script, your cost script probably references an option that is not in the product configuration. An error message is usually displayed indicating the line number in the cost script that has the error. For example, if your cost script references Hole punching and your product does not include a Hole punching field, the cost estimate details will not be displayed at all.

One way around this is to use if statements when defining variables. For example, if you use:

finishingCost = finishingCost + order.laminating.cost

and there are is no laminating attribute in the product, an error will be displayed on the New Order form. However, if you use the following if statement, the script will first check if there is a laminating attribute, and if there is not, order.laminating.cost will be ignored:

if (order.laminating) { finishingCost = finishingCost + order.laminating.cost }

Unassign a cost script

  1. In the Cost script column, click the X.

Remove your test products

If you created draft products when you created and tested your scripts, you should delete them after you have assigned a cost script to each published product.

  1. In the Operator interface, in the bottom left corner of the screen, click Settings.
  2. Click the Products tab.
  3. Select the product you want to delete.
  4. Click Delete.

Next Step: Go live

Comments