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
.onsale { | |
background-color: #FFFFFF; | |
border-color: #FF0000 !important; | |
color: #FF0000 !important; | |
} |
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
ul.products li.product .onsale { | |
position: absolute; | |
top: 200px; | |
right: 85px; | |
} |
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( 'init', 'remove_jpcf_nonadmin' ); | |
function remove_jpcf_nonadmin() { | |
if ( ! current_user_can( 'manage_woocommerce' ) ) { | |
remove_action( 'media_buttons', 'grunion_media_button', 999 ); | |
} | |
} |
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
remove_action( 'woocommerce_proceed_to_checkout', 'woocommerce_button_proceed_to_checkout', 20 ); | |
add_action( 'woocommerce_proceed_to_checkout', 'change_url_to_checkout', 20 ); | |
function change_url_to_checkout() { | |
$cart = WC()->cart->get_cart(); | |
$url = ''; | |
foreach ( $cart as $item ) { | |
if ( $item['product_id'] === 70 ) { | |
$url = 'put_your_extra_page_url_here'; | |
break; |
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_after_shop_loop_item_title', 'custom_print_stock', 9 ); | |
function custom_print_stock() { | |
global $product; | |
printf( '<span>Available: %d</span>', esc_html( $product->get_stock_quantity() ) ); | |
} |
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
/** | |
* Sell only in California | |
*/ | |
function wc_sell_only_states( $states ) { | |
$states['US'] = array( | |
'CA' => __( 'California', 'woocommerce' ), | |
'TX' => __( 'Texas', 'woocommerce' ), | |
); | |
return $states; | |
} |
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( 'post_row_actions', 'remove_duplicate_capability', 20, 2 ); | |
add_filter( 'page_row_actions', 'remove_duplicate_capability', 20, 2 ); | |
function remove_duplicate_capability( $actions, $post ) { | |
if ( $post->post_type != 'product' ) { | |
return $actions; | |
} | |
if ( isset( $actions['duplicate'] ) ) { | |
unset( $actions['duplicate'] ); | |
} |
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
article.post .post-content { | |
width: 100%; | |
} | |
.single article.post .post-content { | |
width: 96%; | |
} | |
aside.post-meta { | |
display: none !important; |
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
/** | |
* Register term fields | |
*/ | |
add_action( 'init', 'register_vendor_custom_fields' ); | |
function register_vendor_custom_fields() { | |
add_action( WC_PRODUCT_VENDORS_TAXONOMY . '_add_form_fields', 'add_vendor_custom_fields' ); | |
add_action( WC_PRODUCT_VENDORS_TAXONOMY . '_edit_form_fields', 'edit_vendor_custom_fields', 10 ); | |
add_action( 'edited_' . WC_PRODUCT_VENDORS_TAXONOMY, 'save_vendor_custom_fields' ); | |
add_action( 'created_' . WC_PRODUCT_VENDORS_TAXONOMY, 'save_vendor_custom_fields' ); | |
} |
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
function wc_conver_special_chars_bookings( $data ) { | |
if ( isset( $data['summary'] ) ) { | |
$data['summary'] = htmlspecialchars_decode( $data['summary'] ); | |
} | |
if ( isset( $data['description'] ) ) { | |
$data['description'] = htmlspecialchars_decode( $data['description'] ); | |
} | |
return $data; |