product_type = 'nft_auction'; parent::__construct( $product ); } } } add_action( 'plugins_loaded', 'register_nft_auction_product_type' ); add_action( 'wp_enqueue_scripts', 'nf_auction_enqueue_scripts' ); add_action( 'admin_enqueue_scripts', 'nf_auction_enqueue_backend_scripts' ); function nf_auction_enqueue_backend_scripts(){ wp_enqueue_style( 'flatpickr_date_picker_css', ABSZAN_ASSETS_URL . '/js/flatpickr.min.css' ); wp_enqueue_script( 'abszan_web3_min', ABSZAN_ASSETS_URL . '/js/web3.min.js', array(), false, false ); wp_enqueue_script( 'abszan_web3modal_min', ABSZAN_ASSETS_URL . '/js/web3modal.js', array(), false, false ); wp_enqueue_script( 'abszan_evm_min', ABSZAN_ASSETS_URL . '/js/evmchain.js', array(), false, false ); wp_enqueue_script( 'abszan_walletconnect_min', ABSZAN_ASSETS_URL . '/js/walletconnect.js', array(), false, false ); wp_enqueue_script( 'abszan_abis', ABSZAN_ASSETS_URL . '/js/abis.js', array(), false, false ); wp_enqueue_script( 'abszan_data', ABSZAN_ASSETS_URL . '/js/data.js', array(), false, false ); wp_enqueue_script( 'abszan_networks', ABSZAN_ASSETS_URL . '/js/networks.js', array(), false, false ); wp_enqueue_script( 'abszan_block_script', ABSZAN_ASSETS_URL . '/js/Block.js', array(), false, false ); wp_localize_script( 'abszan_block_script', 'nftData', array( 'network_options' => get_option( 'nft_network_options' ) ) ); wp_enqueue_script( 'flatpickr_date_picker_js', ABSZAN_ASSETS_URL . '/js/flatpickr.js', array(), false, false ); wp_enqueue_script( 'jquery_duration_picker_js', ABSZAN_ASSETS_URL . '/js/jquery.durationpicker.min.js', array(), false, false ); } function nf_auction_enqueue_scripts(){ wp_enqueue_script( 'abszan_web3_min', ABSZAN_ASSETS_URL . '/js/web3.min.js', array(), false, false ); wp_enqueue_script( 'abszan_web3modal_min', ABSZAN_ASSETS_URL . '/js/web3modal.js', array(), false, false ); wp_enqueue_script( 'abszan_evm_min', ABSZAN_ASSETS_URL . '/js/evmchain.js', array(), false, false ); wp_enqueue_script( 'abszan_walletconnect_min', ABSZAN_ASSETS_URL . '/js/walletconnect.js', array(), false, false ); wp_enqueue_script( 'abszan_abis', ABSZAN_ASSETS_URL . '/js/abis.js', array(), false, false ); wp_enqueue_script( 'abszan_data', ABSZAN_ASSETS_URL . '/js/data.js', array(), false, false ); wp_enqueue_script( 'abszan_networks', ABSZAN_ASSETS_URL . '/js/networks.js', array(), false, false ); wp_enqueue_script( 'abszan_block_script', ABSZAN_ASSETS_URL . '/js/Block.js', array(), false, false ); if( is_product() || is_shop() ){ global $post; $nft_network_options = get_option( 'nft_network_options' ); $selectedNetworkKey = null; foreach( $nft_network_options as $key => $network ){ if( $network['chain_id'] == get_post_meta( $post->ID ,'_token_network', true ) ){ $selectedNetworkKey = $key; break; } } wp_enqueue_script( 'fro_nft_product', ABSZAN_ASSETS_URL . '/js/nft-product.js', array(), false, true ); wp_localize_script( 'fro_nft_product', 'nftData', array( 'token' => get_post_meta( $post->ID, '_token_id', true ), 'tokenContract' => get_post_meta( $post->ID, '_token_contract', true ), 'auction' => get_post_meta( $post->ID, '_auction_id', true ), 'block' => get_post_meta( $post->ID, '_block_number', true ), 'auctionTxn' => get_post_meta( $post->ID, '_auction_txn', true ), 'network_option' => $nft_network_options[$selectedNetworkKey] ) ); wp_enqueue_script( 'abszan_web3modal_script', ABSZAN_ASSETS_URL . '/js/web3modal.js', array(), false, false ); wp_enqueue_script( 'abszan_evmchain_script', ABSZAN_ASSETS_URL . '/js/evmchain.js', array(), false, false ); wp_enqueue_script( 'abszan_walletconnect_script', ABSZAN_ASSETS_URL . '/js/walletconnect.js', array(), false, false ); } } /** * Add to product type drop down. */ function add_nft_auction_product( $types ){ // Key should be exactly the same as in the class $types[ 'nft_auction' ] = __( 'NFT Auction' ); return $types; } add_filter( 'product_type_selector', 'add_nft_auction_product' ); /** * Show pricing fields for nft_auction product. */ function nft_auction_custom_js() { if ( 'product' != get_post_type() ) : return; endif; ?> __( 'NFT Auction', 'woocommerce' ), 'target' => 'nft_auction_options', 'class' => array( 'show_if_nft_auction' ), ); return $tabs; } add_filter( 'woocommerce_product_data_tabs', 'custom_product_tabs' ); /** * Contents of the nft options product tab. */ function nft_auction_options_product_tab_content() { global $post; ?>
$network ){ $options[$network['chain_id']] = $network['network_name']; } } woocommerce_wp_select( array( 'id' => '_token_network', 'label' => __( 'Network Options', ABSZAN_TEXT_DOMAIN ), 'options' => $options, //this is where I am having trouble 'value' => get_post_meta( $post->ID ,'_token_network', true ), ) ); woocommerce_wp_text_input( array( 'id' => '_token_id', 'label' => __( 'Token ID', ABSZAN_TEXT_DOMAIN ), 'description' => __( '(Number)', ABSZAN_TEXT_DOMAIN ), 'value' => get_post_meta( $post->ID ,'_token_id', true ), 'default' => '', 'placeholder' => '', ) ); woocommerce_wp_text_input( array( 'id' => '_token_contract', 'label' => __( 'Token Contract', ABSZAN_TEXT_DOMAIN ), 'description' => __( '(Contract Address)', ABSZAN_TEXT_DOMAIN ), 'value' => get_post_meta( $post->ID ,'_token_contract', true ), 'default' => '', 'placeholder' => '', ) ); woocommerce_wp_text_input( array( 'id' => '_auction_duration_picker', 'type' => 'number', 'label' => __( '', ABSZAN_TEXT_DOMAIN ), 'description' => __( 'Select A Value', ABSZAN_TEXT_DOMAIN ), 'value' => get_post_meta( $post->ID ,'_auction_duration_picker', true ), 'default' => '', 'placeholder' => '', ) ); // woocommerce_wp_text_input( // array( // 'id' => '_auction_duration_day', // 'type' => 'number', // 'label' => __( 'Auction Day', ABSZAN_TEXT_DOMAIN ), // 'description' => __( '(day)', ABSZAN_TEXT_DOMAIN ), // 'value' => get_post_meta( $post->ID ,'_auction_duration_day', true ), // 'default' => '', // 'placeholder' => '', // ) // ); // woocommerce_wp_text_input( // array( // 'id' => '_auction_duration_hours', // 'type' => 'number', // 'label' => __( 'Auction Hours', ABSZAN_TEXT_DOMAIN ), // 'description' => __( '(hours)', ABSZAN_TEXT_DOMAIN ), // 'value' => get_post_meta( $post->ID ,'_auction_duration_hours', true ), // 'default' => '', // 'placeholder' => '', // ) // ); // woocommerce_wp_text_input( // array( // 'id' => '_auction_duration_minutes', // 'type' => 'number', // 'label' => __( 'Auction Minutes', ABSZAN_TEXT_DOMAIN ), // 'description' => __( '(minutes)', ABSZAN_TEXT_DOMAIN ), // 'value' => get_post_meta( $post->ID ,'_auction_duration_minutes', true ), // 'default' => '', // 'placeholder' => '', // ) // ); // woocommerce_wp_text_input( // array( // 'id' => '_auction_duration_seconds', // 'type' => 'number', // 'label' => __( 'Auction Seconds', ABSZAN_TEXT_DOMAIN ), // 'description' => __( '(seconds)', ABSZAN_TEXT_DOMAIN ), // 'value' => get_post_meta( $post->ID ,'_auction_duration_seconds', true ), // 'default' => '', // 'placeholder' => '', // ) // ); // woocommerce_wp_text_input( // array( // 'id' => '_auction_duration', // 'type' => 'datetime-local', // 'label' => __( 'Auction Duration', ABSZAN_TEXT_DOMAIN ), // 'description' => __( '(The length of time, in seconds, that the auction should run for once the reserve price is hit.)', ABSZAN_TEXT_DOMAIN ), // 'value' => get_post_meta( $post->ID ,'_auction_duration', true ), // 'default' => '', // 'placeholder' => '', // ) // ); woocommerce_wp_text_input( array( 'id' => '_reserve_price', 'label' => __( 'Reserve Price', ABSZAN_TEXT_DOMAIN ), 'description' => __( '(The minimum price for the first bid, starting the auction)', ABSZAN_TEXT_DOMAIN ), 'value' => get_post_meta( $post->ID ,'_reserve_price', true), 'default' => '', 'placeholder' => '', ) ); woocommerce_wp_text_input( array( 'id' => '_curator', 'label' => __( 'Curator', ABSZAN_TEXT_DOMAIN ), 'description' => __( '(Ethereum Address Optional)', ABSZAN_TEXT_DOMAIN ), 'value' => get_post_meta( $post->ID ,'_curator', true), 'default' => '', 'placeholder' => '', ) ); woocommerce_wp_text_input( array( 'id' => '_owner', 'label' => __( 'Owner', ABSZAN_TEXT_DOMAIN ), 'description' => __( '', ABSZAN_TEXT_DOMAIN ), 'value' => get_post_meta( $post->ID ,'_owner', true), 'default' => '', 'placeholder' => '', 'custom_attributes' => array( 'readonly' => 'readonly' ) ) ); woocommerce_wp_text_input( array( 'id' => '_curator_fee_percent', 'type' => 'number', 'label' => __( 'Curator Free Percentage', ABSZAN_TEXT_DOMAIN ), 'value' => get_post_meta( $post->ID ,'_curator_fee_percent', true), 'default' => '', 'placeholder' => '', 'custom_attributes' => array( 'step' => 'any', 'min' => '0' ) ) ); woocommerce_wp_text_input( array( 'id' => '_auction_currency', 'label' => __( 'Auction Currency', ABSZAN_TEXT_DOMAIN ), 'description' => __( '(The currency to perform this auction in, or 0x0 for ETH)', ABSZAN_TEXT_DOMAIN ), 'value' => get_post_meta( $post->ID ,'_auction_currency', true), 'default' => '', 'placeholder' => '', ) ); woocommerce_wp_text_input( array( 'id' => '_auction_id', 'label' => __( 'Auction Id', ABSZAN_TEXT_DOMAIN ), 'description' => __( '', ABSZAN_TEXT_DOMAIN ), 'value' => get_post_meta( $post->ID ,'_auction_id', true), 'default' => '', 'placeholder' => '', 'custom_attributes' => array( 'readonly' => 'readonly' ) ) ); woocommerce_wp_text_input( array( 'id' => '_block_number', 'label' => __( 'Block Number', ABSZAN_TEXT_DOMAIN ), 'description' => __( '', ABSZAN_TEXT_DOMAIN ), 'value' => get_post_meta( $post->ID ,'_block_number', true), 'default' => '', 'placeholder' => '', 'custom_attributes' => array( 'readonly' => 'readonly' ) ) ); woocommerce_wp_text_input( array( 'id' => '_auction_status', 'label' => __( 'Auction Status', ABSZAN_TEXT_DOMAIN ), 'description' => __( '', ABSZAN_TEXT_DOMAIN ), 'value' => get_post_meta( $post->ID ,'_auction_status', true), 'default' => '', 'placeholder' => '', 'custom_attributes' => array( 'readonly' => 'readonly' ) ) ); woocommerce_wp_text_input( array( 'id' => '_auction_txn', 'label' => __( 'Auction Creation Transaction', ABSZAN_TEXT_DOMAIN ), 'description' => __( '...', ABSZAN_TEXT_DOMAIN ), 'value' => get_post_meta( $post->ID ,'_auction_txn', true), 'default' => '', 'placeholder' => '', 'custom_attributes' => array( 'readonly' => 'readonly' ) ) ); ?>

Network Name

ID, '_auction_status', true ) == 'Cancelled' ){ // do nothing }else{ ?> Connect Wallet ID, '_auction_id', true ); if( $auctionID !== '' && !is_null($auctionID) && isset($auctionID) ){ ?> Cancel Auction

get_type() ){ ?>

Network Name

Connect
There is an issue with the network selection The bid must be 5% more than the current bid amount

Auction ID: get_id(), '_auction_id', true ); ?> (history)

Etherscan transaction
View on IPFS
template_url; $plugin_path = ABSZAN_PLUGIN_PATH . '/woocommerce/'; // Look within passed path within the theme - this is priority $template = locate_template( array( $template_path . $template_name, $template_name ) ); // Modification: Get the template from this plugin, if it exists if ( ! $template && file_exists( $plugin_path . $template_name ) ) $template = $plugin_path . $template_name; // Use default template if ( ! $template ) $template = $_template; // Return what we found return $template; }