Skip to content

Instantly share code, notes, and snippets.

View aqeelashraf's full-sized avatar

Aqeel Ashraf aqeelashraf

  • Lahore, Pakistan
View GitHub Profile
@aqeelashraf
aqeelashraf / woocommerce_template_functions.php
Created August 28, 2012 06:35 — forked from aschroder/woocommerce_template_functions.php
Hack Woocommerce to add product custom fields - updated
<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") : ?>