2016-05-10 8 views

答えて

1

これらはもう動作しません.Woocommerce 2.1以下のためだけです。あなたはこのような何かをする必要がありますので、彼らは、エンドポイントに置き換えられました:

$my_account_link = get_permalink(get_option('woocommerce_myaccount_page_id')); 
$edit_acount_link = $my_account_link . '/edit-account'; 

最初の行が長すぎるこれにしようとされている場合:

$my_account_link = get_bloginfo('url'). '/my-account'; 

あなたがでエンドポイントに関する詳細情報を読むことができます:https://docs.woothemes.com/document/woocommerce-endpoints-2-1/

+0

私はちょうど私が今までユーザが他の言葉でをクリックするか、到達したときに見せたい、リンクを表示したくありませんアカウントの編集ページで、彼/彼女は彼/彼女のアカウントを編集することができます。あなたのコードはそれを提供しますか?さらに、私はこのコードをどこに入れますか?私はページエディタ内でショートコードを使用しようとしていましたが、あなたのコードはそこで実行されません....任意のplzzz – laraib

+0

このコードをカスタムショートコードまたは任意のフック/フィルタに入れて、 – Skatox

1

ネイティブWooCommerce関数wc_customer_edit_account_url()の代わりに使用できます。
(これは、woocommerce my_account.phpテンプレートでも使用されています)です。

Skatoxに言及すると、[woocommerce_edit_account]はもう動作しません。

カスタム自己閉鎖ショートでそれを使用することができます。

// Paste this in the function.php file of your active child theme or theme. 
function wc_customer_edit_account_shortcode($atts) { 

    // Attributes 
    $atts = shortcode_atts(
     array(
      'text' => '', 
     ), 
    ); 

    return '<a class="customer-edit-account" href="'.wc_customer_edit_account().'">'.$text.'</a>'; 

} 
add_shortcode('wc_customer_edit_account', 'wc_customer_edit_account_shortcode'); 

用途:[wc_customer_edit_account text="Editing my account details" /]

関連する問題