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
function iconic_modify_woothumbs_all_images_data( $image_data, $product_id ) { | |
$title = get_the_title( $product_id ); | |
foreach( $image_data as $index => $image ) { | |
$image_data[ $index ]['alt'] = $title; | |
} | |
return $image_data; | |
} |
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
/* Yith Add 'Submit review' Link on Top */ | |
if( defined('YITH_YWAR_PREMIUM') ){ | |
add_action( 'ywar_summary_prepend','yith_ywar_show_submit_review_link',5 ); | |
function yith_ywar_show_submit_review_link(){ | |
echo '<a href="#review_form_wrapper">Submit review</a>'; | |
} | |
} |
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_filter( 'wc_smart_cod_available', 'cod_restrict_coupons' ); | |
function cod_restrict_coupons( $is_cod_available ) { | |
global $woocommerce; | |
$applied_coupons = $woocommerce->cart->applied_coupons; | |
// add the coupon codes you want | |
// to restrict in this array | |
$restricted_coupons = array( |
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
// Render fields at the bottom of variations - does not account for field group order or placement. | |
add_action( 'woocommerce_product_after_variable_attributes', function( $loop, $variation_data, $variation ) { | |
global $abcdefgh_i; // Custom global variable to monitor index | |
$abcdefgh_i = $loop; | |
// Add filter to update field name | |
add_filter( 'acf/prepare_field', 'acf_prepare_field_update_field_name' ); | |
// Loop through all field groups | |
$acf_field_groups = acf_get_field_groups(); | |
foreach( $acf_field_groups as $acf_field_group ) { |
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
/** | |
* Change price format from range to "From:" | |
* | |
* @param float $price | |
* @param obj $product | |
* @return str | |
*/ | |
function iconic_variable_price_format( $price, $product ) { | |
$prefix = sprintf('%s: ', __('From', 'iconic')); |
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_filter( 'woocommerce_available_variation', 'load_variation_settings_fields' ); | |
function load_variation_settings_fields($variations) { | |
// duplicate the line for each field | |
/*$variations['veg_nonveg'] = get_post_meta( $variations[ 'variation_id' ], '_veg-nonveg'); | |
$variations['no_serving'] = get_post_meta( $variations[ 'variation_id' ], '_no-serving', true ); | |
$variations['serving_size'] = get_post_meta( $variations[ 'variation_id' ], '_serving-size', true ); | |
$variations['total_protein'] = get_post_meta( $variations[ 'variation_id' ], '_total-protein', true ); | |
$variations['protein_percentage'] = get_post_meta( $variations[ 'variation_id' ], '_protein-percentage', true ); | |
$variations['protein_per_serving'] = get_post_meta( $variations[ 'variation_id' ], '_protein-per-serving', true ); |
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 custom Theme Functions here | |
/** | |
* Sorting out of stock WooCommerce products - Order product collections by stock status, in-stock products first. | |
*/ | |
class iWC_Orderby_Stock_Status | |
{ | |
public function __construct() | |
{ | |
// Check if WooCommerce is active |
NewerOlder