Feature Request: Custom Hook for Postage Cost Calculation
-
Hi there,
I recently updated to version 5.0.6 of the WordPress Simple PayPal Shopping Cart plugin and am pleased with the improvements.
I have a feature request that I believe would enhance the plugin’s flexibility: Could you consider adding a custom hook in the
calculate_cart_totals_and_postage()
function? This would allow users to implement their own postal cost calculation routines.Adding this hook would significantly increase the customization options available, making the plugin more versatile for various use cases. The hook could look like that:
/**
* Custom hook to allow modification of the postage cost.
*
* This filter allows developers to provide their own custom postage cost calculation routine.
* It gives access to theWSPSC_Cart
class instance which can be used for additional context
* or logic when calculating the postage cost.
*
* @since 5.0.7
*
* @param float $postage_cost The default postage cost calculated by the plugin.
* @param WSPSC_Cart $this The instance of theWSPSC_Cart
class, providing
* context and additional methods/properties if needed.
* @return float The modified postage cost.
*/
$postage_cost = apply_filters('wspsc_custom_postage_cost', $postage_cost, $this);Many thanks for the good work,
regards Valentin
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.