This file contains 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 our Custom Fields to simple products | |
*/ | |
function mytheme_woo_add_custom_fields() { | |
global $woocommerce, $post; | |
echo '<div class="options_group">'; | |
// Text Field |
This file contains 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
$('a[href*="#"]') | |
// Remove links that don't actually link to anything | |
.not('[href="#"]') | |
.not('[href="#0"]') | |
.click(function(event) { | |
// On-page links | |
if ( | |
location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') | |
&& | |
location.hostname == this.hostname |
This file contains 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
<?php | |
/** | |
* List available attributes on product page in a drop-down selection | |
*/ | |
add_action('woocommerce_before_add_to_cart_button', 'list_attributes_on_product_page'); | |
function list_attributes_on_product_page() { | |
global $product; | |
$attributes = $product->get_attributes(); |
This file contains 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
<script> | |
$(function() { | |
var $q = function(q, res){ | |
if (document.querySelectorAll) { | |
res = document.querySelectorAll(q); | |
} else { | |
var d=document | |
, a=d.styleSheets[0] || d.createStyleSheet(); | |
a.addRule(q,'f:b'); | |
for(var l=d.all,b=0,c=[],f=l.length;b<f;b++) |
This file contains 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
<?php if ( Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getEnableQtyIncrements() ){ ?> | |
<select class="input-text qty" name="qty" id="qty"> | |
<?php $i = (Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getMinSaleQty()?Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getMinSaleQty():1); ?> | |
<?php do { ?> | |
<option value="<?php echo $i?>"> | |
<?php echo $i?> | |
<?php $i+= Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQtyIncrements() ?> | |
</option> | |
<?php } while ($i <= (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getMaxSaleQty()) ?> | |
</select> |