Plugin Directory

Changeset 2262712


Ignore:
Timestamp:
03/17/2020 06:52:00 PM (6 years ago)
Author:
transact
Message:

version 4.1.1 fix donation button

Location:
transact
Files:
8 edited
7 copied

Legend:

Unmodified
Added
Removed
  • transact/tags/4.1.1/admin/controllers/transact-admin-settings-post.php

    r2246052 r2262712  
    149149        if (isset($_POST['transact_donations'])) {
    150150            update_post_meta( $post_id, 'transact_donations', 1 );
     151            // Make sure to alwaus display the donation button
     152            update_post_meta( $post_id, 'transact_display_button', self::PURCHASE_AND_SUBSCRIPTION);
    151153        } else {
    152154            update_post_meta( $post_id, 'transact_donations', 0 );
     
    297299
    298300        <?php
    299             $price_disabled = ($value[5] == 1 || $value[4] == self::ONLY_SUBSCRIBE || $value[4] == self::DISABLE) ? 'disabled' : '';
     301            $is_donation = $value[5] == 1;
     302            $price_disabled = ($value[4] == self::ONLY_SUBSCRIBE || $value[4] == self::DISABLE) ? 'disabled' : '';
    300303        ?>
    301304
     
    341344                            jQuery("#transact_display_button").attr('disabled', 'disabled');
    342345                            jQuery("#transact_redirect_after_donation").removeAttr('disabled');
    343                             jQuery("#transact_price").attr('disabled', 'disabled');
     346                            jQuery("#price_label__paid").css('display', 'none');
     347                            jQuery("#price_label__donation").css('display', 'block');
    344348                        } else {
    345349                            jQuery("#transact_display_button").removeAttr('disabled');
     
    349353                            jQuery("#transact_display_button").val() != <?php echo esc_attr(self::DISABLE); ?>) {
    350354                                // Enable price box if the purchase type is not subscription only
    351                                 jQuery("#transact_price").removeAttr('disabled');
     355                                jQuery("#price_label__paid").css('display', 'block');
     356                                jQuery("#price_label__donation").css('display', 'none');
    352357                            }
    353358                        }
     
    440445            ?>
    441446            <div class="transact_meta_label">
    442                 <label for="transact_price"><?php esc_html_e( 'Premium Price (cents)', 'transact' ); ?></label>
     447                <label id="price_label__paid" style="<?php echo $is_donation ? esc_attr( 'display: none;', 'transact' ) : '' ?>" for="transact_price">
     448                    <?php esc_html_e( 'Premium Price (cents)', 'transact' ); ?>
     449                </label>
     450                <label id="price_label__donation" style="<?php echo $is_donation ? '' : esc_attr( 'display: none;', 'transact' ) ?>" for="transact_price">
     451                    <?php esc_html_e( 'Default Donation (cents)', 'transact' ); ?>
     452                </label>
    443453            </div>
    444454            <div class="transact_meta_field">
  • transact/tags/4.1.1/frontend/assets/transact_post.js

    r2256774 r2262712  
    4141
    4242        if (transact_params.donation == 1) {
    43             getDonationTokenAjaxCall(transact_params.price, nonce_value);
     43            getDonationTokenAjaxCall(transact_params.price || 1, nonce_value);
    4444        } else {
    4545            if(document.getElementById('button_purchase_single')) {
  • transact/tags/4.1.1/frontend/controllers/transact-handle-buttons.php

    r2245834 r2262712  
    9999        $price = get_post_meta($this->post_id, 'transact_price', true );
    100100        $button = $this->print_donate_button($this->options, $number_of_words);
    101         $input = '<input type="number" name="donate" class="transact-donate_amount" id="donate_val" onchange="TransactWP.setDonateAmount()" value="'.$price.'"/>';
     101        $input = '<input type="number" name="donate" class="transact-donate_amount" id="donate_val" onchange="TransactWP.setDonateAmount()" value="'.($price ? $price : 1).'"/>';
    102102        return $input . $button;
    103103    }
  • transact/tags/4.1.1/frontend/controllers/transact-single-post.php

    r2256774 r2262712  
    685685        if (isset($options['account_valid']) && $options['account_valid'] &&
    686686            get_post_meta( $this->post_id, 'transact_item_code', true ) &&
    687             get_post_meta( $this->post_id, 'transact_price', true ) &&
    688687            ((is_single() && (get_post_type() === 'post')
    689688                || (in_array(get_post_type(), SettingsCpt::get_cpts_enable_for_transact(), true))) ||
  • transact/tags/4.1.1/readme.txt

    r2256774 r2262712  
    66Requires PHP: 5.6
    77Tested up to: 5.3.2
    8 Stable tag: 4.1.0
     8Stable tag: 4.1.1
    99License: APACHE-2.0
    1010License URI: https://www.apache.org/licenses/LICENSE-2.0
     
    8181== Changelog ==
    8282
     83= 4.1.1 =
     84* Fix for donation pages.
     85
    8386= 4.1.0 =
    8487* Google Tag manger integration
  • transact/tags/4.1.1/transact-plugin.php

    r2256774 r2262712  
    33 * Plugin Name: transact.io
    44 * Description: Integrates transact.io services into WP
    5  * Version: 4.1.0
     5 * Version: 4.1.1
    66 * Author: transact.io
    77 * Author URI: https://transact.io
  • transact/trunk/admin/controllers/transact-admin-settings-post.php

    r2246052 r2262712  
    149149        if (isset($_POST['transact_donations'])) {
    150150            update_post_meta( $post_id, 'transact_donations', 1 );
     151            // Make sure to alwaus display the donation button
     152            update_post_meta( $post_id, 'transact_display_button', self::PURCHASE_AND_SUBSCRIPTION);
    151153        } else {
    152154            update_post_meta( $post_id, 'transact_donations', 0 );
     
    297299
    298300        <?php
    299             $price_disabled = ($value[5] == 1 || $value[4] == self::ONLY_SUBSCRIBE || $value[4] == self::DISABLE) ? 'disabled' : '';
     301            $is_donation = $value[5] == 1;
     302            $price_disabled = ($value[4] == self::ONLY_SUBSCRIBE || $value[4] == self::DISABLE) ? 'disabled' : '';
    300303        ?>
    301304
     
    341344                            jQuery("#transact_display_button").attr('disabled', 'disabled');
    342345                            jQuery("#transact_redirect_after_donation").removeAttr('disabled');
    343                             jQuery("#transact_price").attr('disabled', 'disabled');
     346                            jQuery("#price_label__paid").css('display', 'none');
     347                            jQuery("#price_label__donation").css('display', 'block');
    344348                        } else {
    345349                            jQuery("#transact_display_button").removeAttr('disabled');
     
    349353                            jQuery("#transact_display_button").val() != <?php echo esc_attr(self::DISABLE); ?>) {
    350354                                // Enable price box if the purchase type is not subscription only
    351                                 jQuery("#transact_price").removeAttr('disabled');
     355                                jQuery("#price_label__paid").css('display', 'block');
     356                                jQuery("#price_label__donation").css('display', 'none');
    352357                            }
    353358                        }
     
    440445            ?>
    441446            <div class="transact_meta_label">
    442                 <label for="transact_price"><?php esc_html_e( 'Premium Price (cents)', 'transact' ); ?></label>
     447                <label id="price_label__paid" style="<?php echo $is_donation ? esc_attr( 'display: none;', 'transact' ) : '' ?>" for="transact_price">
     448                    <?php esc_html_e( 'Premium Price (cents)', 'transact' ); ?>
     449                </label>
     450                <label id="price_label__donation" style="<?php echo $is_donation ? '' : esc_attr( 'display: none;', 'transact' ) ?>" for="transact_price">
     451                    <?php esc_html_e( 'Default Donation (cents)', 'transact' ); ?>
     452                </label>
    443453            </div>
    444454            <div class="transact_meta_field">
  • transact/trunk/frontend/assets/transact_post.js

    r2256774 r2262712  
    4141
    4242        if (transact_params.donation == 1) {
    43             getDonationTokenAjaxCall(transact_params.price, nonce_value);
     43            getDonationTokenAjaxCall(transact_params.price || 1, nonce_value);
    4444        } else {
    4545            if(document.getElementById('button_purchase_single')) {
  • transact/trunk/frontend/controllers/transact-handle-buttons.php

    r2245834 r2262712  
    9999        $price = get_post_meta($this->post_id, 'transact_price', true );
    100100        $button = $this->print_donate_button($this->options, $number_of_words);
    101         $input = '<input type="number" name="donate" class="transact-donate_amount" id="donate_val" onchange="TransactWP.setDonateAmount()" value="'.$price.'"/>';
     101        $input = '<input type="number" name="donate" class="transact-donate_amount" id="donate_val" onchange="TransactWP.setDonateAmount()" value="'.($price ? $price : 1).'"/>';
    102102        return $input . $button;
    103103    }
  • transact/trunk/frontend/controllers/transact-single-post.php

    r2256774 r2262712  
    685685        if (isset($options['account_valid']) && $options['account_valid'] &&
    686686            get_post_meta( $this->post_id, 'transact_item_code', true ) &&
    687             get_post_meta( $this->post_id, 'transact_price', true ) &&
    688687            ((is_single() && (get_post_type() === 'post')
    689688                || (in_array(get_post_type(), SettingsCpt::get_cpts_enable_for_transact(), true))) ||
  • transact/trunk/readme.txt

    r2256774 r2262712  
    66Requires PHP: 5.6
    77Tested up to: 5.3.2
    8 Stable tag: 4.1.0
     8Stable tag: 4.1.1
    99License: APACHE-2.0
    1010License URI: https://www.apache.org/licenses/LICENSE-2.0
     
    8181== Changelog ==
    8282
     83= 4.1.1 =
     84* Fix for donation pages.
     85
    8386= 4.1.0 =
    8487* Google Tag manger integration
  • transact/trunk/transact-plugin.php

    r2256774 r2262712  
    33 * Plugin Name: transact.io
    44 * Description: Integrates transact.io services into WP
    5  * Version: 4.1.0
     5 * Version: 4.1.1
    66 * Author: transact.io
    77 * Author URI: https://transact.io
Note: See TracChangeset for help on using the changeset viewer.