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
// Use these instructions at your own risk. Make sure you have full site/database backup prior to proceeding. | |
// | |
// Install this plugin to add custom PHP code https://wordpress.org/plugins/code-snippets/ | |
// Activate the plugin. | |
// Go to Snippets->Add New | |
// Paste the following code into the provided "Code" field. | |
// Choose to Run Only Once. | |
// Click Save changes and activate button at the bottom. | |
// After running it once, I would suggest to remove this snippet otherwise you may miss out on important updates in the future. | |
// After running this, you may get a fresh copy of the notices once more. This is normal and this time when you dismiss them, they should stay gone.. |
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_payment_method .woocommerce-PaymentMethod label { margin-left: 10px; } | |
#add_payment_method li { clear: right; } | |
#add_payment_method #wc-stripe_sepa-form { padding: 10px; } | |
form#order_review #payment_method_stripe { margin: 25px 0 25px 25px; } | |
form#order_review #payment_method_stripe_sepa { margin: 25px 0 25px 25px; } | |
form#order_review .payment_methods label { margin-left: 10px; } | |
form#order_review li { clear: right; } | |
form#order_review #wc-stripe_sepa-form { padding: 10px; } | |
.wc_payment_method .payment_box label { display: inline; } |
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_customer_order_csv_export_order_headers', 'wc_product_vendors_csv_export_integration_add_column_headers' ); | |
add_filter( 'wc_customer_order_csv_export_order_line_item', 'wc_product_vendors_csv_export_integration_modify_line_item', 10, 5 ); | |
add_filter( 'wc_customer_order_csv_export_order_row_one_row_per_item', 'wc_product_vendors_csv_export_integration_add_row_data', 10, 4 ); | |
function wc_product_vendors_csv_export_integration_add_column_headers( $headers ) { | |
$headers['vendor'] = 'Vendor'; | |
return $headers; |
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_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 ); | |
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 ); | |
add_action( 'woocommerce_after_single_product_summary', 'related_upsell_products', 15 ); | |
function related_upsell_products() { | |
global $product; | |
if ( isset( $product ) && is_product() ) { | |
$upsells = version_compare( WC_VERSION, '3.0', '<' ) ? $product->get_upsells() : $product->get_upsell_ids(); |
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_shipping_method_full_label', 'remove_shipping_label', 10, 2 ); | |
function remove_shipping_label( $label, $method ) { | |
$new_label = preg_replace( '/^.+:/', '', $label ); | |
return $new_label; | |
} |
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_product_review_list_args', 'wc_reverse_product_reviews' ); | |
function wc_reverse_product_reviews( $args ) { | |
$args['reverse_top_level'] = true; | |
return $args; | |
} |
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_loop_add_to_cart_link', 'product_cat_external', 10, 2 ); | |
function product_cat_external( $html, $product ) { | |
if ( $product->product_type === 'external' ) { | |
return '<a href="' . get_post_permalink( $product->id ) . '" rel="nofollow" data-product_id="' . esc_attr( $product->id ) . '" data-product_sku="' . esc_attr( $product->get_sku() ) . '" class="button add_to_cart_button product_type_variable">View Detail</a>'; | |
} else { | |
return $html; | |
} | |
} |
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_product_enable_dimensions_display', '__return_false' ); |
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_loop_add_to_cart_link', 'change_add_to_cart_loop' ); | |
function change_add_to_cart_loop( $product ) { | |
global $product; // this may not be necessary as it should have pulled the object in already | |
return '<a href="' . esc_url( $product->get_permalink( $product->id ) ) . '">LEARN MORE</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
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10 ); | |
add_action( 'woocommerce_single_product_summary', 'my_woocommerce_template_single_rating', 10 ); | |
function my_woocommerce_template_single_rating() { | |
global $product; | |
if ( $product->post->comment_status === 'open' ) | |
wc_get_template( 'single-product/rating.php' ); |