Skip to content

Commit

Permalink
Page functions woocommerce to wc refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
coenjacobs committed Nov 25, 2013
1 parent f7df17d commit 47ae00b
Show file tree
Hide file tree
Showing 41 changed files with 121 additions and 96 deletions.
2 changes: 1 addition & 1 deletion includes/abstracts/abstract-wc-payment-gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function get_return_url( $order = '' ) {
if ( $order ) {
$return_url = $order->get_checkout_order_received_url();
} else {
$return_url = woocommerce_get_endpoint_url( 'order-received', '', get_permalink( woocommerce_get_page_id( 'checkout' ) ) );
$return_url = wc_get_endpoint_url( 'order-received', '', get_permalink( wc_get_page_id( 'checkout' ) ) );
}

if ( is_ssl() || get_option('woocommerce_force_ssl_checkout') == 'yes' ) {
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/class-wc-admin-permalink-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function settings() {
$product_permalink = $permalinks['product_base'];

// Get shop page
$shop_page_id = woocommerce_get_page_id( 'shop' );
$shop_page_id = wc_get_page_id( 'shop' );
$base_slug = ( $shop_page_id > 0 && get_page( $shop_page_id ) ) ? get_page_uri( $shop_page_id ) : _x( 'shop', 'default-slug', 'woocommerce' );
$product_base = _x( 'product', 'default-slug', 'woocommerce' );

Expand Down
2 changes: 1 addition & 1 deletion includes/admin/class-wc-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function prevent_admin_access() {
$prevent_access = apply_filters( 'woocommerce_prevent_admin_access', $prevent_access );

if ( $prevent_access ) {
wp_safe_redirect( get_permalink( woocommerce_get_page_id( 'myaccount' ) ) );
wp_safe_redirect( get_permalink( wc_get_page_id( 'myaccount' ) ) );
exit;
}
}
Expand Down
2 changes: 1 addition & 1 deletion includes/admin/settings/class-wc-settings-products.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public function get_settings( $current_section = '' ) {
} else {

// Get shop page
$shop_page_id = woocommerce_get_page_id('shop');
$shop_page_id = wc_get_page_id('shop');

$base_slug = ($shop_page_id > 0 && get_page( $shop_page_id )) ? get_page_uri( $shop_page_id ) : 'shop';

Expand Down
14 changes: 7 additions & 7 deletions includes/class-wc-cache-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@ public function __construct() {
public function init() {
if ( false === ( $wc_page_uris = get_transient( 'woocommerce_cache_excluded_uris' ) ) ) {

if ( woocommerce_get_page_id( 'cart' ) < 1 || woocommerce_get_page_id( 'checkout' ) < 1 || woocommerce_get_page_id( 'myaccount' ) < 1 )
if ( wc_get_page_id( 'cart' ) < 1 || wc_get_page_id( 'checkout' ) < 1 || wc_get_page_id( 'myaccount' ) < 1 )
return;

$wc_page_uris = array();

// Exclude querystring when using page ID
$wc_page_uris[] = 'p=' . woocommerce_get_page_id( 'cart' );
$wc_page_uris[] = 'p=' . woocommerce_get_page_id( 'checkout' );
$wc_page_uris[] = 'p=' . woocommerce_get_page_id( 'myaccount' );
$wc_page_uris[] = 'p=' . wc_get_page_id( 'cart' );
$wc_page_uris[] = 'p=' . wc_get_page_id( 'checkout' );
$wc_page_uris[] = 'p=' . wc_get_page_id( 'myaccount' );

// Exclude permalinks
$cart_page = get_post( woocommerce_get_page_id( 'cart' ) );
$checkout_page = get_post( woocommerce_get_page_id( 'checkout' ) );
$account_page = get_post( woocommerce_get_page_id( 'myaccount' ) );
$cart_page = get_post( wc_get_page_id( 'cart' ) );
$checkout_page = get_post( wc_get_page_id( 'checkout' ) );
$account_page = get_post( wc_get_page_id( 'myaccount' ) );

if ( ! is_null( $cart_page ) )
$wc_page_uris[] = '/' . $cart_page->post_name;
Expand Down
12 changes: 6 additions & 6 deletions includes/class-wc-cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ public function get_cross_sells() {
* @return string url to page
*/
public function get_cart_url() {
$cart_page_id = woocommerce_get_page_id('cart');
$cart_page_id = wc_get_page_id('cart');
if ( $cart_page_id )
return apply_filters( 'woocommerce_get_cart_url', get_permalink( $cart_page_id ) );
}
Expand All @@ -587,7 +587,7 @@ public function get_cart_url() {
* @return string url to page
*/
public function get_checkout_url() {
$checkout_page_id = woocommerce_get_page_id('checkout');
$checkout_page_id = wc_get_page_id('checkout');
$checkout_url = '';
if ( $checkout_page_id ) {
if ( is_ssl() || get_option('woocommerce_force_ssl_checkout') == 'yes' )
Expand All @@ -604,7 +604,7 @@ public function get_checkout_url() {
* @return string url to page
*/
public function get_remove_url( $cart_item_key ) {
$cart_page_id = woocommerce_get_page_id('cart');
$cart_page_id = wc_get_page_id('cart');
if ( $cart_page_id )
return apply_filters( 'woocommerce_get_remove_url', wp_nonce_url( add_query_arg( 'remove_item', $cart_item_key, get_permalink( $cart_page_id ) ), 'woocommerce-cart' ) );
}
Expand Down Expand Up @@ -794,7 +794,7 @@ public function add_to_cart( $product_id, $quantity = 1, $variation_id = '', $va

// If its greater than 0, its already in the cart
if ( $in_cart_quantity > 0 ) {
wc_add_notice( sprintf( '<a href="%s" class="button wc-forward">%s</a> %s', get_permalink( woocommerce_get_page_id( 'cart' ) ), __( 'View Cart', 'woocommerce' ), sprintf( __( 'You cannot add another &quot;%s&quot; to your cart.', 'woocommerce' ), $product_data->get_title() ) ), 'error' );
wc_add_notice( sprintf( '<a href="%s" class="button wc-forward">%s</a> %s', get_permalink( wc_get_page_id( 'cart' ) ), __( 'View Cart', 'woocommerce' ), sprintf( __( 'You cannot add another &quot;%s&quot; to your cart.', 'woocommerce' ), $product_data->get_title() ) ), 'error' );
return false;
}
}
Expand All @@ -808,15 +808,15 @@ public function add_to_cart( $product_id, $quantity = 1, $variation_id = '', $va
if ( $variation_id && $product_data->variation_has_stock ) {

if ( isset( $product_qty_in_cart[ $variation_id ] ) && ! $product_data->has_enough_stock( $product_qty_in_cart[ $variation_id ] + $quantity ) ) {
wc_add_notice( sprintf(__( '<a href="%s" class="button wc-forward">%s</a> You cannot add that amount to the cart &mdash; we have %s in stock and you already have %s in your cart.', 'woocommerce' ), get_permalink( woocommerce_get_page_id( 'cart' ) ), __( 'View Cart', 'woocommerce' ), $product_data->get_stock_quantity(), $product_qty_in_cart[ $variation_id ] ), 'error' );
wc_add_notice( sprintf(__( '<a href="%s" class="button wc-forward">%s</a> You cannot add that amount to the cart &mdash; we have %s in stock and you already have %s in your cart.', 'woocommerce' ), get_permalink( wc_get_page_id( 'cart' ) ), __( 'View Cart', 'woocommerce' ), $product_data->get_stock_quantity(), $product_qty_in_cart[ $variation_id ] ), 'error' );
return false;
}

// Products
} else {

if ( isset( $product_qty_in_cart[ $product_id ] ) && ! $product_data->has_enough_stock( $product_qty_in_cart[ $product_id ] + $quantity ) ) {
wc_add_notice( sprintf(__( '<a href="%s" class="button wc-forward">%s</a> You cannot add that amount to the cart &mdash; we have %s in stock and you already have %s in your cart.', 'woocommerce' ), get_permalink( woocommerce_get_page_id( 'cart' ) ), __( 'View Cart', 'woocommerce' ), $product_data->get_stock_quantity(), $product_qty_in_cart[ $product_id ] ), 'error' );
wc_add_notice( sprintf(__( '<a href="%s" class="button wc-forward">%s</a> You cannot add that amount to the cart &mdash; we have %s in stock and you already have %s in your cart.', 'woocommerce' ), get_permalink( wc_get_page_id( 'cart' ) ), __( 'View Cart', 'woocommerce' ), $product_data->get_stock_quantity(), $product_qty_in_cart[ $product_id ] ), 'error' );
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion includes/class-wc-checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ public function process_checkout() {
WC()->cart->calculate_totals();

// Terms
if ( ! isset( $_POST['woocommerce_checkout_update_totals'] ) && empty( $this->posted['terms'] ) && woocommerce_get_page_id( 'terms' ) > 0 )
if ( ! isset( $_POST['woocommerce_checkout_update_totals'] ) && empty( $this->posted['terms'] ) && wc_get_page_id( 'terms' ) > 0 )
wc_add_notice( __( 'You must accept our Terms &amp; Conditions.', 'woocommerce' ), 'error' );

if ( WC()->cart->needs_shipping() ) {
Expand Down
2 changes: 1 addition & 1 deletion includes/class-wc-download-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function download_product() {
if ( $user_id && get_option( 'woocommerce_downloads_require_login' ) == 'yes' ) {

if ( ! is_user_logged_in() )
wp_die( __( 'You must be logged in to download files.', 'woocommerce' ) . ' <a href="' . wp_login_url( get_permalink( woocommerce_get_page_id( 'myaccount' ) ) ) . '">' . __( 'Login &rarr;', 'woocommerce' ) . '</a>', __( 'Log in to Download Files', 'woocommerce' ) );
wp_die( __( 'You must be logged in to download files.', 'woocommerce' ) . ' <a href="' . wp_login_url( get_permalink( wc_get_page_id( 'myaccount' ) ) ) . '">' . __( 'Login &rarr;', 'woocommerce' ) . '</a>', __( 'Log in to Download Files', 'woocommerce' ) );

elseif ( !current_user_can( 'download_file', $download_result ) )
wp_die( __( 'This is not your download link.', 'woocommerce' ) );
Expand Down
14 changes: 7 additions & 7 deletions includes/class-wc-form-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function save_address() {

do_action( 'woocommerce_customer_save_address', $user_id, $load_address );

wp_safe_redirect( get_permalink( woocommerce_get_page_id('myaccount') ) );
wp_safe_redirect( get_permalink( wc_get_page_id('myaccount') ) );
exit;
}
}
Expand Down Expand Up @@ -193,7 +193,7 @@ public function save_account_details() {

do_action( 'woocommerce_save_account_details', $user->ID );

wp_safe_redirect( get_permalink( woocommerce_get_page_id( 'myaccount' ) ) );
wp_safe_redirect( get_permalink( wc_get_page_id( 'myaccount' ) ) );
exit;
}
}
Expand All @@ -205,7 +205,7 @@ public function checkout_action() {
if ( isset( $_POST['woocommerce_checkout_place_order'] ) || isset( $_POST['woocommerce_checkout_update_totals'] ) ) {

if ( sizeof( WC()->cart->get_cart() ) == 0 ) {
wp_redirect( get_permalink( woocommerce_get_page_id( 'cart' ) ) );
wp_redirect( get_permalink( wc_get_page_id( 'cart' ) ) );
exit;
}

Expand Down Expand Up @@ -479,7 +479,7 @@ public function cancel_order() {

endif;

wp_safe_redirect( get_permalink( woocommerce_get_page_id( 'myaccount' ) ) );
wp_safe_redirect( get_permalink( wc_get_page_id( 'myaccount' ) ) );
exit;

endif;
Expand Down Expand Up @@ -703,7 +703,7 @@ public function process_login() {
} elseif ( wp_get_referer() ) {
$redirect = esc_url( wp_get_referer() );
} else {
$redirect = esc_url( get_permalink( woocommerce_get_page_id( 'myaccount' ) ) );
$redirect = esc_url( get_permalink( wc_get_page_id( 'myaccount' ) ) );
}

// Feedback
Expand Down Expand Up @@ -770,7 +770,7 @@ public function process_reset_password() {

do_action( 'woocommerce_customer_reset_password', $user );

wc_add_notice( __( 'Your password has been reset.', 'woocommerce' ) . ' <a href="' . get_permalink( woocommerce_get_page_id( 'myaccount' ) ) . '">' . __( 'Log in', 'woocommerce' ) . '</a>' );
wc_add_notice( __( 'Your password has been reset.', 'woocommerce' ) . ' <a href="' . get_permalink( wc_get_page_id( 'myaccount' ) ) . '">' . __( 'Log in', 'woocommerce' ) . '</a>' );

wp_redirect( remove_query_arg( array( 'key', 'login' ) ) );
exit;
Expand Down Expand Up @@ -811,7 +811,7 @@ public function process_registration() {
if ( wp_get_referer() ) {
$redirect = esc_url( wp_get_referer() );
} else {
$redirect = esc_url( get_permalink( woocommerce_get_page_id( 'myaccount' ) ) );
$redirect = esc_url( get_permalink( wc_get_page_id( 'myaccount' ) ) );
}

wp_redirect( apply_filters( 'woocommerce_registration_redirect', $redirect ) );
Expand Down
4 changes: 2 additions & 2 deletions includes/class-wc-frontend-scripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function load_scripts() {
'apply_coupon_nonce' => wp_create_nonce( "apply-coupon" ),
'option_guest_checkout' => get_option( 'woocommerce_enable_guest_checkout' ),
'checkout_url' => add_query_arg( 'action', 'woocommerce_checkout', WC()->ajax_url() ),
'is_checkout' => is_page( woocommerce_get_page_id( 'checkout' ) ) && empty( $wp->query_vars['order-pay'] ) && ! isset( $wp->query_vars['order-received'] ) ? 1 : 0,
'is_checkout' => is_page( wc_get_page_id( 'checkout' ) ) && empty( $wp->query_vars['order-pay'] ) && ! isset( $wp->query_vars['order-received'] ) ? 1 : 0,
'locale' => json_encode( WC()->countries->get_country_locale() )
) ) );

Expand All @@ -137,7 +137,7 @@ public function load_scripts() {
'ajax_url' => WC()->ajax_url(),
'ajax_loader_url' => apply_filters( 'woocommerce_ajax_loader_url', $assets_path . 'images/ajax-loader@2x.gif' ),
'i18n_view_cart' => esc_attr__( 'View Cart', 'woocommerce' ),
'cart_url' => get_permalink( woocommerce_get_page_id( 'cart' ) ),
'cart_url' => get_permalink( wc_get_page_id( 'cart' ) ),
'is_cart' => is_cart(),
'cart_redirect_after_add' => get_option( 'woocommerce_cart_redirect_after_add' )
) ) );
Expand Down
4 changes: 2 additions & 2 deletions includes/class-wc-install.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function install() {
update_option( 'woocommerce_version', WC()->version );

// Check if pages are needed
if ( woocommerce_get_page_id( 'shop' ) < 1 )
if ( wc_get_page_id( 'shop' ) < 1 )
update_option( '_wc_needs_pages', 1 );

// Flush rewrite rules
Expand Down Expand Up @@ -228,7 +228,7 @@ public static function create_pages() {
) );

foreach ( $pages as $key => $page )
wc_create_page( esc_sql( $page['name'] ), 'woocommerce_' . $key . '_page_id', $page['title'], $page['content'], ! empty( $page['parent'] ) ? woocommerce_get_page_id( $page['parent'] ) : '' );
wc_create_page( esc_sql( $page['name'] ), 'woocommerce_' . $key . '_page_id', $page['title'], $page['content'], ! empty( $page['parent'] ) ? wc_get_page_id( $page['parent'] ) : '' );
}

/**
Expand Down
6 changes: 3 additions & 3 deletions includes/class-wc-order.php
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ public function has_downloadable_item() {
*/
public function get_checkout_payment_url( $on_checkout = false ) {

$pay_url = woocommerce_get_endpoint_url( 'order-pay', $this->id, get_permalink( woocommerce_get_page_id( 'checkout' ) ) );
$pay_url = wc_get_endpoint_url( 'order-pay', $this->id, get_permalink( wc_get_page_id( 'checkout' ) ) );

if ( get_option( 'woocommerce_force_ssl_checkout' ) == 'yes' || is_ssl() )
$pay_url = str_replace( 'http:', 'https:', $pay_url );
Expand All @@ -1038,7 +1038,7 @@ public function get_checkout_payment_url( $on_checkout = false ) {
*/
public function get_checkout_order_received_url() {

$order_received_url = woocommerce_get_endpoint_url( 'order-received', $this->id, get_permalink( woocommerce_get_page_id( 'checkout' ) ) );
$order_received_url = wc_get_endpoint_url( 'order-received', $this->id, get_permalink( wc_get_page_id( 'checkout' ) ) );

if ( get_option( 'woocommerce_force_ssl_checkout' ) == 'yes' || is_ssl() )
$order_received_url = str_replace( 'http:', 'https:', $order_received_url );
Expand All @@ -1065,7 +1065,7 @@ public function get_cancel_order_url() {
* @return string
*/
public function get_view_order_url() {
$view_order_url = woocommerce_get_endpoint_url( 'view-order', $this->id, get_permalink( woocommerce_get_page_id( 'myaccount' ) ) );
$view_order_url = wc_get_endpoint_url( 'view-order', $this->id, get_permalink( wc_get_page_id( 'myaccount' ) ) );

return apply_filters( 'woocommerce_get_view_order_url', $view_order_url, $this );
}
Expand Down
2 changes: 1 addition & 1 deletion includes/class-wc-post-types.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public function register_post_types() {
'rewrite' => $product_permalink ? array( 'slug' => untrailingslashit( $product_permalink ), 'with_front' => false, 'feeds' => true ) : false,
'query_var' => true,
'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'comments', 'custom-fields', 'page-attributes' ),
'has_archive' => ( $shop_page_id = woocommerce_get_page_id( 'shop' ) ) && get_page( $shop_page_id ) ? get_page_uri( $shop_page_id ) : 'shop',
'has_archive' => ( $shop_page_id = wc_get_page_id( 'shop' ) ) && get_page( $shop_page_id ) ? get_page_uri( $shop_page_id ) : 'shop',
'show_in_nav_menus' => true
)
)
Expand Down
10 changes: 5 additions & 5 deletions includes/class-wc-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function pre_get_posts( $q ) {
return;

// When orderby is set, WordPress shows posts. Get around that here.
if ( $q->is_home() && 'page' == get_option('show_on_front') && get_option('page_on_front') == woocommerce_get_page_id('shop') ) {
if ( $q->is_home() && 'page' == get_option('show_on_front') && get_option('page_on_front') == wc_get_page_id('shop') ) {
$_query = wp_parse_args( $q->query );
if ( empty( $_query ) || ! array_diff( array_keys( $_query ), array( 'preview', 'page', 'paged', 'cpage', 'orderby' ) ) ) {
$q->is_page = true;
Expand All @@ -157,7 +157,7 @@ public function pre_get_posts( $q ) {
}

// Special check for shops with the product archive on front
if ( $q->is_page() && 'page' == get_option( 'show_on_front' ) && $q->get('page_id') == woocommerce_get_page_id('shop') ) {
if ( $q->is_page() && 'page' == get_option( 'show_on_front' ) && $q->get('page_id') == wc_get_page_id('shop') ) {

// This is a front-page shop
$q->set( 'post_type', 'product' );
Expand All @@ -172,7 +172,7 @@ public function pre_get_posts( $q ) {
// This is hacky but works. Awaiting http://core.trac.wordpress.org/ticket/21096
global $wp_post_types;

$shop_page = get_post( woocommerce_get_page_id('shop') );
$shop_page = get_post( wc_get_page_id('shop') );
$q->is_page = true;

$wp_post_types['product']->ID = $shop_page->ID;
Expand Down Expand Up @@ -254,7 +254,7 @@ public function exclude_protected_products( $where ) {
* @return void
*/
public function wpseo_metadesc() {
return wpseo_get_value( 'metadesc', woocommerce_get_page_id('shop') );
return wpseo_get_value( 'metadesc', wc_get_page_id('shop') );
}


Expand All @@ -265,7 +265,7 @@ public function wpseo_metadesc() {
* @return void
*/
public function wpseo_metakey() {
return wpseo_get_value( 'metakey', woocommerce_get_page_id('shop') );
return wpseo_get_value( 'metakey', wc_get_page_id('shop') );
}


Expand Down
2 changes: 1 addition & 1 deletion includes/class-wc-template-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function template_loader( $template ) {
$find[] = $file;
$find[] = WC_TEMPLATE_PATH . $file;

} elseif ( is_post_type_archive( 'product' ) || is_page( woocommerce_get_page_id( 'shop' ) ) ) {
} elseif ( is_post_type_archive( 'product' ) || is_page( wc_get_page_id( 'shop' ) ) ) {

$file = 'archive-product.php';
$find[] = $file;
Expand Down
2 changes: 1 addition & 1 deletion includes/gateways/cod/class-wc-gateway-cod.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function is_available() {
$chosen_shipping_methods = array_unique( WC()->session->get( 'chosen_shipping_methods' ) );
$check_method = false;

if ( is_page( woocommerce_get_page_id( 'checkout' ) ) && ! empty( $wp->query_vars['order-pay'] ) ) {
if ( is_page( wc_get_page_id( 'checkout' ) ) && ! empty( $wp->query_vars['order-pay'] ) ) {

$order_id = absint( $wp->query_vars['order-pay'] );
$order = new WC_Order( $order_id );
Expand Down
2 changes: 1 addition & 1 deletion includes/shortcodes/class-wc-shortcode-checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private static function order_pay( $order_id ) {
$valid_order_statuses = apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', 'failed' ), $order );

if ( ! current_user_can( 'pay_for_order', $order_id ) ) {
echo '<div class="woocommerce-error">' . __( 'Invalid order.', 'woocommerce' ) . ' <a href="' . get_permalink( woocommerce_get_page_id( 'myaccount' ) ) . '" class="wc-forward">' . __( 'My Account', 'woocommerce' ) . '</a>' . '</div>';
echo '<div class="woocommerce-error">' . __( 'Invalid order.', 'woocommerce' ) . ' <a href="' . get_permalink( wc_get_page_id( 'myaccount' ) ) . '" class="wc-forward">' . __( 'My Account', 'woocommerce' ) . '</a>' . '</div>';
return;
}

Expand Down
4 changes: 2 additions & 2 deletions includes/shortcodes/class-wc-shortcode-my-account.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private static function view_order( $order_id ) {
$order = new WC_Order( $order_id );

if ( !current_user_can( 'view_order', $order_id ) ) {
echo '<div class="woocommerce-error">' . __( 'Invalid order.', 'woocommerce' ) . ' <a href="' . get_permalink( woocommerce_get_page_id( 'myaccount' ) ).'">'. __( 'My Account &rarr;', 'woocommerce' ) .'</a>' . '</div>';
echo '<div class="woocommerce-error">' . __( 'Invalid order.', 'woocommerce' ) . ' <a href="' . get_permalink( wc_get_page_id( 'myaccount' ) ).'">'. __( 'My Account &rarr;', 'woocommerce' ) .'</a>' . '</div>';
return;
}

Expand Down Expand Up @@ -361,7 +361,7 @@ private static function add_payment_method() {

if ( ! is_user_logged_in() ) {

wp_safe_redirect( get_permalink( woocommerce_get_page_id( 'myaccount' ) ) );
wp_safe_redirect( get_permalink( wc_get_page_id( 'myaccount' ) ) );
exit();

} else {
Expand Down
Loading

0 comments on commit 47ae00b

Please sign in to comment.