How to customize Shipping Rate get quote template
To customize the Shipping Rate Get Quote template using filter hook.
Following available filters for customization:
- wpcsr_collection_form_label
- wpcsr_delivery_to_form_label
- wpcsr_country_label
- wpcsr_package_type_form_label
- wpcsr_enter_parcel_form_label
- wpcsr_qty_label
- wpcsr_weight_label
- wpcsr_length_label
- wpcsr_width_label
- wpcsr_height_label
- wpcsr_quote_book_label
- wpcsr_read_more_label
- wpcsr_including_insurance_label
- wpcsr_without_insurance_label
Sample Code:
// Note: Add this code to your theme functions.php file // This sample code to change the "Collection Form" to "Origin" Text function my_custom_origin_text(){ return __('Origin', 'text-domain'); } add_filter( 'wpcsr_collection_form_label', 'my_custom_origin_text' );
See this image for the filter location in the template
To customize the Shipping Rate Get Quote result template using filter hook.
Following available filters for customization:
- wpcsr_shipment_rate_label
- wpcsr_total_label
- wpcsr_shipment_rate_details_label
- wpcsr_payment_details_label
- wpcsr_service_label
- wpcsr_type_label
- wpcsr_description_label
- wpcsr_zone_label
- wpcsr_origin_label
- wpcsr_destination_label
- wpcsr_weight_label
- wpcsr_rate_label
- wpcsr_including_insurance_label
- wpcsr_tax_label
- wpcsr_shipper_information_label
- wpcsr_receiver_information_label
- wpcsr_shipment_information_label
- wpcsr_delivery_method
- wpcsr_dropoff_warehouse_address_label
- wpcsr_phone_form_label
- wpcsr_address1_label
- wpcsr_address2_label
- wpcsr_city_label
- wpcsr_postcode_zip_label
- wpcsr_country_label
- wpcsr_state_county_label
- wpcsr_parcel_details_label
- wpcsr_parcel_subcharges_notice
- wpcsr_protection_covered_header
- wpcsr_submit_order_label
Sample Code:
// Note: Add this code to your theme functions.php file // This sample code to change the "Shipping Rate Details" to "Rate Details" Text function my_custom_rate_details_text(){ return __('Rate Details', 'text-domain'); } add_filter( 'wpcsr_shipment_rate_details_label', 'my_custom_rate_details_text' );
See this image for the filter location in the template
Modify “Can’t find rate from your query.” message.
function wpccustom_wpcsr_no_found_query_label_callback(){ return "My Custom Message."; } add_filter("wpcsr_no_found_query_label", "wpccustom_wpcsr_no_found_query_label_callback");