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 | |
// You need this plugin: https://ptwooplugins.com/product/dpd-portugal-for-woocommerce/ | |
// Change order status after issuing label | |
add_action( 'woo_dpd_portugal_label_issued', function( $order_id ) { | |
$order = wc_get_order( $order_id ); | |
$order->update_status( 'completed', 'Order automatically set to Completed after issuing DPD 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 | |
/** | |
* Remove this plugin from the wp.org update requests by shortcircuiting the HTTP request | |
* This function should be placed on the plugin main file and namespaced accordingly | |
* Unfortunately, this will only work if the plugin is active | |
* | |
* @param array $parsed_args An array of HTTP request arguments. | |
* @param string $url The request URL. | |
*/ | |
function namespace_this_remove_plugin_from_wporg_updates( $parsed_args, $url ) { |
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 | |
/** | |
* https://ptwooplugins.com/product/dpd-seur-geopost-pickup-and-lockers-network-for-woocommerce/ | |
* | |
* #woo_dpd_pickup_point_information is the outter DIV for all the point information | |
* .woo_dpd_pickup_point_information_schedule is the SMALL tag for the schedule information | |
* .woo_dpd_pickup_point_information_icon_schedule is the SPAN tag for the schedule icon | |
*/ |
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 | |
/** | |
* Taxonomy/Term and Role based Discounts for WooCommerce lets you configure discounts/pricing rules for products based on any WooCommerce product taxonomy terms (built-in or custom), in a very simple way. | |
* Free version: https://wordpress.org/plugins/taxonomy-discounts-woocommerce/ | |
* PRO Add-on: https://ptwooplugins.com/product/taxonomy-term-and-role-based-discounts-for-woocommerce-pro-add-on/ | |
**/ | |
add_filter( 'woocommerce_sale_flash', function( $html, $post, $product ) { | |
// Taxonomy/Term and Role based Discounts for WooCommerce (Free) is active? | |
if ( function_exists( 'WC_Taxonomy_Discounts_Webdados' ) ) { |
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 | |
/** | |
* https://ptwooplugins.com/product/invoicing-with-invoicexpress-for-woocommerce-pro/ | |
* https://invoicewoo.com/ | |
*/ | |
// Change hook | |
add_filter( 'invoicexpress_woocommerce_vat_position_my_account', function( $hook ) { | |
return 'woocommerce_order_details_after_order_table'; | |
} ); |
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( 'kuantokusta_product_node_default_shipping', 'kuantokusta_default_free_shipping', 10, 3 ); | |
add_filter( 'kuantokusta_product_node_variation_shipping', 'kuantokusta_variation_free_shipping', 10, 3 ); | |
function kuantokusta_default_free_shipping( $shipping_cost, $product, $product_type ) { | |
return kuantokusta_free_shipping( $shipping_cost, $product ); | |
} | |
function kuantokusta_variation_free_shipping( $shipping_cost, $product, $variation ) { | |
return kuantokusta_free_shipping( $shipping_cost, $variation ); | |
} | |
function kuantokusta_free_shipping( $shipping_cost, $product_or_variation ) { |
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 | |
/* Increase DPD Portugal API timeout */ | |
add_filter( 'woo_dpd_portugal_webservice_timeout', function( $seconds ) { | |
return 60; | |
} ); |
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_ifthenpay_mbway_convertmb_expired_orders_email_subject', function( $subject, $order ) { | |
return 'Enc. #' . $order->get_id() . ' - Última oportunidade para efetuares o pagamento!'; | |
}, 10, 2 ); |
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 | |
// Filter name: swcbcf_validate_callback_{location}_{field-slug} | |
// {location} can be contact, address or order | |
// {field-slug} is the field slug | |
// In this example we're validating a field that needs to be at least 5 chars long | |
add_filter( 'swcbcf_validate_callback_' . 'order' . '_' . 'how-did-you-get-to-know', function( $return, $value, $field ) { | |
if ( strlen( trim( $value ) ) < 5 ) { | |
return 'This field needs to be at least 5 characters long'; | |
} |
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 | |
/** | |
* Usage example for the "Simple Custom Fields for WooCommerce Blocks Checkout" plugin helper functions | |
* Get it at https://ptwooplugins.com/product/simple-custom-fields-for-woocommerce-blocks-checkout/ | |
*/ | |
// Get "fiscal-number" field from the "Contact information" section, on orders and users | |
$value = swcbcf_get_order_field( $order_id, 'other', 'fiscal-number' ); | |
$value = swcbcf_get_user_field( $user_id, 'other', 'fiscal-number' ); |
NewerOlder