 We used wokamas to add an extra charge to our checkout which we called VAT and what this would do is that it would get a flat fee of 5 and then also get an 18% of what our cut total is and then it would add together those two fees and then eventually it would throw them out as an extra fee. Now the challenge with this is that not everyone is a programmer and they would probably find this inconveniencing. So what we're going to do is we're going to make this available to the shop manager maybe if they come to this particular page or whatever it is they can quickly add a 5 or 10 or whatever depending on the change that there is and they can even add a different percentage without having to look into the code but the code itself will pick up what's been written and then it will automatically put it out. So what we're going to do is we're going to add two wokamas settings in the different sections that we do have here. So these are different sections like general, products, shipping, checkout, account, email, integration and advanced. So let's use the products page to help us to get that or we can even use the general to make sure that someone gets it the moment they land here. So in today's video we're going to create our own tab that we shall call a VAT pricing and we shall just add it here and to allow us to add our particular settings that we'll use in our plugin. So let's go back to the plugin here and then we'll start on that. The first thing we need to do is add a filter and what we're going to be looking for is the wokamas settings tab. We're going to be looking for the wokamas setting tabs array and that's the hook we want. And from here we're going to add our own function and the function will be take a price, add VAT pricing. Now of course we'll delay this by giving it a higher priority of 50 but anything above 10 would do but let's make it very obvious by choosing 50. Now the next thing we need to do is open up our function and then we shall start writing our code. Let me put some space here so that we are on top of our game. So in here we're going to be getting a settings tab array of information. That's why I return it first and I'm going to pass it inside as an argument here. Now we shall get the settings tab and chain on our own ID for our pricing. So I'll just use this to sort of do the same thing so I'll copy and add this ID take a price VAT pricing and then I'm going to use that as a translatable string to work this. Of course we'll need our text domain, we'll copy this and add it here but we're going to have a title and we're going to call this VAT pricing and if we save this come back to our wukama settings and reload this. You're going to see that we now have a new tab here and it has already the save changes button. That's the beauty of using what's already existing. So all we need to do is just add our own settings that will allow our shop owner, shop manager to make those changes quite easily. So we go to the next step of adding the settings. Now in here we're going to use an action hook which is called a wukamas setting tabs and it expects for you to chain on something this here what we used our ID take a price VAT pricing which I'll just add that on and now we're going to add the function that's going to run with this hook. So I'll copy this here pricing and I'll add on the word settings to make it obvious that we're going to be dealing with settings. So we'll write that function as well and let's not forget its name and basically what this one what this function needs is to get the wukamas admin fields and we're going to be adding our fields inside this particular function. However we can choose to add another function that just stops the admin fields. So let's just do that and say get take a price add VAT pricing settings or we can just say take a price VAT pricing settings. So I'll copy this because this is what we need and I'll make another function here and that's where we'll write all our settings in this particular case. So the first thing we want here is to return the settings of course. Now you can make this also feel terrible so that someone who uses your plugin can also tab into it so you can actually use the apply filters function in this place so you can apply filters and with the apply filters all you need to do is add a unique ID that people can use so I'll get take a price VAT settings I'll just add on something very simple so filter underscore so that someone can quickly pick this up as a filter and then add in any other settings they want. So we're going to get the settings here and we're going to start chaining onto them so we'll have our settings already there as a filter sorry as an array and we're going to add an array of information here so when these settings are picked from this function that will be sent into the Wukamas admin fields right here and that will be passed into this action and then we will be getting our fields back on the backend of our site so we shall start adding our array of settings in here and the first thing we shall do is say the first component we're working with is going to be called a settings title and this will have of course an array of information in it and then we'll move on to the next piece but in here we're going to have an ID so we'll have an ID, a description, a type and a name in this particular setting so let me just wrap this with single quotes and then I'll chain on with our arrow and then of course with our single quotes here now the ID for this should be very unique and I can decide to use the same thing that we have here and just add on settings title at the end of this and so we're going to have a description and say this is section for handling VAT information that will be a description the type will be a title and then we're going to have the name and say this is VAT pricing information and the only thing that's left is adding commas right here so if I was to save this come back to our backend here and reload you'll see that we now have our VAT pricing information and we have a description following that particular title now let's add one field or two fields so that we can be able to finish up on serving the particular pieces that we need so I'm going to duplicate this two times and then we shall just change the information and the need arises so what we need for VAT pricing here is we need to have the flat fee flat fee and then we're going to get also the percentage so we'll call this dynamic fee for now so we'll just call this name will be flat fee then this will be dynamic fee the title will be a text because we want it to be a text field we'll have a text for this as well description we can just say the flat fee flat fee number and then I'll just get this VAT pricing flat fee for the ID then copy this and then just change this also here for the ID and we'll call this percentage of tax so if we are to save this come back here reload we shall see that we now actually have two fields that are reflective of what we want however they have jumped out of our section and we need to have them above our particular button and the way we do that is by introducing a section end so that the button knows where it needs to actually go so we'll come back here and then I'll duplicate this and we're going to have a section end sorry this should actually be section title to signify that we're beginning with a particular section and what this is going to be the type will be a section end it doesn't need a name and it just needs an ID so I'll copy section end and then change this to that and then when I save this come back and reload here we'll see our section title coming fast and then our section end here and then we'll have the button showing up here so let me try to save a flat fee of 5 and then save our percentage as 18 you'll see that it does not save currently so we need to add that functionality to save our particular form that we have here so come back to our code and then we are going to add some saving settings so just like we opened up our form we can actually use this same information that we have here to add our saving options here now the only thing that we are going to change here is instead of having section tabs here we're going to change this to update options and we'll have our take a press VAT pricing just like this ID of the tab so this is the particular action hook that we need to save our settings and change this to update options however when we come to the wukamas admin fields and the function that we have for these particular settings all we need to do is just say wukamas update options and then we shall pass in the function that contains our settings fields so what I'm going to do is just save this come back here, reload this and I'm now going to save our 10 and then I'm going to save our 20% which should be 2 and then when I save this we have our setting fields actually changing and saving so let me save this to 5 let me save this to 0.18 and then save this here you'll see that we have this particular content now I'm going to go back into our code right here and then I will change this from what we have here as static data and then make it dynamic that will always be fed by the setting options that we do have here so to get that information we just need to use the default VAT press function of get options and when we are getting options we need to pass in the ID of that particular option and how do we get the ID of those settings is we come here and look for the ID of those particular pieces so what we need here is the take a press VAT pricing flat fee and then we shall need also the dynamic fee so I'm going to get options for this duplicate it and we need to get also the dynamic fee right here now what we are going to do is save this as variables so get that variable copy this place it here and we need to change the name because we can't have one variable equal to different pieces of information so just like the flat fee we have here we are going to change this here and we are going to get our dynamic fee from here and we are going to change it here and so when I save this come back to our checkout page let me reload this here the reason we have this failing is we have an undefined fraction of get options this needs to be singular option so I'll come and make amends here and then save this come back to our checkout page to reload it and you will see that our VAT is actually the same as we previously had it's 95 so what happens if I change this to 10 and save it if I come here and reload we expect now it will be 100 and we have it as 100 so this is one way of allowing your shop manager actually have all this content available for you whereby someone who is not a technical person in writing code can just come and fill out this information and then you can use it on the front end wherever you want to use it so we found the video very hopeful like it leave a comment in the description if you feel like you have a question or you have something to say you have a different way of doing this let me know in the comment section and don't forget to subscribe if you haven't subscribed yet because we have so much good information coming up in the nearest of time so thank you for watching and bye bye