0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【WooCommerce】Freshdeskサポートフォームを注文詳細ページから非表示にする方法

Posted at

やりたいこと

WooCommerce Freshdeskプラグインが注文詳細ページ(マイアカウント → 注文履歴 → 注文詳細)に自動追加する「サポート問い合わせフォーム」を非表示にしたい。

  • 作業の備忘録になります。
  • あくまでご参考になれば幸いです。

方法

functions.php に以下を追加:

/**
 * 注文詳細ページからFreshdeskサポートフォームを削除
 */
function remove_freshdesk_ticket_form()
{
    $integrations = WC()->integrations->get_integrations();

    if (isset($integrations['freshdesk']) && is_object($integrations['freshdesk'])) {
        $freshdesk = $integrations['freshdesk'];
        remove_action(
            'woocommerce_view_order',
            array($freshdesk, 'view_order_create_ticket'),
            40
        );
    }
}
add_action('woocommerce_init', 'remove_freshdesk_ticket_form');

フック情報

項目
フック名 woocommerce_view_order
メソッド名 view_order_create_ticket
優先度 40
提供元 WooCommerce Freshdeskプラグイン
  • 将来的にプラグインのバージョンアップでフック構成が変更される可能性有

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?