This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--Add to catalog/view/theme/your-theme/template/product/product.tpl--> | |
<!--Find the line: "<?php if ($option['type'] == 'checkbox') { ?>" in line 117(may vary)--> | |
<!-- the next line--> | |
<!--Replace <div id="option-<?php echo $option['product_option_id']; ?>" class="option"> | |
<?php if ($option['required']) { ?> | |
<span class="required">*</span> | |
<?php } ?> | |
<b><?php echo $option['name']; ?>:</b><br /> | |
<?php foreach ($option['option_value'] as $option_value) { ?> | |
<input type="checkbox" name="option[<?php echo $option['product_option_id'][]; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Display variation dropdown as table | |
function woocommerce_variable_add_to_cart() { | |
global $product, $post; | |
$variations = $product->get_available_variations(); | |
foreach ($variations as $key => $value) { | |
?> | |
<form action="<?php echo esc_url( $product->add_to_cart_url() ); ?>"method="post" enctype='multipart/form-data'> | |
<input type="hidden" name="variation_id" value="<?php echo $value['variation_id']?>" /> | |
<input type="hidden" name="product_id" value="<?php echo esc_attr( $post->ID ); ?>" /> | |
<?php |