add hidden input field to woocommerce checkout to pass data to payment gateway

I have a store running WooCommerce and the client needs us to pass a variable to the payment gateway (WorldPay) that is then included in an payment confirmation email sent form the gateway to the client.

WorldPay say i just need to add this to the form:

<input type="hidden" value="myValue" name="M_myName" />

After a lot of research I figured out how to create an array of the SKUs for each product in the cart. I have created a function that will grab each product SKU and add it to an array. Then outputs this array to replace "myValue" in the above.

My question is where do I need to put the < input >? I have added it to woocommerce > checkout > review-order.php, but this doesn't seem to work. It shows in the front-end but doesn't get passed the WorldPay.

Or would I need to add it to an existing action? I found this which seems to be talking about the similar issue – but then, where would I need to inject the output of that action, in which template?

Thanks for any advice.

Category:php Views:3 Time:2018-12-04

Related post

  • How can i add Hidden input field like HTML in Flex? 2009-12-10

    I want to add some hidden field in Flex and send to the server please tell me the solution ? --------------Solutions------------- Err... Use any variable/object to store the value and send it as a part of your request object. use visible property in

  • Add hidden input types based on radio button selected 2011-09-08

    Is it possible to conditionally add hidden input fields into a form? eg I have a php form that is adding values to a table and if the appleID = 1 or 2 then I want 1 added to the fruits column of my table and if appleID =3 I want 1 added to the sweets

  • jquery - add to hidden input field on keypress? 2010-06-18

    I've got a hidden input field that I want to append text to depending upon what a user enters in two other fields. So, <input type="hidden" name="name" value="" /> <input type="text" name="first" value="" /> <input type="text" name="se

  • jquery change value of hidden input field 2011-03-13

    I'm having a hella time setting the value of a hidden input. I want to pass the HTML from between the option tags to the hidden field- end run it will the page title from wordpress' wp_list_dropdowns(). I've got it returning the text just fine, and o

  • Eliminating the Need For Hidden Input Fields 2011-06-29

    I have several hidden input fields used to hold coordinates calculated by javascript. The purpose of these fields is to pass the coordinates when the form is submitted. I am using an AJAX request through MooTools. Is there a simple way to eliminate t

  • how to use a hidden input field to store a blog post's set of tags 2011-06-29

    I have some slightly funky UI for inputting tags for a blog post: as tags are entered into an input field they are wrapped into spans that make them look nice by surrounding them in a stylized box, the end result comes out to be something like this:

  • Classic ASP/VBScript creating a hidden input field 2011-10-12

    I am doing a VBScript loop and I am attempting to concatenate a string which then would be loaded into the value of a hidden input field. response.write("<input type='hidden' name='strWPL' value='" & strTest & "'/>") I have verified tha

  • Filter with an exception for hidden input fields 2011-10-14

    The following is obviously finding elements that start with the class "output_" and are visible. My question to you is how can I include hidden input fields? $.each($(".output_"+value).filter(":visible"), function(index2, value2) { alert($(this).attr

  • Hidden div tag vs hidden input field to store client side data in mvc 3 website? 2011-12-29

    We have a MVC 3 website.We had to store many values in hidden fields on client side that are required to be posted later on using AJAX. For some reason i've been using hidden div tags instead of hidden input fields believing it has some perfo

  • How to get value of hidden input field not in same the order with regular expression 2012-03-10

    I want to get value of hidden input field <FORM onsubmit="javascript:return add();" method=post action=addMess.php> .... <INPUT name=sysess2 value=1234 type=hidden> .... </FORM> eg : <INPUT type=hidden name=hyds2 value=1234>

  • how to include a css-hidden input field in forms 2009-12-22

    I want to include a css-hidden input field in forms and check if the hidden field has it’s value filled out then reject the submission --------------Solutions------------- Brief tutorial: Fighting Spam with CSS A more comprehensive article on the sub

  • Can't set hidden input field's value using jQuery 2010-01-21

    I have a simple input field inside a form tag: <body> <form action="#"> <label>Input</label> <input type="hidden" id="foo" name="foo" /> </form> </body> I tried to set this value from a js file: $(document).r

  • Post data to a new popup window without using hidden input fields 2010-07-08

    Is it possible to post data to a new window without using hidden input fields. Data can be possibly quite large. Looking at something similar to jQuery ajax type post.. except I need to post the data to a new page. --------------Solutions------------

  • Value from Hidden Input field as an Actionlink Parameter 2010-07-29

    is there a way using Javascript or Jquery to use the value of a hidden field which i modify dynamically (depending on other stuff) to and actionlink helper? <%=Html.ActionLink("Groups", "List", "Home", new { brokerId = ??? HIDDEN INPUT FIELD ??? }

  • How do I use javascript to update the values of hidden input fields 2010-11-17

    I have the following fields: First Name: <input type="text" id="tFName" name="tFName" maxlength="50" /> Last Name: <input type="text" id="tLName" name="tLName" maxlength="50" /> I want to use javaScript specifically dojo to update the val

  • Rails 3: Why an empty nested form generates a hidden input field? 2010-12-20

    Why this: # edit.html.erb <%= form_for @product do |f| %> <%= f.fields_for :shop do |sf| %> # Nothing here <% end %> <% end %> generates a hidden input field: <input type="hidden" value="23" name="product[shop_attributes][i

  • Trouble setting and retrieving value of hidden input fields of iframe 2011-06-19

    I am having trouble either to set or retrieve the hidden input fields information of iframe. On the initial page, I click on "Submit" button to activate showBox function and pass three parameters, name, city, and state successfully. showBox creates a

  • Get value of hidden input field in JS 2011-06-28

    I need to get the value of a hidden input field using JS, var credoff = parseInt($(this).children('input.credoff:hidden').val()); which works fine in FF but does not work in IE, the input im talking of is the following... <input type='hidden' valu

  • Dynamically add extra input fields to html form 2011-09-04

    I am currently working on an html and php project. What I want to be able to do is to have an html with a file chooser for selecting a screenshot. Next to the file chooser will be a button/link for the user to be able to add another field. When the u

  • Get HttpSession by session ID which is submitted as hidden input field 2012-01-19

    Is it possible to get a HttpSession object by session ID, which is submitted to servlet as a hidden input field? I cannot go for session management by cookie because the device will not support cookies, or by URL rewriting because the session ID shou

  • Add / remove input field dynamically with jQuery 2012-02-07

    I would like to use jquery to build a dynamic add/ remove form. IT should look like: Name Type Required? The example input : Name Type Required? Tony Admin checked (checkbox) Delete <==press the button will delete the row What i have got is a exam

  • query add two input fields together 2012-02-19

    I have the following code. I want to add two input fields together and output it to the page. I get as far as being able to output what is type in the input field however I can't figure how to add the two fields together and output it. I have it at h

  • how to add multiple input field based on text box value? 2012-03-26

    I have created a add input field function which is working fine. I would like add many input field on basis of input field number.I just start unfortunately couldn't find a proper result for that. here is my JQ code $(document).ready(function() { var

  • dojox.grid.DataGrid How to add an input field and restrict input size 2013-10-06

    I am looking to add an input field into dojo data grid. I looked around but couldn't find it. The only way i could make it work is by making the cell editable. That makes that cell behave as an input field, but how can I restrict how much text or cha

  • Not able to add text to hidden Input field 2009-10-27

    I have the following HTMl: <input id="brandID" name="brandID" type="hidden" value="" /> <select id="selectList" class="textfield70pc" name="selectList"> <option selected="" value="221">A</option> <option value="4673">B

Copyright (C), All Rights Reserved.

processed in 0.180 (s). 11 q(s)