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 these 2 lines to your wp-config.php | |
// This will lock IPs that fail checkout 5 times within 30 minutes. | |
// The default is 10 failures every 15 minutes (900 seconds). | |
define( 'PMPRO_SPAM_ACTION_NUM_LIMIT', 5 ); | |
define( 'PMPRO_SPAM_ACTION_TIME_LIMIT', 1800 ); // in seconds |
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( 'woocommerce_rest_product_object_query', 'yith_pos_extend_post_per_pages', 5, 2 ); | |
function yith_pos_extend_post_per_pages( $args, $request ){ | |
if ( isset( $_GET[ 'queryName' ] ) && 'yith_pos_search' === $_GET[ 'queryName' ] ) { | |
$args[ 'posts_per_page' ] = 20; | |
} | |
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
<?php | |
add_filter( 'woocommerce_rest_prepare_product_object', 'yith_pos_custom_product_response', 20, 3 ); | |
function yith_pos_custom_product_response( $response, $object, $request ) { | |
$param = $request->get_param( 'queryName' ); | |
if ( $param == 'yith_pos_search' ) { | |
$result = $response->data; | |
$result['name'] .= empty($result['sku']) ? '' : ' - ' . $result['sku']; | |
$response->data = $result; |
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 if ( ! function_exists( 'yith_pos_customization_order_status_to_complete' ) ) { | |
add_filter( 'woocommerce_payment_complete_order_status', 'yith_pos_customization_order_status_to_complete', 10, 3 ); | |
function yith_pos_customization_order_status_to_complete( $status, $order_id, $order ) { | |
if ( absint( $order->get_meta( '_yith_pos_order' ) ) ) { | |
$status = 'completed'; | |
} | |
return $status; | |
} |