Support » Plugin: Easy Digital Downloads » edd custom field problem after new update 2.7.3

  • Resolved jaboli

    (@jaboli)


    Hi.i’m using custom field for edd and it works before i updated EDD to 2.7.3 now information from custom field wont send to me!!!!

Viewing 15 replies - 1 through 15 (of 22 total)
  • Plugin Contributor sdavis2702

    (@sdavis2702)

    Did you create the custom field yourself or are you using our Checkout Fields Manager extension?

    If the latter, please go ahead and open up a ticket on our website. https://easydigitaldownloads.com/support/ Otherwise, I’ll need to know exactly how you created the custom field.

    no i created myself and put in functions.php file and it worked before i update to 2.7.3

    
    <?php
    /**
     * Display phone number field at checkout
     * Add more here if you need to
     */
    function sumobi_edd_display_checkout_fields() {
    ?>
     <p id="edd-phone-wrap">
     <label class="edd-label" for="edd-phone">
     <?php echo 'Contact Number'; ?>
     </label>
     <span class="edd-description">
     <?php echo 'Enter your phone number so we can get in touch with you.'; ?>
     </span>
     <input class="edd-input" type="text" name="edd_phone" id="edd-phone" placeholder="<?php echo 'Contact Number'; ?>" />
     </p>
     <?php
    }
    add_action( 'edd_purchase_form_user_info', 'sumobi_edd_display_checkout_fields' );
     
    /**
     * Make phone number required
     * Add more required fields here if you need to
     */
    function sumobi_edd_required_checkout_fields( $required_fields ) {
     $required_fields = array(
     'edd_phone' => array(
     'error_id' => 'invalid_phone',
     'error_message' => 'Please enter a valid Phone number'
     ),
     );
     return $required_fields;
    }
    add_filter( 'edd_purchase_form_required_fields', 'sumobi_edd_required_checkout_fields' );
     
    /**
     * Set error if phone number field is empty
     * You can do additional error checking here if required
     */
    function sumobi_edd_validate_checkout_fields( $valid_data, $data ) {
     if ( empty( $data['edd_phone'] ) ) {
     edd_set_error( 'invalid_phone', 'Please enter your phone number.' );
     }
    }
    add_action( 'edd_checkout_error_checks', 'sumobi_edd_validate_checkout_fields', ۱۰, ۲ );
    /**
     * Store the custom field data into EDD's payment meta
     */
    function sumobi_edd_store_custom_fields( $payment_meta ) {
     $payment_meta['phone'] = isset( $_POST['edd_phone'] ) ? sanitize_text_field( $_POST['edd_phone'] ) : '';
     
     return $payment_meta;
    }
    add_filter( 'edd_payment_meta', 'sumobi_edd_store_custom_fields');
    /**
     * Add the phone number to the "View Order Details" page
     */
    function sumobi_edd_view_order_details( $payment_meta, $user_info ) {
     $phone = isset( $payment_meta['phone'] ) ? $payment_meta['phone'] : 'none';
    ?>
     <div class="column-container">
     <div class="column">
     <strong><?php echo 'Phone: '; ?></strong>
     <?php echo $phone; ?>
     </div>
     </div>
    <?php
    }
    add_action( 'edd_payment_personal_details_list', 'sumobi_edd_view_order_details', ۱۰, ۲ );
    /**
     * Add a {phone} tag for use in either the purchase receipt email or admin notification emails
     */
    edd_add_email_tag( 'phone', 'Customer\'s phone number', 'sumobi_edd_email_tag_phone' );
    /**
     * The {phone} email tag
     */
    function sumobi_edd_email_tag_phone( $payment_id ) {
     $payment_data = edd_get_payment_meta( $payment_id );
     return $payment_data['phone'];
    }
    ?>
    Plugin Contributor sdavis2702

    (@sdavis2702)

    Hi @jaboli,

    You should be using a bit more code than that. Is there more?

    If you followed this tutorial, everything should still work properly.

    If you are using more code than what you pasted above, I need to see it please.

    <?php
    function sumobi_edd_display_checkout_fields() {
    ?>
     <p id="edd-phone-wrap">
     <label class="edd-label" for="edd-phone">
     <?php echo 'اطلاعات پستي (فقط جهت خريد پستي پکيج هاي آموزشي)'; ?>
     </label>
     <span class="edd-description">
     <?php echo 'جهت سفارش پکيج آموزشي لطفا آدرس کامل، شماره تماس و کد پستي خود را وارد نماييد'; ?>
     </span>
     <input class="edd-input" type="textarea" style="height:200px;" name="edd_phone" id="edd-phone" placeholder="<?php echo 'اطلاعات دقيق پستي'; ?>" />
     </p>
     <?php
    }
    add_action( 'edd_purchase_form_user_info', 'sumobi_edd_display_checkout_fields' ); 
    /**
     * Store the custom field data into EDD's payment meta
     */
    function sumobi_edd_store_custom_fields( $payment_meta ) {
     $payment_meta['phone'] = isset( $_POST['edd_phone'] ) ? sanitize_text_field( $_POST['edd_phone'] ) : '';
     return $payment_meta;
    }
    add_filter( 'edd_payment_meta', 'sumobi_edd_store_custom_fields');
    /**
     * Add the phone number to the "View Order Details" page
     */
    function sumobi_edd_view_order_details( $payment_meta, $user_info ) {
     $phone = isset( $payment_meta['phone'] ) ? $payment_meta['phone'] : 'none';
    ?>
     <div class="column-container">
     <div class="column">
     <strong><?php echo 'اطلاعات پستي :'; ?></strong>
     <?php echo $phone; ?>
     </div>
     </div>
    <?php
    }
    add_action( 'edd_payment_personal_details_list', 'sumobi_edd_view_order_details', 10, 2 );
    /**
     * Add a {phone} tag for use in either the purchase receipt email or admin notification emails
     */
    edd_add_email_tag( 'phone', 'اطلاعات پستي', 'sumobi_edd_email_tag_phone' );
    /**
     * The {phone} email tag
     */
    function sumobi_edd_email_tag_phone( $payment_id ) {
     $payment_data = edd_get_payment_meta( $payment_id );
     return $payment_data['phone'];
    }
    function edd_rial_currency( $formatted, $currency, $price ) {
    if ( ! is_admin() ) {
    $price = @str_replace( edd_get_option( 'thousands_separator', ',' ) , '', $price );
    $price = @$price / 10;
    return $price . ' تومان';
    }
    else
    return $price . ' ريال'; 
    }
    add_filter( 'edd_rial_currency_filter_after', 'edd_rial_currency', 10, 3 );
    add_filter( 'edd_rial_currency_filter_before', 'edd_rial_currency', 10, 3 );
    function pw_edd_purchase_form_required_fields( $required_fields ) {
        $required_fields['edd_last'] = array(   
            'error_id' => 'invalid_last_name',
            'error_message' => __( 'لطفا شماره موبایل خود را جهت پشتیبانی هرچه بهتر وارد نمایید', 'edd' )
        );
        return $required_fields;
    }
    add_filter( 'edd_purchase_form_required_fields', 'pw_edd_purchase_form_required_fields' );
    ?>
    Plugin Contributor sdavis2702

    (@sdavis2702)

    Hi @jaboli,

    I copied your code and changed nothing but some of the text that I could not read. Everything is working fine for me on EDD 2.7.4:

    Checkout: https://cl.ly/3h3d3T2S220c
    Email template: https://cl.ly/1i3v2y293H2a
    Email: https://cl.ly/1v2R1m1k2a0R

    What do you mean when you say it won’t send to you? Is the email tag not working is the email itself not being sent?

    when a customer fill all field including custom field i cant see any output from this field in panel edd reports

    I have same problem. I tested it. when customer going Bank pages for pay, I check detail product page. Product detail including custom field values but when customer paid and go back to site the custom field values going to be empty.

    Plugin Contributor sdavis2702

    (@sdavis2702)

    Hi @jaboli,

    Where did you see it before the update? Please show me a screenshot. I need you to share all relevant information so I can assist you in determining if there is actually a problem or not.

    http://s6.uplod.ir/i/00866/c8mjtd0e1pca.png
    http://s6.uplod.ir/i/00866/2bfp7hgsb001.png
    check these images

    • This reply was modified 9 months, 3 weeks ago by  jaboli.
    Plugin Contributor sdavis2702

    (@sdavis2702)

    @jaboli Can you go to Downloads -> Tools -> System Info and provide that information for me?

    Do you know exactly what version you updated from?

    ### Begin System Info ###
    
    -- Site Info
    
    Site URL:                 http://www.talarwp.com
    Home URL:                 http://www.talarwp.com
    Multisite:                No
    
    -- Hosting Provider
    
    Host:                     DBH: localhost, SRV: www.talarwp.com
    
    -- User Browser
    
    Platform:                 Windows 
    Browser Name:             Chrome  
    Browser Version:          56.0.2924.87 
    User Agent String:        Mozilla/5.0 (Windows NT 10.0; Wi 
    			  n64; x64) AppleWebKit/537.36 (KH
                              TML, like Gecko) Chrome/56.0.292
                              4.87 Safari/537.36
                              
    -- WordPress Configuration
    
    Version:                  4.7.2
    Language:                 en_US
    Permalink Structure:      /%postname%/
    Active Theme:              
    Show On Front:            posts
    ABSPATH:                  /home/agahiir2/domains/talarwp.com/public_html/
    Remote Post:              wp_remote_post() works
    Table Prefix:             Length: 3   Status: Acceptable
    WP_DEBUG:                 Disabled
    Memory Limit:             40M
    Registered Post Stati:    publish, future, draft, pending, private, trash, auto-draft, inherit, refunded, failed, revoked, abandoned, processing, active, inactive
    
    -- EDD Configuration
    
    Version:                  2.7.4
    Upgraded From:            2.4.9
    Test Mode:                Disabled
    AJAX:                     Enabled
    Guest Checkout:           Enabled
    Symlinks:                 Disabled
    Download Method:          Direct
    Currency Code:            RIAL
    Currency Position:        after
    Decimal Separator:        .
    Thousands Separator:      ,
    Upgrades Completed:       upgrade_payment_taxes,remove_refunded_sale_logs,upgrade_customer_payments_association,upgrade_user_api_keys
    
    -- EDD Page Configuration
    
    Checkout:                 Valid
    Checkout Page:            http://www.talarwp.com/%d9%be%d8%b1%d8%af%d8%a7%d8%ae%d8%aa/
    Success Page:             http://www.talarwp.com/%d8%aa%d8%a3%db%8c%db%8c%d8%af-%d9%be%d8%b1%d8%af%d8%a7%d8%ae%d8%aa/
    Failure Page:             http://www.talarwp.com/%d9%be%d8%b1%d8%af%d8%a7%d8%ae%d8%aa/%d8%aa%d8%b1%d8%a7%da%a9%d9%86%d8%b4-%d9%86%d8%a7%d9%85%d9%88%d9%81%d9%82/
    Downloads Slug:           /downloads
    
    -- EDD Gateway Configuration
    
    Enabled Gateways:         آرین‌پال, Irankish
    Default Gateway:          Irankish
    
    -- EDD Tax Configuration
    
    Taxes:                    Disabled
    Tax Rate:                 0
    Display On Checkout:      Not Displayed
    Prices Include Tax:       No
    
    -- WordPress Active Plugins
    
    Akismet Anti-Spam: 3.3
    Aparat for WordPress: 1.5
    arianpal for EDD: 1.7
    Captcha by BestWebSoft: 4.2.8
    Commentator - shared on wplocker.com: 2.7.0
    Contact Form 7: 4.6.1
    Contact Form 7 Simple Recaptcha: 0.0.1
    Crayon Syntax Highlighter: 2.8.4
    Demo Bar: 1.0.1
    Easy Digital Downloads: 2.7.4
    Easy Digital Downloads - Auto Register: 1.3.8
    Easy Digital Downloads - Hide Download: 1.2.8
    Easy Pricing Tables by Fatcat Apps: 2.3.6
    Easy Responsive Shortcodes: 1.0.1
    Export emails: 1.3.1
    Imagify: 1.6.3
    Inline Related Posts: 2.2.0
    Instagram Auto Poster: 2.0.2
    Irankish Payment Plugin for EDD: 1.0
    Lockdown WP Admin: 2.3.2
    MailPoet Newsletters: 2.7.7
    SEO Friendly Images: 3.0.5
    Theme Preview: 1.4
    TinyMCE Advanced: 4.4.3
    Uniplace php-client installer: 0.4.1a
    UserPro: 4.9.1
    wp-jalali: 5.0.1
    WP-PageNavi: 2.91
    WP landa support: 4.3
    WP Menu Cart: 2.5.8
    WP Rocket: 2.9.5
    WP Show IDs: 110709
    WP Statistics: 12.0
    Yoast SEO: 4.3
    همکاری در فروش: 1.6.5
    
    -- WordPress Inactive Plugins
    
    Hello Dolly: 1.6
    
    -- Webserver Configuration
    
    PHP Version:              5.4.45
    MySQL Version:            5.6.33
    Webserver Info:           LiteSpeed
    
    -- PHP Configuration
    
    Safe Mode:                Disabled
    Memory Limit:             256M
    Upload Max Size:          128M
    Post Max Size:            128M
    Upload Max Filesize:      128M
    Time Limit:               30
    Max Input Vars:           1000
    Display Errors:           N/A
    PHP Arg Separator:        &
    
    -- PHP Extensions
    
    cURL:                     Supported
    fsockopen:                Supported
    SOAP Client:              Installed
    Suhosin:                  Not Installed
    
    -- Session Configuration
    
    EDD Use Sessions:         Enabled
    Session:                  Enabled
    Session Name:             PHPSESSID
    Cookie Path:              /
    Save Path:                
    Use Cookies:              On
    Use Only Cookies:         On
    
    ### End System Info ###

    Hi, I submitted this problem as a new issue in easydiditaldownloads github

    Plugin Contributor sdavis2702

    (@sdavis2702)

    Thanks @jaboli and @csmasoudi.

    I still can’t replicate this issue but I’ve trying to see if anyone on our team can replicate.

    @jaboli, did you update from 2.4.9 directly to 2.7.4? Can you please confirm that for me?

    Plugin Contributor sdavis2702

    (@sdavis2702)

    @jaboli @csmasoudi

    Both of you please temporarily deactivate all plugins besides EDD on your site and test the functionality once more. Please let me know the results. Be sure to deactivate them all. The test is pointless if you leave anything other than EDD activated.

    i don’t think so this issue related to another plugins as i told you it worked before update to 2.7.4

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘edd custom field problem after new update 2.7.3’ is closed to new replies.