Home Forums WoodMart support forum Function problem

Function problem

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #261523

    [email protected]
    Participant

    Hi,

    I’m trying to add this function to my single-product.php. I’ve confirmed with the plugin developer and the code should be working. It’s working with other themes but not Woodmart. Please let me know if there are some particularities related to this code with your theme.

    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='paybright' type='text/javascript' src='https://app.paybright.com/api/pb_woocommerce.js?public_key=dP1CxWyuxWwqDxB4nQkDyqkB1JRV7yuMGUCcRvk1pRGnGInmkQ&financedamount=$$pb_product_format'></script>
    		 
    		<div id='paybright-widget-container'></div>";
    		}
    		 
    		add_action( 'woocommerce_after_add_to_cart_form', 'pb_modal', 1);
    #261524

    [email protected]
    Participant

    You can also refer to dis doccumentation:

    #261525

    [email protected]
    Participant
    #261748

    Hello,

    Our dev team has tested the code and it works correctly. You could insert it incorrectly, insert it in the functions.php of the child theme and make sure the child theme is active.

    Best Regards

Viewing 4 posts - 1 through 4 (of 4 total)