Plugin Directory

Changeset 2024971


Ignore:
Timestamp:
02/05/2019 03:06:45 AM (7 years ago)
Author:
chadacus
Message:

Corrected POST command to pass TotalAmount as float. Corrected typo in admin page code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • parvenu/trunk/parvenu.php

    r2020171 r2024971  
    7777    if ( !$parvenu_retailer_info ){
    7878       $store_admin = get_user_by('id', 1);
    79        $daily_status = array(
     79       $parvenu_retailer_info = array(
    8080            'first_name'   => get_user_meta( 1, 'billing_first_name', true ) ? get_user_meta( 1, 'billing_first_name', true ) : '',
    8181            'last_name'    => get_user_meta( 1, 'billing_last_name', true ) ? get_user_meta( 1, 'billing_last_name', true ) : '',
     
    376376add_action( 'woocommerce_payment_complete', 'woo_payment_complete_parvenu' );
    377377function woo_payment_complete_parvenu( $order_id ){
    378     $order = new WC_Order($order_id);
    379378    $order = new WC_Order( $order_id );
    380379    $items = $order->get_items();
     
    384383        $product = wc_get_product( $item['product_id'] );
    385384        $product_price = ($item['qty']) * ($product->get_price());
    386         $donation_amt = get_woocommerce_currency_symbol(). $product_price;
    387385
    388386        if (get_post_meta( $item['product_id'], 'charity_id', true )) {
     
    403401                    'BillingZip'               =>    ( !empty( $retailer_info['zip'] ) ) ? $retailer_info['zip'] : '',
    404402                    'CharityName'      =>    ( !empty( $product->get_name() ) ) ? $product->get_name() : '',
    405                     'TotalAmount'   => $donation_amt,   
     403                    'CurrencySymbol'   => get_woocommerce_currency_symbol(),   
     404                    'TotalAmount'      => (float)$product_price, 
    406405                    'Time'              =>  gmdate("Y-m-d H:i:s")
    407406                )
Note: See TracChangeset for help on using the changeset viewer.