Skip to content

Commit

Permalink
Update Product
Browse files Browse the repository at this point in the history
  • Loading branch information
kawsarahmedr committed Jul 27, 2024
1 parent 013211d commit c6adedc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions includes/Frontend/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ public static function add_to_cart_redirect( $url ) {
*/
public static function add_cart_item( $item ) {
wp_verify_nonce( '_wpnonce' );

if ( 'donation' === $item['data']->get_type() ) {
if ( isset( $_POST['donation_amount'] ) && is_numeric( $_POST['donation_amount'] ) && $_POST['donation_amount'] >= 0 ) {
$item['donation_amount'] = floatval( wp_unslash( $_POST['donation_amount'] ) );
Expand Down

0 comments on commit c6adedc

Please sign in to comment.