Plugin Directory

Changeset 909583


Ignore:
Timestamp:
05/07/2014 09:55:03 AM (12 years ago)
Author:
madpixels
Message:

Fixed items removal from compare page in the tag version.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • woocommerce-compare-list/tags/1.0.0/includes/buttons.php

    r909527 r909583  
    3030add_action( 'woocommerce_before_shop_loop', 'wccm_register_add_compare_button_hook' );
    3131add_action( 'woocommerce_single_product_summary', 'wccm_add_single_product_compare_buttton', 35 );
    32 add_action( 'init', 'wccm_process_button_action' );
     32add_action( 'template_redirect', 'wccm_process_button_action' );
    3333
    3434/**
     
    100100 *
    101101 * @since 1.0.0
    102  * @action init
     102 * @action template_redirect
    103103 */
    104104function wccm_process_button_action() {
     
    114114    }
    115115
    116     wp_redirect( add_query_arg( array( 'wccm' => false, 'pid' => false, 'nonce' => false ) ) );
     116    $redirect = get_option( 'wccm_compare_page' ) == get_queried_object_id()
     117        ? wccm_get_compare_page_link( wccm_get_compare_list() )
     118        : add_query_arg( array( 'wccm' => false, 'pid' => false, 'nonce' => false ) );
     119
     120    wp_redirect( $redirect );
    117121    exit;
    118122}
Note: See TracChangeset for help on using the changeset viewer.