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
<?php | |
add_filter( 'woocommerce_loop_add_to_cart_link', 'quantity_inputs_for_woocommerce_loop_add_to_cart_link', 10, 2 ); | |
function quantity_inputs_for_woocommerce_loop_add_to_cart_link( $html, $product ) { | |
if ( $product && $product->is_type( 'simple' ) && $product->is_purchasable() && $product->is_in_stock() && ! $product->is_sold_individually() ) { | |
$html = '<form action="' . esc_url( $product->add_to_cart_url() ) . '" class="cart" method="post" enctype="multipart/form-data">'; | |
$html .= woocommerce_quantity_input( array(), $product, false ); | |
$html .= '<button type="submit" class="button alt">' . esc_html( $product->add_to_cart_text() ) . '</button>'; | |
$html .= '</form>'; | |
} |
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
<script> | |
jQuery(document).ready(function ($) { | |
function removeLoader() { | |
$('.product-type-external').find('.single_add_to_cart_button').removeClass('loading'); | |
} | |
$('.product-type-external').find('.single_add_to_cart_button').attr("target", "_blank"); | |
$('.product-type-external').find('.single_add_to_cart_button').on("click", removeLoader); | |
}); | |
</script> |
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_action( 'woocommerce_add_order_item_meta', 'flatsome_add_sku_order_details', 10, 3 ); | |
function flatsome_add_sku_order_details( $item_id, $values, $cart_item_key ) { | |
$item_sku = get_post_meta( $values[ 'product_id' ], '_sku', true ); | |
wc_add_order_item_meta( $item_id, 'sku', $item_sku , false ); | |
} |
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_action('wp', function(){ | |
remove_action( 'flatsome_category_title_alt', 'woocommerce_result_count', 20 ); | |
remove_action( 'flatsome_category_title_alt', 'woocommerce_catalog_ordering', 30 ); | |
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 ); | |
}); |
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
<?php | |
function remove_woocommerce_process_registration() { | |
remove_action('init', 'woocommerce_process_registration'); | |
} | |
add_action('init','remove_woocommerce_process_registration'); | |
add_action( 'init', 'my_process_registration' ); |
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_filter( 'the_title', 'shorten_woo_product_title', 10, 2 ); | |
function shorten_woo_product_title( $title, $id ) { | |
if ( is_shop() && get_post_type( $id ) === 'product' ) { | |
return substr( $title, 0, 15 ); // change last number to the number of characters you want | |
} else { | |
return $title; | |
} | |
} |
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
[row] | |
[col span="6" span__sm="12"] | |
[ux_product_gallery] | |
[/col] | |
[col span="6" span__sm="12"] |
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
/* iPhone 6 in portrait & landscape */ | |
@media only screen | |
and (min-device-width : 375px) | |
and (max-device-width : 667px) { /* STYLES GO HERE */} | |
/* iPhone 6 in landscape */ | |
@media only screen | |
and (min-device-width : 375px) | |
and (max-device-width : 667px) | |
and (orientation : landscape) { /* STYLES GO HERE */} |
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
<?php | |
add_filter('gettext', 'translate_text'); | |
add_filter('ngettext', 'translate_text'); | |
function translate_text($translated) { |