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
/** | |
* Iconic Linked Variations - Force show out of stock Linked Variations. | |
* | |
* @param array $product_data Product Data. | |
* @param int $product_id Product ID. | |
* | |
* @return array | |
*/ | |
function iconic_lv_force_show_out_of_stock_products( $product_data, $product_id ) { | |
foreach ( $product_data['attributes'] as &$attribute ) { |
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
// First, let's write the function that returns a given product SKU | |
function iconic_return_sku( $product ) { | |
$sku = $product->get_sku(); | |
if ( ! empty( $sku ) ) { | |
return '<p>SKU: ' . $sku . '</p>'; | |
} else { | |
return ''; | |
} | |
} | |
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_cart_item_name', 'iconic_product_image_on_checkout', 10, 3 ); | |
function iconic_product_image_on_checkout( $name, $cart_item, $cart_item_key ) { | |
/* Return if not checkout page */ | |
if ( ! is_checkout() ) { | |
return $name; | |
} | |
/* Get product object */ |
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
/** | |
* Remove "From %s" format of pricing. | |
*/ | |
function iconic_was_remove_from() { | |
remove_filter( 'woocommerce_variable_price_html', array( 'Iconic_WAS_Fees', 'variable_price_html' ), 10, 2 ); | |
} | |
add_action( 'init', 'iconic_was_remove_from' ); |
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
// Translate 'Back to Cart' | |
function translate_strings ( $translated_text, $text, $domain ) { | |
switch ( $translated_text ) { | |
case 'Back to Cart' : // change text | |
$translated_text = __( 'Bumalik sa Cart', 'woocommerce' ); | |
break; | |
} | |
return $translated_text; | |
} | |
add_filter( 'gettext', 'translate_strings', 20, 3 ); |
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
jQuery('.iconic-woothumbs-responsive-media video').attr('controls',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 Iconic linked products to shop page | |
add_filter('woocommerce_loop_add_to_cart_link', 'wlv_add_swatch', 999); | |
function wlv_add_swatch() { | |
echo do_shortcode('[iconic_wlv_links]'); | |
} |
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
/** | |
* Iconic WDS. | |
* Modify 'ASAP' label. | |
* | |
* @param string $label Label. | |
* | |
* @return string | |
*/ | |
function iconic_wds_modify_asap_label( $label ) { | |
return 'As soon as possible'; // Change this value |
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
/** | |
* Show parent's short description for variations. | |
* | |
* @param string $excerpt | |
* @param $post | |
* | |
* @return string | |
*/ | |
function iconic_get_the_excerpt( $excerpt, $post ) { | |
if ( 'product_variation' !== $post->post_type ) { |
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
/** | |
*Iconic Attributes Swatches - dequeue flickity JS and CSS | |
*/ | |
function iconic_was_dequeue_flickity(){ | |
wp_dequeue_style( 'flickity' ); | |
wp_dequeue_script( 'flickity' ); | |
} | |
add_action( 'wp_enqueue_scripts','iconic_was_dequeue_flickity', 11); |
OlderNewer