1
我試圖在產品部分的woocommerce管理面板中添加自定義選項卡,但未顯示出來。有人能引導我走向正確的方向嗎?我試圖把它當成一個班級來做。在admin中添加自定義選項卡woocommerce產品
<?php
/*
Plugin Name: Cdog Woocomerce Product Options
Description: Allow a customer to order several different options of one product under one line item.
Version: 1.0
Author: Clint Chaney
*/
class cdog_product_options
{
public function __construct()
{
add_action('woocommerce_product_write_panel_tabs', array(&$this, 'create_admin_tab'));
}
/* this creates the tab in the products section in the admin panel */
public function create_admin_tab()
{
?>
<li class="cdog_product_options_tab"><a href="#cdog_product_options"><?php _e('Product Options', 'woocommerce'); ?></a></li>
<?
}
} // end class
$cdog_product_options = new cdog_product_options();