I am Using this custom Function to show a modal pop up that tell client the monthly price based on product price. Currently it works well, the issue is that we need the amount to be multiplied by 4. This way when it calculates it can display the correct price per month. --Ex: if price is $500.00 for set of 4 (tires) --> then monthly payments are based on 500 not 125 which is confusing customers.
Here is my code..need '_price'to be multiplied by *4
Can someone please help with solution.
function pb_modal() {
$pb_product_price = get_post_meta( get_the_ID(), '_price', true);
$pb_product_format = number_format((float)$pb_product_price, 2, '.', '');
echo "<script id='pb_prequalify' type='text/javascript' src='https://app.paybright.com/dist/sdk.js?public_key=[MY API KEY]&financedamount=$$pb_product_format'></script>";
echo "<script>
pb_prequalify_init({
triggerElement: 'link',
triggerText: 'Credit available with <br> Prequalify now',
lang: 'en',
hideTriggerLeadText: true,
noFiguresInModal: true,
});
</script>
";
echo "<div id='paybright-widget-container'></div>";
}
add_action( 'woocommerce_after_add_to_cart_form', 'pb_modal', 1);