Paid Memberships Pro – Adding Custom Checkout Boxes Creating DIVs, Not Tables
-
Hi,
I have paid memberships pro with the register helper add-on.
I am trying to add extra checkout boxes and some custom fields inside them.
I have followed the example code and have succeeded in creating the extra aforementioned bits in my checkout/register form.
The only problem is that it’s putting the custom checkout boxes and fields in a different way to the rest of the checkout boxes and field.
My custom checkout boxes and fields are coming out as:
<div id="pmpro_checkout_something" class="pmpro_checkout"> <h2><span class="pmpro_thead-name">Something Information</span></h2> <div class="pmpro_checkout-fields"> <div id="something_div" class="pmpro_checkout-field"> <label for="something">Something</label> <input type="text" id="something" name="something" value="" size="40" class="company input " /><span class="pmpro_asterisk"> *</span> </div> </div> <!-- end pmpro_checkout-fields --> </div> <!-- end pmpro_checkout_box-name -->
Where as I expect it to be as the rest of the checkout boxes are (and it says in the docs that custom checkout boxes will come out like this also):
<table id="pmpro_something_fields" class="pmpro_checkout" width="100%" cellpadding="0" cellspacing="0" border="0"> <thead> <tr> <th> <h2 class="sectionHeading">Something Information</h2> </th> </tr> </thead> <tbody> <tr> <td> <div> <label for="something">Something</label> <input id="something" name="something" type="text" class="input pmpro_required" size="30" value="" required="required" /> </div> </td> </tr> </tbody> </table>
Why is it putting my custom stuff in a different format? Or better yet, how do I make it come out in the above (latter) format? Is there a way to cleanly edit the pmprorh_add_checkout_box() and pmprorh_add_registration_field() functions?
Here is my code which create the custom checkout box and the field (in a custom plugin):
<?php /* Plugin Name: Register Helper Example Plugin URI: https://www.paidmembershipspro.com/wp/pmpro-customizations/ Description: Register Helper Initialization Example Version: .1 Author: Stranger Studios Author URI: https://www.strangerstudios.com */ //we have to put everything in a function called on init, so we are sure Register Helper is loaded function my_pmprorh_init() { //don't break if Register Helper is not loaded if(!function_exists("pmprorh_add_registration_field")) { return false; } pmprorh_add_checkout_box("something", "2: Something Information"); $field = new PMProRH_Field("something", "text", array("size"=>40, "class"=>"something", "profile"=>true, "required"=>true)); pmprorh_add_registration_field("somthing", $field); } add_action("init", "my_pmprorh_init");
Thanks
- The topic ‘Paid Memberships Pro – Adding Custom Checkout Boxes Creating DIVs, Not Tables’ is closed to new replies.