Plugin Directory

Changeset 2469231


Ignore:
Timestamp:
02/05/2021 01:00:29 AM (5 years ago)
Author:
theritesites
Message:

2.1.3 bug fixes and bumps

Location:
enhanced-ajax-add-to-cart-for-woocommerce
Files:
83 added
3 edited

Legend:

Unmodified
Added
Removed
  • enhanced-ajax-add-to-cart-for-woocommerce/trunk/README.txt

    r2463053 r2469231  
    205205
    206206== Changelog ==
     207
     208= 2.1.3 =
     209* Fixed: Extra checks during Attribute Title generation had namespacing failure.
    207210
    208211= 2.1.2 =
  • enhanced-ajax-add-to-cart-for-woocommerce/trunk/enhanced-ajax-add-to-cart-wc.php

    r2463053 r2469231  
    1212 * Plugin URI:        https://www.theritesites.com/plugins/enhanced-ajax-add-to-cart-wc
    1313 * Description:       Creates a shortcode or block for you to be able to add an AJAX button with an associated quantity for you WooCommerce Product
    14  * Version:           2.1.2
     14 * Version:           2.1.3
    1515 * Author:            TheRiteSites
    1616 * Author URI:        https://www.theritesites.com
     
    1919 * Text Domain:       enhanced-ajax-add-to-cart-wc
    2020 * Domain Path:       /languages
    21  * WC tested up to: 4.9
     21 * WC tested up to: 5.0
    2222 * WC requires at least: 3.0
    2323 */
     
    3535 * Current plugin version.
    3636 */
    37 defined( 'ENHANCED_AJAX_ADD_TO_CART' ) || define( 'ENHANCED_AJAX_ADD_TO_CART', '2.1.2' );
     37defined( 'ENHANCED_AJAX_ADD_TO_CART' ) || define( 'ENHANCED_AJAX_ADD_TO_CART', '2.1.3' );
    3838defined( 'EAA2C_PLUGIN_FILE' ) || define( 'EAA2C_PLUGIN_FILE', __FILE__ );
    3939
  • enhanced-ajax-add-to-cart-for-woocommerce/trunk/src/abstract-eaa2c-button.php

    r2463053 r2469231  
    8383        public function get_att_title( $product_variation = null ) {
    8484            $att_title = array();
    85             if ( $product_variation instanceof WC_Product ) {
     85            if ( $product_variation instanceof \WC_Product ) {
    8686                foreach ( $product_variation->get_attributes() as $key => $attribute ) {
    8787                    $termTitle = $attribute;
     
    9696                    } elseif ( is_string( $termTitle ) ) {
    9797                        $att_title[] = $termTitle;
     98                    } elseif ( is_array( $termTitle ) ) {
     99                        $att_title[] = implode( ', ', $termTitle );
    98100                    } else {
    99101                        if ( EAA2C_DEBUG ) {
     
    111113            $att_title = implode( ', ', $att_title );
    112114            return $att_title;
     115
     116            // $titleDisplay = $product->get_name();
     117            // if ( ! is_null( $variation ) && $variation !== false ) {
     118
     119            //  $att_title = array();
     120            //  foreach ( $variation->get_attributes() as $key => $attribute ) {
     121            //      $termTitle = $attribute;
     122            //      if ( taxonomy_exists( $key ) ) {
     123            //          $term = get_term_by( 'slug', $attribute, $key );
     124            //          if ( ! is_wp_error( $term ) && ! empty( $term->name ) ) {
     125            //              $termTitle = $term->name;
     126            //          }
     127            //      }
     128            //      $att_title[] = $termTitle;
     129            //  }
     130            //  $att_title = implode( ', ', $att_title );
     131
     132            //  if ( strcmp( $titleType, 'full' ) === 0 ) {
     133            //      // In this scenario, we need to add the attribute title to the "full" title.
     134            //      // This is due to the fact that product and variation are provided, and the
     135            //      // above $product->get_name() only gets the "base" name
     136            //      if ( ! empty( $att_title ) ) {
     137            //          $titleDisplay .= ' - ' . $att_title;
     138            //      }
     139            //  }
     140            //  elseif ( strcmp( $titleType, 'att' ) === 0 ) {
     141            //      $titleDisplay = array();
     142            //      if ( $variation instanceof \WC_Product ) {
     143            //          $titleDisplay = $att_title;
     144            //      }
     145            //  }
     146            // } else {
     147            //  $att_title = array();
     148            //  foreach ( $product->get_attributes() as $key => $attribute ) {
     149            //      // For product specific attributes, there is no "taxonomy" - treat it as default
     150            //      $termTitle = $attribute;
     151            //      if ( taxonomy_exists( $key ) ) {
     152            //          // For global attributes, we need to do some magic to get the title
     153            //          $term = get_term_by( 'slug', $attribute, $key );
     154            //          if ( ! is_wp_error( $term ) && ! empty( $term->name ) ) {
     155            //              $termTitle = $term->name;
     156            //          }
     157            //      }
     158            //      $att_title[] = $termTitle;
     159            //  }
     160            //  $att_title = implode( ', ', $att_title );
     161            //  if ( strcmp( $titleType, 'base' ) === 0 ) {
     162            //      // In this scenario, we need to remove the attribute title from the "full" title.
     163            //      // This is due to the fact that ponly the product is provided, and the
     164            //      // above $product->get_name() gets the "full" name
     165            //      $titleDisplay = $product->get_title();
     166            //  }
     167            //  elseif ( strcmp( $titleType, 'att' ) === 0 ) {
     168            //      $titleDisplay = $att_title;
     169            //  }
     170            // }
    113171        }
    114172
     
    211269
    212270                        $priceDisplay = wc_price( $product->get_price() );
    213                         if ( $contentVisibility[ 'button' ] === true ) {
     271                        if ( $contentVisibility[ 'title' ] === true ) {
    214272                            $titleDisplay = $product->get_name();
    215273                            if ( ! is_null( $variation ) && $variation !== false ) {
Note: See TracChangeset for help on using the changeset viewer.