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 | |
/** | |
* Bootstrap Pagination. | |
* | |
* Echos Bootstraped paginated links (http://getbootstrap.com/components/#pagination). | |
* | |
* @since 0.0.1 | |
* | |
* @param array $args { | |
* An array of arguments. Optional. |
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 // only copy this line if needed | |
add_action( 'init', function() { | |
if ( current_user_can( 'manage_options' ) && function_exists( 'facebook_for_woocommerce' ) && isset( facebook_for_woocommerce()->get_integration()->events_tracker ) ) { | |
$event_tracker = facebook_for_woocommerce()->get_integration()->events_tracker; | |
remove_action( 'woocommerce_thankyou', [ $event_tracker, 'inject_purchase_event' ], 40 ); | |
remove_action( 'woocommerce_payment_complete', [ $event_tracker, 'inject_purchase_event' ], 40 ); |
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 // only copy this line if needed | |
function sv_mpc_measurement_label( $label ) { | |
if ( 'fr_FR' === get_locale() ) { | |
$label = str_replace( 'Required Width', 'Largeur requise', $label ); | |
$label = str_replace( 'Width', 'Largeur', $label ); | |
} | |
return $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
<?php // only copy this line if needed | |
/** | |
* Register Cart Notices texts for translation with WPML when the messages are first created/updated | |
*/ | |
add_filter( 'wc_cart_notices_update_fields', function( $fields ) { | |
if ( isset( $fields['name'] ) ) { | |
$slug = sanitize_title( $fields['name'] ); |
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 // only copy this line if needed | |
/** | |
* Charge a WooCommerce pre-order when the associated order is set to Completed status | |
* | |
* @param int $order_id | |
* @param \WC_Order $order | |
*/ | |
function sv_wc_charge_order_on_order_complete( $order_id, $order ) { |
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 | |
add_filter( 'wc_nested_category_layout_category_title_html', 'wc_nested_category_layout_category_title_html', 10, 3 ); | |
function wc_nested_category_layout_category_title_html( $title, $categories, $term ) { | |
$category = $categories[ count( $categories ) - 1 ]; | |
$url = esc_attr( get_term_link( $category ) ); | |
$link = '<a href="' . $url . '">' . wptexturize( $category->name ) . '</a>'; | |
return sprintf( '<h2 class="wc-nested-category-layout-category-title">%s</h2>', $link ); |
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 // only copy this line if needed | |
function sv_facebook_for_wc_basel_theme_add_filter_for_add_to_cart_fragments() { | |
// only make changes as long as Facebook for WooCommerce is installed | |
if ( function_exists( 'facebook_for_woocommerce' ) ) { | |
$events_tracker = facebook_for_woocommerce()->get_integration()->events_tracker; | |
$events_tracker->add_filter_for_conditional_add_to_cart_fragment(); | |
} |
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 // only copy this line if needed | |
/** | |
* Filter the quantity input's pattern attribute to fix the "Please | |
* match the requested format" HTML validation error that occurs when using | |
* WooCommerce Measurement Price Calculator with certain premium themes | |
* | |
* @props to mensmaximus {@link https://github.com/mensmaximus} for the | |
* proposed solution | |
* |
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 // only copy this line if needed | |
add_filter( 'wc_customer_order_export_auto_export_new_orders_only', '__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
<?php | |
function wc_address_validation_move_postcode_lookup() { | |
wc_enqueue_js( ' | |
( function() { | |
var $billingLookup = $( "#wc_address_validation_postcode_lookup_billing" ); | |
var $shippingLookup = $( "#wc_address_validation_postcode_lookup_shipping" ); | |
$( "div.woocommerce-billing-fields").find( "h3" ).after( $billingLookup ); |
NewerOlder