Impossible to add new listing

  • Author
    Posts
  • mikron007

    When a new user register and login, it is impossible to add new listing. When click on the symbol top right corner it get me to frontpage.

    Permalinks is saved…

    mikron007

    It is just me as admin that could click on the green add listing button at the top right corner.

    What should default value in wordpress be for new register users/vendors?? Or I dont need to change this?

    mikron007

    Sorry, found problem. It was this code that did so nothing happends when click on green button.

    add_filter(
    	'hivepress/v1/models/listing/errors',
    	function( $errors, $listing ) {
    		if ( ! $listing->get_images__id() ) {
    			$errors[] = esc_html__( 'Du måste ladda upp minst en bild till din tjänst.', 'hivepress' );
    		}
    
    		return $errors;
    	},
    	10,
    	2
    );
    

    Any solution on this so vendors need to upload atleast one picture?

    ihordeveloper

    You can try using this as a temporary fix:

    add_filter(
    	'hivepress/v1/models/listing/errors',
    	function( $errors, $listing ) {
    		if ( $listing->get_categories__id() && ! $listing->get_images__id() ) {
    			$errors[] = esc_html__( 'Du måste ladda upp minst en bild till din tjänst.', 'hivepress' );
    		}
    
    		return $errors;
    	},
    	10,
    	2
    );

    There’ll be a better way to handle this in the future updates.

    mikron007

    Thank you ihor!

    mikron007

    Now it showed the error “box”, but the content isn´t there.

    Is there a quick fix to hide the optionally content for this only?

    mikron007

    🙁 not working today

    ihordeveloper

    Please let me know what you mean about the “box” error and optional content, does this code snippet still block the listing submission? The second snippet should work fine because it checks if the category is already set, and then checks if the image is set.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.

Subscribe

Sign In

Don't have an account? Register

Forgot password?

Register

Already have an account? Sign In

Forgot password?

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.