Skip to content

Instantly share code, notes, and snippets.

@KeylorCR

KeylorCR/wps-filterts.php

Last active Nov 23, 2020
Embed
What would you like to do?
List of filters included in the WC Pickup Store plugin. Check for filter availability in the plugin source code.
<?php
/**
** Add new content to be displayed in the template of
** store information in the Checkout page
** v1.5.23
** author: @keylorcr
**/
function keylorcr_wps_stores_fields($the_fields) {
foreach ($the_fields as $store_id => $value) {
$the_fields[$store_id][] = array(
'key' => 'content_info',
'value' => apply_filters('the_content', get_post_field('post_content', $store_id))
);
}
return $the_fields;
}
add_filter('wps_stores_fields', 'keylorcr_wps_stores_fields');
/**
** Mapping custom fields for the Checkout template
** v1.5.22
** author: @keylorcr
**/
function kmchild_wps_get_store_custom_fields($fields) {
$fields[] = 'description';
return $fields;
}
add_filter('wps_get_store_custom_fields', 'kmchild_wps_get_store_custom_fields');
/**
** Change Shipping and Store details label
** author: @keylorcr
**/
function kmchild_wps_shipping_title($title) {
$post_data = wps_validate_ajax_request();
return 'My custom label';
}
add_filter('wps_shipping_method_label', 'kmchild_wps_shipping_title');
add_filter('wps_store_checkout_label', 'kmchild_wps_shipping_title');
/**
** Update WPS shipping costs
** author: @keylorcr
**/
function kmchild_update_wps_shipping_costs($cost) {
return 75;
}
add_filter('wps_shipping_costs', 'kmchild_update_wps_shipping_costs', 50);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment