Plugin Directory

Changeset 2428525


Ignore:
Timestamp:
11/30/2020 11:34:18 AM (4 years ago)
Author:
cmachu
Message:

Version 1.2.0 - PHP/JS fixes, tests for new versions of WP/WooCommerce

Location:
multiple-external-product-urls-for-woocommerce
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • multiple-external-product-urls-for-woocommerce/tags/1.2.0/README.txt

    r2042987 r2428525  
    11=== Multiple external product URLs for WooCommerce ===
    22Contributors: cmachu
    3 Donate link: http://cmachowski.com
    4 Tags: woocommerce, external product, woo, external, product, product url
     3Author URI: https://cmachowski.com
     4Tags: woocommerce, external product, woo, external, product, product url, woocommerce external product, multiple external products,
    55Requires at least: 3.0.1
    6 Tested up to: 5.1
    7 Stable tag: 1.1.1
    8 License: GPLv2 or later
     6Tested up to: 5.5
     7Stable tag: 1.2.0
     8License: GPLv2 or late
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     10Donate link: https://paypal.me/cmachu
    1011
    1112Plugins gives you ability to add multiple external product URLs on WooCommerce product edit page.
     
    3536== Changelog ==
    3637
     38= 1.2.0 =
     39* FIX: JS error on few WooCommerce versions
     40* FIX: PHP Fatal error on few WooCommerce versions
     41
    3742= 1.1.0 =
    3843* ADD: Ability to switch on/off displaying additional external product buttons on category loops
  • multiple-external-product-urls-for-woocommerce/tags/1.2.0/admin/class-mepu-woo-admin.php

    r1933588 r2428525  
    6363    public function enqueue_scripts()
    6464    {
    65         wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/mepu-woo-admin.js', array('jquery','woocommerce_admin'), $this->version, false);
     65        wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/mepu-woo-admin.js', array('jquery'), $this->version, false);
    6666    }
    6767
  • multiple-external-product-urls-for-woocommerce/tags/1.2.0/frontend/class-mepu-woo-frontend.php

    r2042986 r2428525  
    4646     * Initialize the class and set its properties.
    4747     *
     48     * @param string $plugin_name The name of this plugin.
     49     * @param string $version The version of this plugin.
    4850     * @since    1.0.0
    49      * @param      string $plugin_name The name of this plugin.
    50      * @param      string $version The version of this plugin.
    5151     */
    5252    public function __construct($plugin_name, $version)
     
    8686    /**
    8787     * Add multiple external buttons to loop in category
    88      * @since   1.1.0
    8988     * @param $buttons
    9089     * @param $product
    9190     * @param $args
    9291     * @return string
     92     * @since   1.1.0
    9393     */
    94     public function render_mepu_buttons_loop($buttons, $product, $args)
     94    public function render_mepu_buttons_loop($buttons, $product, $args = [])
    9595    {
    9696        if (get_post_meta($product->get_id(), '_external_show_in_cat', true) && ('external' == $product->get_type())) {
     
    118118    {
    119119        global $product;
    120         if ($product) {
    121             if ($product->get_type() == 'external') {
    122                 $mepu_data = get_post_meta($product->get_id(), '_external_target_blank', true);
    123                 if ($mepu_data) {
    124                     ?>
    125                     <script>
    126                         if (jQuery('.cart')) {
    127                             jQuery('.cart').attr('target', '_blank');
    128                         }
    129                     </script>
    130                     <?php
    131                 }
     120        if ($product && $product->get_type() == 'external') {
     121            $mepu_data = get_post_meta($product->get_id(), '_external_target_blank', true);
     122            if ($mepu_data) {
     123                ?>
     124                <script>
     125                    if (jQuery('.cart')) {
     126                        jQuery('.cart').attr('target', '_blank');
     127                    }
     128                </script>
     129                <?php
    132130            }
    133131        }
     132
    134133    }
    135134
    136135    /**
    137136     * Adjust external product buttons on category loop
    138      * @since   1.1.0
    139137     * @param $args
    140138     * @param $product
    141139     * @return mixed
     140     * @since   1.1.0
    142141     */
    143142    public function adjust_cart_form_details_loop($args, $product)
    144143    {
    145         if (get_post_meta($product->get_id(), '_external_show_in_cat', true) && get_post_meta($product->get_id(), '_external_target_blank', true)) {
    146             $args['attributes']['target'] = '_blank';
     144        if(isset($args['attributes'])) {
     145            if (get_post_meta($product->get_id(), '_external_show_in_cat', true) && get_post_meta($product->get_id(), '_external_target_blank', true)) {
     146                $args['attributes']['target'] = '_blank';
     147            }
    147148        }
    148149
  • multiple-external-product-urls-for-woocommerce/tags/1.2.0/mepu-woo.php

    r2042987 r2428525  
    2828 * Rename this for your plugin and update it as you release new versions.
    2929 */
    30 define('MEPU_WOO_VERSION', '1.1.1');
     30define('MEPU_WOO_VERSION', '1.2.0');
    3131
    3232/**
  • multiple-external-product-urls-for-woocommerce/trunk/README.txt

    r2042987 r2428525  
    11=== Multiple external product URLs for WooCommerce ===
    22Contributors: cmachu
    3 Donate link: http://cmachowski.com
    4 Tags: woocommerce, external product, woo, external, product, product url
     3Author URI: https://cmachowski.com
     4Tags: woocommerce, external product, woo, external, product, product url, woocommerce external product, multiple external products,
    55Requires at least: 3.0.1
    6 Tested up to: 5.1
    7 Stable tag: 1.1.1
    8 License: GPLv2 or later
     6Tested up to: 5.5
     7Stable tag: 1.2.0
     8License: GPLv2 or late
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     10Donate link: https://paypal.me/cmachu
    1011
    1112Plugins gives you ability to add multiple external product URLs on WooCommerce product edit page.
     
    3536== Changelog ==
    3637
     38= 1.2.0 =
     39* FIX: JS error on few WooCommerce versions
     40* FIX: PHP Fatal error on few WooCommerce versions
     41
    3742= 1.1.0 =
    3843* ADD: Ability to switch on/off displaying additional external product buttons on category loops
  • multiple-external-product-urls-for-woocommerce/trunk/admin/class-mepu-woo-admin.php

    r1933588 r2428525  
    6363    public function enqueue_scripts()
    6464    {
    65         wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/mepu-woo-admin.js', array('jquery','woocommerce_admin'), $this->version, false);
     65        wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/mepu-woo-admin.js', array('jquery'), $this->version, false);
    6666    }
    6767
  • multiple-external-product-urls-for-woocommerce/trunk/frontend/class-mepu-woo-frontend.php

    r2042986 r2428525  
    4646     * Initialize the class and set its properties.
    4747     *
     48     * @param string $plugin_name The name of this plugin.
     49     * @param string $version The version of this plugin.
    4850     * @since    1.0.0
    49      * @param      string $plugin_name The name of this plugin.
    50      * @param      string $version The version of this plugin.
    5151     */
    5252    public function __construct($plugin_name, $version)
     
    8686    /**
    8787     * Add multiple external buttons to loop in category
    88      * @since   1.1.0
    8988     * @param $buttons
    9089     * @param $product
    9190     * @param $args
    9291     * @return string
     92     * @since   1.1.0
    9393     */
    94     public function render_mepu_buttons_loop($buttons, $product, $args)
     94    public function render_mepu_buttons_loop($buttons, $product, $args = [])
    9595    {
    9696        if (get_post_meta($product->get_id(), '_external_show_in_cat', true) && ('external' == $product->get_type())) {
     
    118118    {
    119119        global $product;
    120         if ($product) {
    121             if ($product->get_type() == 'external') {
    122                 $mepu_data = get_post_meta($product->get_id(), '_external_target_blank', true);
    123                 if ($mepu_data) {
    124                     ?>
    125                     <script>
    126                         if (jQuery('.cart')) {
    127                             jQuery('.cart').attr('target', '_blank');
    128                         }
    129                     </script>
    130                     <?php
    131                 }
     120        if ($product && $product->get_type() == 'external') {
     121            $mepu_data = get_post_meta($product->get_id(), '_external_target_blank', true);
     122            if ($mepu_data) {
     123                ?>
     124                <script>
     125                    if (jQuery('.cart')) {
     126                        jQuery('.cart').attr('target', '_blank');
     127                    }
     128                </script>
     129                <?php
    132130            }
    133131        }
     132
    134133    }
    135134
    136135    /**
    137136     * Adjust external product buttons on category loop
    138      * @since   1.1.0
    139137     * @param $args
    140138     * @param $product
    141139     * @return mixed
     140     * @since   1.1.0
    142141     */
    143142    public function adjust_cart_form_details_loop($args, $product)
    144143    {
    145         if (get_post_meta($product->get_id(), '_external_show_in_cat', true) && get_post_meta($product->get_id(), '_external_target_blank', true)) {
    146             $args['attributes']['target'] = '_blank';
     144        if(isset($args['attributes'])) {
     145            if (get_post_meta($product->get_id(), '_external_show_in_cat', true) && get_post_meta($product->get_id(), '_external_target_blank', true)) {
     146                $args['attributes']['target'] = '_blank';
     147            }
    147148        }
    148149
  • multiple-external-product-urls-for-woocommerce/trunk/mepu-woo.php

    r2042987 r2428525  
    2828 * Rename this for your plugin and update it as you release new versions.
    2929 */
    30 define('MEPU_WOO_VERSION', '1.1.1');
     30define('MEPU_WOO_VERSION', '1.2.0');
    3131
    3232/**
Note: See TracChangeset for help on using the changeset viewer.