View Add product date WooCommerce
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_action( 'woocommerce_single_product_summary', 'add_product_date', 25 ); | |
function add_product_date() { | |
if ( is_product() && ! empty( get_post_meta( get_the_ID(), 'product_date', true ) ) ) { | |
echo do_shortcode('[post_date]'); | |
} | |
} |
View remove setup header
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_action( 'admin_init', 'remove_setup_header' ); | |
function remove_setup_header() { | |
echo '<style>#wpadminbar + #wpbody { margin-top:0; }</style>'; | |
} | |
remove_action( 'in_admin_header', array( 'Automattic\WooCommerce\Internal\Admin\Loader', 'embed_page_header' ) ); |
View remove woocommerce star rating
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_action( 'woocommerce_before_single_product_summary', 'remove_single_rating' ); | |
function remove_single_rating() { | |
if ( ! empty ( get_post_meta( get_the_ID(), 'remove_rating', true ) ) ) { | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10 ); | |
} | |
} |
View style.css
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
@media only screen and (min-width: 960px) { | |
.cart-quantity-discount { | |
display: inline; | |
color: white; | |
font-weight: 500; | |
font-size: 12px; | |
background: green; | |
padding-top: 1px; | |
padding-bottom: 1px; |
View cart.php
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 | |
/** | |
* Cart Page | |
* | |
* This template can be overridden by copying it to yourtheme/woocommerce/cart/cart.php. | |
* | |
* @author Brad Dalton - WP SITES | |
* @link https://wpsites.net/?p=110461 | |
*/ |
View Add Custom Subscriber Customer Capabilities WooCommerce
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_action( 'admin_init', 'add_subscriber_capabilities'); | |
function add_subscriber_capabilities() { | |
$role = get_role( 'subscriber' ); | |
$role->add_cap( 'edit_posts' ); | |
$role->add_cap( 'edit_published_posts' ); | |
$role->add_cap( 'publish_posts' ); | |
$role->add_cap( 'delete_posts' ); | |
$role->add_cap( 'delete_published_posts' ); |
View add-custom-role-customer-woocommerce
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_action( 'admin_init', 'add_customer_user_role' ); | |
function add_customer_user_role() { | |
add_role( | |
'customer', | |
__( 'Customer - Expired Subscriber' ), | |
array( | |
'read' => true, | |
)); |
View woocommerce-archive-page-custom-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
add_action( 'woocommerce_before_main_content', 'taxonomy_page_custom_field', 99 ); | |
function taxonomy_page_custom_field() { | |
if ( is_product_taxonomy() ) { | |
$field = get_woocommerce_term_meta( get_queried_object_id(), 'wc_taxonomy_custom_field', true ); | |
if ( get_queried_object() && ! empty( $field ) ) { | |
echo '<p class="taxonomy-custom-field">' . $field . '</p>'; |
View custom-field-after-shop-loop
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_action( 'woocommerce_after_shop_loop_item_title', 'hook_after_product', 2 ); | |
function hook_after_product() { | |
echo '<p class="after-product">' . get_post_meta( get_the_ID(), 'after_product', true ) . '</p>'; | |
} |
NewerOlder