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
<?php | |
/** | |
* Automatically issue proforma invoice when order is on-hold (newly created). | |
* https://invoicewoo.com/ | |
* https://nakedcatplugins.com/product/invoicing-with-invoicexpress-for-woocommerce-pro/ | |
*/ | |
add_action( | |
// When the order is created via the checkout | |
'woocommerce_order_status_on-hold', | |
function( $order_id ) { |
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
<?php | |
/** | |
* Add custom product taxonomies or attributes as conditional rules in Simple Checkout Fields Manager for WooCommerce | |
* https://nakedcatplugins.com/product/simple-custom-fields-for-woocommerce-blocks-checkout/ | |
*/ | |
// Example - Add "color" attribute | |
add_filter( 'swcbcf_conditional_cart_product_taxonomies', function( $taxonomies ) { | |
$taxonomies[ 'pa_color' ] = 'Color'; |
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
<?php | |
// For all post types | |
add_filter( 'relevanssi_index_content', '__return_false' ); | |
// For some post types | |
add_filter( 'relevanssi_post_content', function( $post_content, $post_object ) { | |
if ( in_array( $post_object->post_type, array( 'post', 'other_cpt' ) ) ) { | |
return ''; | |
} | |
return $post_content; |
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
<?php | |
// Just return any color you want in a format supported by CSS | |
add_filter( | |
'nakedcatplugins_lang_attr_highlight_color', | |
function () { | |
return 'rgba(0, 150, 255, 0.8)'; // Blue instead of red | |
} | |
); |
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
<?php | |
add_filter( | |
'shop_as_client_autocomplete_user_label', | |
function ( $label, $user_id, $display_name, $user_email ) { | |
// Get the user | |
$user = get_user( $user_id ); | |
$name_to_display = html_entity_decode( $user->display_name, ENT_QUOTES, 'UTF-8' ); | |
// Use same label but with $name_to_display as the name | |
return sprintf( | |
__( 'Cust. #%1$d: %2$s - %3$s', 'shop-as-client-pro' ), |
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
<?php | |
/** | |
* Plugin Name: Shop as Client for WooCommerce - Fix field priority | |
* Description: Fix the field priority if messed up by another plugin | |
* Version: 1.0 | |
* Author: PT Woo Plugins (by Webdados) | |
* Author URI: https://ptwooplugins.com/ | |
* Requires at least: 5.8 | |
* Tested up to: 6.8 | |
* Requires PHP: 7.4 |
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
<?php | |
// Example 1 | |
// Do not adjust any KuantoKusta price for products belonging to categories 90 and 333 | |
add_filter( 'kuantokusta_adjust_product_regular_price', 'my_kk_adjust_price_filter', 10, 2 ); | |
add_filter( 'kuantokusta_adjust_product_current_price', 'my_kk_adjust_price_filter', 10, 2 ); | |
add_filter( 'kuantokusta_adjust_variation_regular_price', 'my_kk_adjust_price_filter', 10, 2 ); | |
add_filter( 'kuantokusta_adjust_variation_current_price', 'my_kk_adjust_price_filter', 10, 2 ); | |
function my_kk_adjust_price_filter( $price, $product ) { | |
$categories_not_to_adjust_price = array( | |
90, |
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
<?php | |
// For ifthenpay Gateway use gateway_ifthen_blocks_payment_method_data | |
add_filter( | |
'gateway_ifthen_blocks_payment_method_data', | |
function ( $payment_method_data ) { | |
$payment_method_data['icon'] = '/whatever/path/apple-google-pix.svg'; | |
$payment_method_data['icon_width'] = 78; | |
$payment_method_data['icon_height'] = 24; | |
return $payment_method_data; | |
} |
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
<?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 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
<?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 ) { |
NewerOlder