-- HikaShop version -- : 2.2.3
-- Joomla version -- : 2.5.19
-- PHP version -- : 5.3.27
Hello HikaShop,
I'm hoping that you can assist me with a problem I need to solve. I'm trying to set up HikaShop so that when a customer purchases a product they will enter in their billing info, as well as submit a number they already have. I would like that number to be used to query an SQL database table and return a code back, based on the customer provided number and the product selected.
I have created a custom field in the "order" Table with a Column Name of "serialnumber". This field shows up on the checkout page for the customer to enter in their number as I wanted it to.
I have also created the PHP code to query the SQL database. The function takes two variables, the number entered by the customer and the product purchased, and returns a key code. Could you tell me what variable holds the input given by the customer in the custom field? I also don't know how to pass the purchased product to the function as a variable or number that will reference a column in the database table, could you help me do that?
Finally, I'm not sure if I can add the PHP code to a display>view for it to work properly, or would I have to create a HikaShop plugin using something like onAfterOrderConfirm(&$order,&$methods,$method_id)?
Thank you for your help!