Please excuse me if this is a rookie question but i’m still learning how this all works together.
I am currently building a theme for a client with woocommerce support and because of the specific nature of the client’s subject, I had to build a custom checkout process so I’m able to take all necessary data and present to user in a particular way.
This has all been figured out and it’s working however, I want to be able to change the shipping cost based on certain external factors. The order is manually added programmatically as soon as I have all the information however, as per this example, I need to be able to call “new WC_Shipping_Rate” from setup.php as there, I have the action that’s taking care of adding the order manually.
As mentioned above, I am however getting the Fatal error, Class not found in that particular line of code. So, my questions would be 1) is it possible to initiate a new object from the WC_Shipping_Rate class in setup.php and 2) If not, what would be the ideal way of going about this please?