For some products, depending on industry practices, customer contracts, or other purposes, you might want to calculate and indicate the total price for a certain quantity of your product. For example, if you always sell a product by thousands, it might come in handy for you to have a field that indicates the price for a thousand units of this product, instead of only showing the price for a single unit. This type of automation can be arranged with the setup of a system rule. Please contact us at support@paragon-erp.com for help setting up rules.
You will need to create two new attributes as explained below. Note that you can name them differently than what is suggested, but you will need to modify the rule to include those differences (see step 5). This will also be necessary if you want to enter the attributes in a different language than English.
First, create a new money attribute and name it price by quantity (suggested).
Second, create either a number attribute or an attribute with lists to choose from, and name it quantity for pricing (suggested). It is recommended that you enter a default value for this attribute.
We now need to setup the product screen in order to add the new attributes.
Go to the settings page by hitting the settings button, then select screen setup.
Select the product module, and hit the edit button.
Using the add button, add the two attributes you just created.
Make sure you check the disallow multiple checkbox.
This step is necessary only if you didn't put a default value on your quantity for pricing attribute, or you want to use a different value than the default one. In this example, we want to use a value of 100 instead of the default value 1000.
You can either create a new product or edit an existing one. In this example, we will edit an existing product, but the steps are the same if you create a new product.
Navigate to your product screen and hit the edit button. Change the value for the quantity for pricing attribute, and hit the save button.
Do not enter any value for the price by quantity attribute as it will be calculated as: price by quantity = sale price x quantity for pricing.
Please note that if either the sale price or quantity for pricing attributes isn't set, the calculation will be ignored and the price by quantity attribute will be blank.
Rules are initially created by Jonar - all you have to do is install and activate them.
This rule should be saved under the after_save_product trigger.
This step is necessary only if you entered different names than the one suggested in step 1.
Locate the following text in the rule and modify the words in " " by your attributes name.
var priceByQuantity = 'priceByQuantity' // TODO replace by custom attribute
var quantityForPricing = "quantityForPricing" // TODO replace by custom attribute
Attention: Do not modify the words on the left of the "=" symbol.
Please note that this rule only fills the price by quantity attribute for reference purposes. It will not affect any of the transaction entries. As always - please contact us at support@paragon-erp.com for help setting up rules.