A recent update to woocommerce has broken a simple plugin that was created. I'm a bigtime rookie when it comes to referencing HTML elements with PHP code.
The plugin simply adds the data that is in the variable "hiddenRef" to the element on a particular page, and makes the input box read only.
This is the code:
jQuery(document).ready(function($) {
var hiddenRef = $("#hiddenRef").val();
$("input[name*='poster[reference]']").val(hiddenRef);
if(hiddenRef !=""){
$("input[name*='poster[reference]']").attr("readOnly", "readOnly");
}
}
The page that woocommerce updated now shows the field to be:
<input type="text" class="input-text addon addon-custom" data-price="" name="addon-707-poster-0[reference]" value="">
Can someone please help me tweak the code above to add the value "hiddenRef" to the value section of the HTML element. I'm not sure what name*='poster[reference] is looking for.