Skip to content

Instantly share code, notes, and snippets.

Avatar

Aqeel Ashraf aqeelashraf

  • Lahore, Pakistan
View GitHub Profile
@aqeelashraf
aqeelashraf / woocommerce_template_functions.php
Created Aug 28, 2012 — forked from aschroder/woocommerce_template_functions.php
Hack Woocommerce to add product custom fields - updated
View woocommerce_template_functions.php
<form action="<?php echo esc_url( $_product->add_to_cart_url() ); ?>" class="variations_form cart" method="post">
<table class="variations" cellspacing="0">
<tbody>
<?php foreach ($attributes as $name => $options) : ?>
<tr>
<td><label for="<?php echo sanitize_title($name); ?>"><?php echo $woocommerce->attribute_label($name); ?></label></td>
// START HACK HERE
<?php if(is_array($options) && $options[0] == "CUSTOM_TEXT") : ?>