Coding Job for Gravity Forms in Woocommerce for a print shop calculator.

I need php or javascript code to be written in gravity forms for the business cards deluxe products the price needs to update real time as options are changed. https://kudoprint.com.au/shop/business-cards-deluxe-410g/
Please note we are also calculating product weight and package size for freight module on these products.

I have had some code written in Prestashop Dynamic Product price plug in but i prefer to user woocommerce with gravity forms
The php code for the Prestashop calculator is at this link: https://www.dropbox.com/s/gbfwsmwg1kb3cz1/product18-with-options.php?dl=0

This PHP code in the previous link will explain how the calculations are done.

The layout for the business cards deluxe needs to look neat and compressed

(so we do not take up too much space for the calculator) like this screen shot below:

Drop Down Menus Contents: Product Type

Drop Down Menus Contents: Product Size

Drop Down Menus Contents: Product Quantity

Drop Down Menus Contents: Product Colour

Upload Images/Artwork: When Upload Images/Artwork is checked a section opens below the check box where the user can select files to upload or drag into the upload section (when unchecked the file up-loader section closes) this feature is already in gravity forms:

Also the Options are used for all the other products in our shop as well so they option code should probably be in another file.

Foiling: When the user clicks the foiling check box the section below opens with the two drop down menus :

Drill Hole: When the user clicks the Drill Hole check box the section below opens with the drop down menu below:

Embossing: When the user clicks the Embossing check box the section below opens with the drop down menu below:

Numbering: When numbering is checked the section below opens and the user can type in what number he want to start at.

Overview of Calculator – Refer to the php file at the link below

For each combination of Product Type/Product Size/Colour there is a different pricing.
This coding is to be written in Woocommerce with Gravity Forms.

The php code and pricing arrays for the original calculator contains the prices and varilable/options:
https://www.dropbox.com/s/gbfwsmwg1kb3cz1/product18-with-options.php?dl=0

Some explanations on the logic for the calculator:

  1. Rows 14 to 56 – This is how i get the data for the price arrays (When the user selects a combination from the drop down menus Product Type, Product Size, Colour the price is retrieved from arrays for these combinations – The Quantity option tells which element in the array to get the price) e.g. 40,45,50,80,120,160,200,240,280,320,360,400,440,480,520,560,555,592,629,666,703,740,777,814,851,888,925,962,999,1036,1073,1110,1147,1184,1221,1258,1295,1332,1369,1406,1443,1480,1850,
  2. I copy data from wholesalers and paste it into a spreadsheet. The $mu5, $mu6, $mu7, $mu8 are variables to apply markup to the wholesale product prices.
  3. Rows 140 to 189 are attributes that apply to many of the different products so it is probably easier to have these rows as a separate data file – these attributes are calculated on the quantity and attribute options chosen.
  4. Admin needs to be able to add new products – so duplicating a product in woocommerce with your code and possibly adjusting your code to read different pricing data files needs to be considered. We can look at this in the next stage. the first thing is to get this first calculator working then we can expand on it.

The Quantity Dropdown needs to calculate the weight and size of the products. I can set the size and weight of one item.

The pricing data should be read from:

A csv file rather than being pasted into the code however the calculator must work very fast

Gravity forms and Woocommerce gravity plug in installed.
When the combinations are selected from the Product type, product size, product colour and Quantity drop down menus the prices are drawn from an array or excel file.
The combinations of Product type, product size, product colour indicate what row to draw information from and the Quantity drop indicated what array number or column number.
The documentation for Gravity Woocommerce plug in  says the code should be placed in the functions.php file of your active theme.

Instructions for gravity woocommerce plug are at the links below
https://www.gravityhelp.com/documentation/article/gform_field_value_parameter_name/#old-array-format
https://www.gravityhelp.com/documentation/article/gform_field_value_parameter_name/#source-code

If this goes smoothly I should have lots of work for you after this. Regards, Graham