Home Forums WC Vendors Pro Support Anyone know whats wrong with this code

NOTICE: We've Moved to a Ticket System for Support

As of August 31, 2017 (12am EST) our support forums will be retired (read-only), and we will be moving to a support ticket system.  This will allow us to better organize and answer support requests, and provide a more personalized experience as we assist our customers.

For the time being, we will leave our forums open for reading and learning while we work on creating a more robust Knowledge Base for everyone to use.

If you are a WC Vendors Pro customer please open a support ticket here. 

If you are a WC Vendors user please open a support ticket on the Wordpress.org forums.

The information on this forum is outdated and in most instances no longer relevant. Please be sure to check our documentation for the most up to date information.

https://docs.wcvendors.com/

Thank you to all of our customers!

 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #58879
    patrick
    Participant

    This code is posted on your github and looks like it was recently updated. It doesnt work, but im not sure if its the code, or my website, and am hoping I can get feedback.
    What its for:
    Its suppose to remove all the tabs on the product-edit page and make it for submitting just an auction.

    What happens when using:
    After placing the code, a submitted product doesnt show up on the front end. On the backend, under products, instead of showing a submitted product, it places an error on the product page were the product would be. The error itself becomes the product.

    Looking at the error I think something is just a little off.

    Here’s the error message:

    Fatal error: Uncaught Error: Call to a member function get_image() on boolean in /home/runbidse/public_html/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-post-types.php:300 Stack trace: #0 /home/runbidse/public_html/wp-includes/class-wp-hook.php(300): WC_Admin_Post_Types->render_product_columns('thumb') #1 /home/runbidse/public_html/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array) #2 /home/runbidse/public_html/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #3 /home/runbidse/public_html/wp-admin/includes/class-wp-posts-list-table.php(1152): do_action('manage_product_...', 'thumb', 78) #4 /home/runbidse/public_html/wp-admin/includes/class-wp-list-table.php(1305): WP_Posts_List_Table->column_default(Object(WP_Post), 'thumb') #5 /home/runbidse/public_html/wp-admin/includes/class-wp-posts-list-table.php(1185): WP_List_Table->single_row_columns(Object(WP_Post)) #6 /home/runbidse/public_html/wp-admin/includes/class-wp-posts-list-table.php(662): WP_Posts_List_Table->single_row(Object( in /home/runbidse/public_html/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-post-types.php on line 300
    
    Heres a link to the code:
    https://gist.github.com/digitalchild/e5f2f87c0f37f3a2b2df0345960c1807
    And here is the code itself:
    

    <?php
    /**
    * The template for displaying the Auction only Product Edit form
    *
    * Override this template by copying it to yourtheme/wc-vendors/dashboard/
    *
    * @package WCVendors_Pro
    * @version 1.3.9
    */
    /**
    * DO NOT EDIT ANY OF THE LINES BELOW UNLESS YOU KNOW WHAT YOU’RE DOING
    *
    */
    $title = ( is_numeric( $object_id ) ) ? __(‘Save Changes’, ‘wcvendors-pro’) : __( ‘Add Simple Product’, ‘wcvendors-pro’);
    $product = ( is_numeric( $object_id ) ) ? wc_get_product( $object_id ) : null;
    // Get basic information for the product
    $product_title = ( isset($product) && null !== $product ) ? $product->post->post_title : ”;
    $product_description = ( isset($product) && null !== $product ) ? $product->post->post_content : ”;
    $product_short_description = ( isset($product) && null !== $product ) ? $product->post->post_excerpt : ”;
    $post_status = ( isset($product) && null !== $product ) ? $product->post->post_status : ”;
    /**
    * Ok, You can edit the template below but be careful!
    */
    ?>

    <h2><?php echo $title; ?></h2>

    <!– Product Edit Form –>
    <form method=”post” action=”” id=”wcv-product-edit” class=”wcv-form wcv-formvalidator”>

    <!– Basic Product Details –>

    </div>

    <hr />

    ‘hidden’,
    ‘id’ => ‘product-type’,
    ‘value’ => ‘auction’
    ) )
    );
    ?>

    <!– Price and Sale Price –>
    <?php WCVendors_Pro_Product_Form::prices( $object_id ); ?>

    <!– SKU –>
    <?php WCVendors_Pro_Product_Form::sku( $object_id ); ?>
    <!– Private listing –>
    <?php WCVendors_Pro_Product_Form::private_listing( $object_id ); ?>

    <!– Shipping rates –>
    <?php WCVendors_Pro_Product_Form::shipping_rates( $object_id ); ?>

    <!– Auction Fields –>

    <!– Item Condition –>
    <?php WCVendors_Pro_Form_Helper::select( apply_filters( ‘wcv_simple_auctions_item_condition’, array(
    ‘post_id’ => $post_id,
    ‘id’ => ‘_auction_item_condition’,
    ‘class’ => ‘select2’,
    ‘label’ => __( ‘Item Condition’, ‘wc_simple_auctions’ ),
    ‘desc_tip’ => ‘true’,
    ‘description’ => sprintf( __( ‘The condition of the item you are selling’, ‘wcvendors-pro-simple-auctions’ ) ),
    ‘wrapper_start’ => ”,
    ‘wrapper_end’ => ”,
    ‘options’ => array( ‘new’ => __(‘New’, ‘wc_simple_auctions’), ‘used’=> __(‘Used’, ‘wc_simple_auctions’) )
    ) )
    );
    ?>

    <!– Type of Auction –>
    <?php WCVendors_Pro_Form_Helper::select( apply_filters( ‘wcv_simple_auctions_auction_type’, array(
    ‘post_id’ => $post_id,
    ‘id’ => ‘_auction_type’,
    ‘class’ => ‘select2’,
    ‘label’ => __( ‘Auction Type’, ‘wc_simple_auctions’ ),
    ‘desc_tip’ => ‘true’,
    ‘description’ => sprintf( __( ‘Type of Auction – Normal prefers high bidders, reverse prefers low bids to win.’, ‘wcvendors-pro-simple-auctions’ ) ),
    ‘wrapper_start’ => ”,
    ‘wrapper_end’ => ”,
    ‘options’ => array( ‘normal’ => __(‘Normal’, ‘wc_simple_auctions’), ‘reverse’=> __(‘Reverse’, ‘wc_simple_auctions’) )
    ) )
    );
    ?>

    <!– Proxy Options –>
    <?php WCVendors_Pro_Form_Helper::input( apply_filters( ‘wcv_simple_auctions_proxy_bidding’, array(
    ‘post_id’ => $post_id,
    ‘id’ => ‘_auction_proxy’,
    ‘label’ => __( ‘Enable proxy bidding’, ‘wc_simple_auctions’ ),
    ‘type’ => ‘checkbox’
    ) )
    );
    ?>

    <!– Auction Start Price –>
    <?php WCVendors_Pro_Form_Helper::input( apply_filters( ‘wcv_simple_auctions_start_price’, array(
    ‘post_id’ => $post_id,
    ‘id’ => ‘_auction_start_price’,
    ‘label’ => __( ‘Start Price’, ‘wc_simple_auctions’ ) . ‘ (‘ . get_woocommerce_currency_symbol() . ‘)’,
    ‘data_type’ => ‘price’,
    ‘wrapper_start’ => ”,
    ‘wrapper_end’ => ”
    ) )
    );
    ?>

    <!– Auction Bid Increment –>
    <?php WCVendors_Pro_Form_Helper::input( apply_filters( ‘wcv_simple_auctions_bid_increment’, array(
    ‘post_id’ => $post_id,
    ‘id’ => ‘_auction_bid_increment’,
    ‘label’ => __( ‘Bid increment’, ‘wc_simple_auctions’ ) . ‘ (‘ . get_woocommerce_currency_symbol() . ‘)’,
    ‘data_type’ => ‘price’,
    ‘wrapper_start’ => ”,
    ‘wrapper_end’ => ”
    ) )
    );
    ?>

    <!– Reserve Price (note the keys are reserved not reserve, as is the auction developers code) –>
    <?php WCVendors_Pro_Form_Helper::input( apply_filters( ‘wcv_simple_auctions_reserved_price’, array(
    ‘post_id’ => $post_id,
    ‘id’ => ‘_auction_reserved_price’,
    ‘label’ => __( ‘Reserve price’, ‘wc_simple_auctions’ ) . ‘ (‘ . get_woocommerce_currency_symbol() . ‘)’,
    ‘data_type’ => ‘price’,
    ‘wrapper_start’ => ”,
    ‘wrapper_end’ => ”
    ) )
    );
    ?>

    <!– Buy it Now Price –>
    <?php WCVendors_Pro_Form_Helper::input( apply_filters( ‘wcv_simple_auctions_buy_it_now_price’, array(
    ‘post_id’ => $post_id,
    ‘id’ => ‘_buy_it_now_price’,
    ‘label’ => __( ‘Buy it now price’, ‘wc_simple_auctions’ ) . ‘ (‘ . get_woocommerce_currency_symbol() . ‘)’,
    ‘data_type’ => ‘price’,
    ‘wrapper_start’ => ”,
    ‘wrapper_end’ => ”
    ) )
    );
    ?>

    <?php WCVendors_Pro_Form_Helper::input( apply_filters( ‘wcv_simple_auctions_start_date’, array(
    ‘post_id’ => $post_id,
    ‘id’ => ‘_auction_dates_from’,
    ‘label’ => __( ‘From’, ‘wcvendors-pro-simple-auctions’ ),
    ‘class’ => ‘wcv-datetimepicker’,
    ‘placeholder’ => __( ‘From…’, ‘placeholder’, ‘wcvendors-pro-simple-auctions’ ). ‘ YYYY-MM-DD’,
    ‘wrapper_start’ => ”,
    ‘wrapper_end’ => ”,
    ) )
    );
    ?>

    <?php WCVendors_Pro_Form_Helper::input( apply_filters( ‘wcv_simple_auctions_end_date’, array(
    ‘post_id’ => $post_id,
    ‘id’ => ‘_auction_dates_to’,
    ‘label’ => __( ‘To’, ‘wcvendors-pro-simple-auctions’ ),
    ‘class’ => ‘wcv-datetimepicker’,
    ‘placeholder’ => __( ‘To…’, ‘placeholder’, ‘wcvendors-pro-simple-auctions’ ). ‘ YYYY-MM-DD’,
    ‘wrapper_start’ => ”,
    ‘wrapper_end’ => ”,
    ‘desc_tip’ => true,
    ) )
    );
    ?>

    <?php WCVendors_Pro_Product_Form::form_data( $object_id, $post_status, $template ); ?>
    <?php WCVendors_Pro_Product_Form::save_button( $title ); ?>
    <?php WCVendors_Pro_Product_Form::draft_button( __(‘Save Draft’,’wcvendors-pro’) ); ?>

    </div>
    </div>
    </form>

    #58972
    patrick
    Participant

    Any hope for this?

    #59023
    patrick
    Participant

    I think i got this to work. I changed the date input. I dont have a clue what im doing, but it seems to be working.

    Original:

     ) )
    	    );
    	?>
    		 
    	<?php WCVendors_Pro_Form_Helper::input( apply_filters( 'wcv_simple_auctions_start_date', array( 
    			'post_id'		=> $post_id, 
    			'id' 			=> '_auction_dates_from', 
    			'label' 		=> __( 'From', 'wcvendors-pro-simple-auctions' ), 
    			'class'			=> 'wcv-datetimepicker', 
    			'placeholder'	=> __( 'From&hellip;', 'placeholder', 'wcvendors-pro-simple-auctions' ). 
    
    ' YYYY-MM-DD',  
    			'wrapper_start' => '',
    			'wrapper_end' 	=> '', 
    			) )
    		);
    	?>
    	
    	<?php WCVendors_Pro_Form_Helper::input( apply_filters( 'wcv_simple_auctions_end_date', array( 
    			'post_id'			=> $post_id, 
    			'id' 				=> '_auction_dates_to', 
    			'label' 			=> __( 'To', 'wcvendors-pro-simple-auctions' ), 
    			'class'				=> 'wcv-datetimepicker', 
    			'placeholder'		=> __( 'To&hellip;', 'placeholder', 'wcvendors-pro-simple-
    
    auctions' ). ' YYYY-MM-DD', 
    			'wrapper_start' 	=> '',
    			'wrapper_end' 		=> '', 
    			'desc_tip'			=> true, 
    			) )
    		);
    	?>
    

    Slightly changed:
    ` ) )
    );

    WCVendors_Pro_Form_Helper::input( apply_filters( ‘wcv_simple_auctions_start_date’, array(
    ‘post_id’ => $post_id,
    ‘id’ => ‘_auction_dates_from’,
    ‘label’ => __( ‘From’, ‘wcvendors-pro-simple-auctions’ ),
    ‘class’ => ‘wcv-datepicker’,
    ‘placeholder’ => __( ‘From…’, ‘placeholder’, ‘wcvendors-pro-simple-auctions’ ).

    ‘ YYYY-MM-DD’,
    ‘wrapper_start’ => ”,
    ‘wrapper_end’ => ”,
    ‘custom_attributes’ => array(
    ‘maxlenth’ => ’10’,
    ‘pattern’ => ‘[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])’
    ),
    ) )
    );

    WCVendors_Pro_Form_Helper::input( apply_filters( ‘wcv_simple_auctions_end_date’, array(
    ‘post_id’ => $post_id,
    ‘id’ => ‘_auction_dates_to’,
    ‘label’ => __( ‘To’, ‘wcvendors-pro-simple-auctions’ ),
    ‘class’ => ‘wcv-datepicker’,
    ‘placeholder’ => __( ‘To…’, ‘placeholder’, ‘wcvendors-pro-simple-

    auctions’ ). ‘ YYYY-MM-DD’,
    ‘wrapper_start’ => ”,
    ‘wrapper_end’ => ”,
    ‘desc_tip’ => true,
    ‘custom_attributes’ => array(
    ‘maxlenth’ => ’10’,
    ‘pattern’ => ‘[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3

    [01])’
    ),
    ) )
    );
    ?>

    #59082
    Anna
    Member

    Hi there-
    Is this still working for you?
    Looking through it, I can tell you that I have NO IDEA what could be wrong with it.. but if you still have issues, please paste the code on github in a gist or on pastebin so we can see it in the proper format. 😉

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘WC Vendors Pro Support’ is closed to new topics and replies.