Step 1:
You have to add the weight and volume in each product in the edit product page of the wp-admin like the following screenshot.

Step 2:
Also to use volume of the product in cart shipping calculation you have to enable “volume calculation” in the sendle setting like the following screenshot.