Forum Replies Created

Viewing 15 replies - 1 through 15 (of 22 total)
  • Thread Starter MagusTSF

    (@magustsf)

    Our store fronts can be accessed from https://rookwoodstudios.com/artists which is using my custom view to display the links. Any of these will take you to a storefront.

    I have noticed a new issue since the 5.0.2 update. If I use your store listing shortcode as I have on https://rookwoodstudios.com/artists2 , nothing shows on the page unless you are logged in to the site. The browser console is full of 401 Axios errors when this happens which is an authentication issue.

    Thread Starter MagusTSF

    (@magustsf)

    Not working as displayed. the stores all have the required fields for social, contact, desc etc filled out but the store page only shows the meta. on 5.0.1 it showed the store name in the banner as well but on this version 5.0.2 it is all missing. I have inspected the page source just in case there was a css override somewhere but all the divs designed to hold that information are empty.

    • This reply was modified 1 month, 2 weeks ago by MagusTSF.
    Thread Starter MagusTSF

    (@magustsf)

    Ok, I’ll contact support about the migration issue. What about returning the store description to the storefront? Is there any way to show that. All stores have a description and it can still be edited in the backend admin pages.

    Thread Starter MagusTSF

    (@magustsf)

    That cron is there and is set to run every 60 seconds.

    mvx_full_migration

    Edit | Run now | Pause this hook | DeleteNow
    Today at 1:31 pmEvery minuteMultiVendorX\Migration\Cron->run_table_migration_cron()

    Thread Starter MagusTSF

    (@magustsf)

    when I say legacy vendors, I mean vendors that were created when the plugin was still called woocommerce multi vendor, before the rebranding to MultiVendorX. All of our stores and their corresponding user accounts were setup through the woocommerce multi vendor/multivendorx plugin admin pages which created the corresponding user as part of the process. In this new version the user account must already exist and be linked as the store owner when adding a new store.

    The only user accounts that get deleted are the ones created after the rebrand to MultiVendorX.

    The only thing I would be able to show you in a screenshot/recording would be the fact that the product counts on the backend store settings pages display the total count of all products and outstanding orders rather than those only belonging to that store. That is until the accounts get deleted again.

    Thread Starter MagusTSF

    (@magustsf)

    Three times now, since the initial 5.0 update, all our non legacy vendors get deleted from the user store and their mvx stores no longer appear on our views page as it parses users with the store-owner role. The only stores that still show are the legacy stores setup when the plugin was still called woocommerce multi vendor.

    Every time this happens I have to restore the users table in the database to get the accounts restored, and then reset their role to store owner.

    In the mvx stores list in the admin backend, when viewing the store settings page, all stores show the product count for the entire site, not their store.

    We would also like to know how to get the store description visible on the storefront page for each vendor, as it was in the previous version.

    Thread Starter MagusTSF

    (@magustsf)

    Thanks for the update. On another note, I cannot find anywhere in settings to change how many products are shown per page for the stores. Is this changeable or will I need to have a modified template in my theme files.

    Thread Starter MagusTSF

    (@magustsf)

    my toolset view filters out suspended stores by default. the page I linked /artists2 shows only enabled stores using your shortcode as does the views page /artists. Neither shows the suspended stores if the option is enabled, but trying to visit any store from either page results in the 302 error.

    Thread Starter MagusTSF

    (@magustsf)

    thanks for the update, it has resolved the issue with the double slash in the view store link. However the 302 redirect still occurs if suspended stores are hidden. It still takes the user to the WC shop page with a heavily reduced product list.

    I have left that option enabled so you can see the issue on https://rookwoodstudios.com/artists2

    I will leave the setting enabled for 1 hour, but will need to unset it to restore functionality.

    Thread Starter MagusTSF

    (@magustsf)

    Hi

    I have added a clone of the page to use your [marketplace_stores] shortcode do highlight the // issue. This is available at https://rookwoodstudios.com/artists2.

    the video is available here

    Thread Starter MagusTSF

    (@magustsf)

    The page is currently a toolset views page so I can control the way the shop cards are displayed.

    This is not what is causing the issue as it still occurs if I use the build in shortcode to display the stores list. The same list shows, just with a different layout but the behaviour remains, with 1 extra issue. Using the MVX shortcode the view store link appears as ‘url/artist//storename’ (notice the double forward slash) and clicking the link will take us to the store page as long as the option to hide suspended stores is not selected.

    I’ve double checked the settings in MVX and the storefront base is populated correctly. I rolled back to before the plugin was updated and did notice that during the upgrade the plugin page suddenly showed a red 530 error message on the plugin card stating that the site was busy so maybe related?

    Thread Starter MagusTSF

    (@magustsf)

    All of the WCMP email templates disappear from the woocommerce email settings. We don’t send passwords via email, the user creates their own. We installed this plugin to help combat spam registrations by forcing the user to authenticate their address before allowing access to the site. I have disabled the Send as separate email option, which brings the email templates back onto the settings page, but as I said, I would prefer to keep that option enabled rather than sending out a combined welcome and activation email.

    Thread Starter MagusTSF

    (@magustsf)

    nvm, updated the php version and all now works

    Thread Starter MagusTSF

    (@magustsf)

    nvm, after looking through the paypal express log it looks like the addresses being sent are incomplete, missing 1 line. I will investigate further and come back to you if your plugin is involved in any way.

    MagusTSF

    (@magustsf)

    I have made all the alterations required to get this plugin working correctly. Please find below the corrected contents of the file plugins/mailpoet-contact-form-7/modules/mailpoet-signup.php

    <?php
    /**
     * MailPoet - Contact Form 7 Integration
     *
     * Add the mailpoet cf7 shortcode
     *
     * @author Patrick Rauland
     * @since 1.0.0
     */
    
    add_action( 'init', 'wpcf7_add_shortcode_mailpoetsignup', 5 );
    
    function wpcf7_add_shortcode_mailpoetsignup() {
    	if( function_exists('wpcf7_add_form_tag') ) {
    		wpcf7_add_form_tag( array( 'mailpoetsignup', 'mailpoetsignup*' ),
    			'wpcf7_mailpoetsignup_shortcode_handler', true );
    	}
    }
    
    function wpcf7_mailpoetsignup_shortcode_handler( $tag ) {
    
    	// if cf7 is not active, leave
    	if( ! class_exists( 'WPCF7_FormTag' ) )
    		return;
    
    	// create a new tag
    	$tag = new WPCF7_FormTag( $tag );
    
    	// if the tag doesn't have a name, return empty handed
    	if( empty( $tag->name ) ) 
    		return '';
    
    	// check for errors and set the class
    	$validation_error = wpcf7_get_validation_error( $tag->name );
    	$class = wpcf7_form_controls_class( $tag->type );
    
    	// if there were errors, add class
    	if( $validation_error )
    		$class .= ' wpcf7-not-valid';
    
    	// init the atts array, add the class and id set in the shortcode
    	$atts 				= array();
    	$atts[ 'class' ]	= $tag->get_class_option( $class );
    	$atts[ 'id' ]		= $tag->get_option( 'id', 'id', true );
    
    	// get checkbox value
    	// first get all of the lists
    	$lists = wpcf7_mailpoetsignup_get_lists();
    	if( ! empty( $lists ) ) {
    
    		$checkbox_values = array();
    
    		// go through each list
    		foreach( $lists as $key => $l ) {
    
    			// check if that list was added to the form
    			if( $tag->has_option( 'mailpoet_list_' . $l[ 'list_id' ] ) ) {
    
    				// add the list into the array of checkbox values
    				$checkbox_values[] = 'mailpoet_list_'. $l[ 'list_id' ];
    			}
    		}
    	}
    
    	// do we have any lists?
    	if( ! empty ( $checkbox_values ) ) {
    
    		// implode them all into a comma separated string
    		$atts[ 'value' ] = implode( $checkbox_values, ',' );
    
    	} else {
    
    		// we apparently have no lists
    		// set a 0 so we know to add the user to Mailpoet but not to any specific list
    		$atts[ 'value' ] = '0';
    	}
    
    	// is it required?
    	if( $tag->is_required() )
    		$atts[ 'aria-required' ] = 'true';
    
    	// set default checked state
    	$atts[ 'checked' ] = ( $tag->has_option( 'default:on' ) ) ? 'checked' : '';
    
    	// default tag value
    	$value = (string) reset( $tag->values );
    
    	// if the tag has a default value, add it
    	if( '' !== $tag->content )
    		$value = $tag->content;
    
    	// if the tag has a posted value, add it
    	if( wpcf7_is_posted() && isset( $_POST[ $tag->name ] ) )
    		$value = stripslashes_deep( $_POST[ $tag->name ] );
    	
    	// set the name and the id of the field
    	$atts[ 'name' ]	= $tag->name;
    	$id 			= ( ! empty( $atts[ 'id' ] ) ) ? $atts[ 'id' ] : $atts[ 'name' ];
    
    	// put all of the atts into a string for the field
    	$atts = wpcf7_format_atts( $atts );
    
    	// get the content from the tag to make the checkbox label
    	$label 	= __( 'Sign up for the newsletter', 'mpcf7' );
    	$values = $tag->values;
    	if( isset( $values ) && ! empty( $values ) )
    		$label = esc_textarea( $values[0] );
    
    	// should the label be inside the span?
    	if( $tag->has_option( 'label-inside-span' ) ) {
    
    		// create the field
    		$html = sprintf(
    			'<span class="wpcf7-form-control-wrap %1$s"><input type="checkbox" %2$s />&nbsp;<label for="%3$s">%4$s</label></span>&nbsp;%5$s',
    			$tag->name, $atts, $id, $value, $validation_error );
    
    	} else {
    
    		// create the field
    		$html = sprintf(
    			'<span class="wpcf7-form-control-wrap %1$s"><input type="checkbox" %2$s />&nbsp;</span><label for="%3$s">%4$s</label>&nbsp;%5$s',
    			$tag->name, $atts, $id, $value, $validation_error );
    	}
    
    	return $html;
    }
    
    /* Validation filter */
    
    add_filter( 'wpcf7_validate_mailpoetsignup', 'wpcf7_mailpoetsignup_validation_filter', 10, 2 );
    add_filter( 'wpcf7_validate_mailpoetsignup*', 'wpcf7_mailpoetsignup_validation_filter', 10, 2 );
    
    function wpcf7_mailpoetsignup_validation_filter( $result, $tag ) {
    
    	// make sure that CF7 is installed and active
    	if( ! class_exists( 'WPCF7_FormTag' ) )
    		return;
    
    	// 
    	$tag = new WPCF7_FormTag( $tag );
    
    	// get the type and name
    	$type = $tag->type;
    	$name = $tag->name;
    
    	// if the tag was posted, set it
    	$value = isset( $_POST[ $name ] ) ? ( string ) $_POST[ $name ] : '';
    
    	// if it's required
    	if( 'mailpoetsignup*' == $type ) {
    
    		// and empty
    		if( '' == $value ) {
    
    			// then fail it
    			$result[ 'valid' ] = false;
    			$result[ 'reason' ][ $name ] = wpcf7_get_message( 'invalid_required' );
    		}
    	}
    
    	return $result;
    }
    
    /* Tag generator */
    
    add_action( 'admin_init', 'wpcf7_add_tag_generator_mailpoetsignup', 20 );
    
    function wpcf7_add_tag_generator_mailpoetsignup() {
    
    	if( ! class_exists( 'WPCF7_TagGenerator' ) )
    		return;
    
    	$tag_generator = WPCF7_TagGenerator::get_instance();
    	$tag_generator->add( 'mailpoetsignup', __( 'Mailpoet Signup', 'mpcf7' ),
    		'wpcf7_tg_pane_mailpoetsignup' );
    }
    
    function wpcf7_tg_pane_mailpoetsignup( $contact_form, $args = '' ) {
    
    	$args = wp_parse_args( $args, array() );
    	$type = 'mailpoetsignup';
    
    	$description = __( "Mailpoet Signup Form.", 'mpcf7' );
    
    	$desc_link = '';
    
    	?>
    
    	<div class="control-box">
    		<fieldset>
    			<legend><?php echo esc_html( $description ); ?></legend>
    
    			<table class="form-table">
    				<tbody>
    				 	<tr>
    						<th scope="row"><?php echo esc_html( __( 'Field type', 'contact-form-7' ) ); ?></th>
    						<td>
    							<fieldset>
    							<legend class="screen-reader-text"><?php echo esc_html( __( 'Field type', 'contact-form-7' ) ); ?></legend>
    							<label><input type="checkbox" name="required" /> <?php echo esc_html( __( 'Required field', 'contact-form-7' ) ); ?></label>
    							</fieldset>
    						</td>
    					</tr>
    
    					<tr>
    						<th scope="row"><?php echo esc_html( __( 'MailPoet Lists', 'contact-form-7' ) ); ?></th>
    						<td>					
    							<?php
    							// print mailpoet lists
    							echo wpcf7_mailpoetsignup_get_list_inputs();
    							?>
    						</td>
    					</tr>
    
    					<tr>
    						<th scope="row"><label for="<?php echo esc_attr( $args[ 'content' ] . '-default:on' ); ?>"><?php echo esc_html( __( 'Checked by Default', 'contact-form-7' ) ); ?></label></th>
    						<td><input type="checkbox" name="default:on" class="option" />&nbsp;<?php echo esc_html( __( "Make this checkbox checked by default?", 'contact-form-7' ) ); ?></td>
    					</tr>
    
    					<tr>
    						<th scope="row"><label for="<?php echo esc_attr( $args[ 'content' ] . '-values' ); ?>"><?php echo esc_html( __( 'Checkbox Label', 'contact-form-7' ) ); ?></label></th>
    						<td><input type="text" name="values" class="oneline" id="<?php echo esc_attr( $args[ 'content' ] . '-values' ); ?>" /><br />
    					</tr>
    
    					<tr>
    						<th scope="row"><label for="<?php echo esc_attr( $args[ 'content' ] . '-label-inside-span' ); ?>"><?php echo esc_html( __( 'Label Inside Span', 'contact-form-7' ) ); ?></label></th>
    						<td><input type="checkbox" name="label-inside-span" class="option" />&nbsp;<?php echo esc_html( __( "Place the label inside the control wrap span?", 'contact-form-7' ) ); ?></td>
    					</tr>
    
    					<tr>
    						<th scope="row"><label for="<?php echo esc_attr( $args[ 'content' ] . '-name' ); ?>"><?php echo esc_html( __( 'Name', 'contact-form-7' ) ); ?></label></th>
    						<td><input type="text" name="name" class="tg-name oneline" id="<?php echo esc_attr( $args[ 'content' ] . '-name' ); ?>" /></td>
    					</tr>
    
    					<tr>
    						<th scope="row"><label for="<?php echo esc_attr( $args[ 'content' ] . '-id' ); ?>"><?php echo esc_html( __( 'Id attribute', 'contact-form-7' ) ); ?></label></th>
    						<td><input type="text" name="id" class="idvalue oneline option" id="<?php echo esc_attr( $args[ 'content' ] . '-id' ); ?>" /></td>
    					</tr>
    
    					<tr>
    					<th scope="row"><label for="<?php echo esc_attr( $args[ 'content' ] . '-class' ); ?>"><?php echo esc_html( __( 'Class attribute', 'contact-form-7' ) ); ?></label></th>
    					<td><input type="text" name="class" class="classvalue oneline option" id="<?php echo esc_attr( $args[ 'content' ] . '-class' ); ?>" /></td>
    					</tr>
    
    				</tbody>
    			</table>
    		</fieldset>
    	</div>
    
    	<div class="insert-box">
    		<input type="text" name="<?php echo $type; ?>" class="tag code" readonly="readonly" onfocus="this.select()" />
    
    		<div class="submitbox">
    			<input type="button" class="button button-primary insert-tag" value="<?php echo esc_attr( __( 'Insert Tag', 'contact-form-7' ) ); ?>" />
    		</div>
    
    		<br class="clear" />
    
    		<p class="description mail-tag"><label for="<?php echo esc_attr( $args[ 'content' ] . '-mailtag' ); ?>"><?php echo sprintf( esc_html( __( "To use the value input through this field in a mail field, you need to insert the corresponding mail-tag (%s) into the field on the Mail tab.", 'contact-form-7' ) ), '<strong><span class="mail-tag"></span></strong>' ); ?><input type="text" class="mail-tag code hidden" readonly="readonly" id="<?php echo esc_attr( $args[ 'content' ] . '-mailtag' ); ?>" /></label></p>
    	</div>
    
    	<?php
    }
    
    /* Process the form field */
    
    add_action( 'wpcf7_before_send_mail', 'wpcf7_mailpoet_before_send_mail' );
    
    function wpcf7_mailpoet_before_send_mail( $contactform ) {
    
    	// make sure the user has Mailpoet (Wysija) and CF7 installed & active
    	if( ! class_exists( 'WYSIJA' ) || ! class_exists( 'WPCF7_Submission' )  )
    		return;
    
    	// 
    	if( ! empty( $contactform->skip_mail ) )
    		return;
    
    	// 
    	$posted_data = null;
    		
    	// get the instance that was submitted and the posted data
    	$submission 	= WPCF7_Submission::get_instance();
    	$posted_data 	= ( $submission ) ? $submission->get_posted_data() : null;
    
    	// and make sure they have something in their contact form
    	if( empty( $posted_data ) )
    		return;
    
    	// get the tags that are in the form
    	$manager 		= WPCF7_FormTagManager::get_instance();
    	$scanned_tags 	= $manager->get_scanned_tags();
    
    	// let's go add the user
    	wpcf7_mailpoet_subscribe_to_lists( $posted_data, $scanned_tags );
    }
    
    function wpcf7_mailpoet_subscribe_to_lists( $posted_data, $scanned_tags = array() ) {
    
    	// set defaults for mailpoet user data
    	$user_data = array(
    		'email'		=> '',
    		'firstname' => '',
    		'lastname'  => ''
    	);
    
    	// get form data
    	$user_data[ 'email' ]		= isset( $posted_data[ 'your-email' ] ) ? trim( $posted_data[ 'your-email' ] ) : '';
    	$user_data[ 'firstname' ]	= isset( $posted_data[ 'your-name' ] )	? trim( $posted_data[ 'your-name' ] ) : '';
    	if( isset( $posted_data[ 'your-first-name' ] ) && ! empty( $posted_data[ 'your-first-name' ] ) )
    		$user_data[ 'firstname' ] = trim( $posted_data[ 'your-first-name' ] );
    	
    	if( isset( $posted_data[ 'your-last-name' ] ) && ! empty( $posted_data[ 'your-last-name' ] ) )
    		$user_data[ 'lastname' ] = trim( $posted_data[ 'your-last-name' ] );
    	
    	// set up our arrays
    	$mailpoet_signups 	= array();
    	$mailpoet_lists   	= array();
    
    	// go through each tag and find our tags
    	foreach( $scanned_tags as $tag ) {
    
    		// if it's our tag, add it to the array
    		if( $tag[ 'basetype' ] == 'mailpoetsignup' )
    			$mailpoet_signups[] = $tag[ 'name' ];
    	}
    
    	// if we have signup fields
    	if( ! empty( $mailpoet_signups ) ) {
    
    		// go through each field
    		foreach( $mailpoet_signups as $mailpoet_signup_field ) {
    			
    			// trim off our extra data
    			$_field = str_replace( 'mailpoet_list_', '', trim( $posted_data[ $mailpoet_signup_field ] ) );
    
    			// add the list id to the array
    			if( ! empty ( $_field ) )
    				$mailpoet_lists = array_unique( array_merge( $mailpoet_lists, explode( ',', $_field ) ) );
    		}
    	}
    
    	// if we have no lists, exit
    	if( empty( $mailpoet_lists ) )
    		return;
    
    	// configure the list
    	$data = array(
    		'user'		=> $user_data,
    		'user_list' => array( 'list_ids' => $mailpoet_lists )
    	);
    
    	// if akismet is set make sure it's valid
    	$akismet = isset( $contactform->akismet ) ? (array) $contactform->akismet : null;
    	$akismet = $akismet; // temporarily, not in use!
    
    	// add the subscriber to the Wysija list
    	$user_helper = WYSIJA::get( 'user', 'helper' );
    	$user_helper->addSubscriber( $data );
    }
    
    /**
     * Create a formatted list of input's for the CF7 tag generator
     *
     * @return string
     */
    function wpcf7_mailpoetsignup_get_list_inputs ( ) {
    
    	$html = '';
    
    	// get lists
    	$lists = wpcf7_mailpoetsignup_get_lists();
    
    	if ( is_array( $lists ) && ! empty( $lists ) ) {
    		foreach ( $lists as $key => $l ) {
    			// add input to returned html
    			$input_name = wpcf7_mailpoetsignup_get_list_input_field_name();
    			$input = "<input type='checkbox' name='" . $input_name . "' class='option' />%s<br />";
    			$html .= sprintf( $input, $l[ 'list_id' ], $l[ 'name' ] );
    		}
    	}
    
    	return $html;
    }
    
    /**
     * Create input name for both the form processing & tag generation
     *
     * @return string
     */
    function wpcf7_mailpoetsignup_get_list_input_field_name ( ) {
    	return 'mailpoet_list_%d';
    }
    
    add_filter( 'wpcf7_mail_tag_replaced', 'wpcf7_mail_tag_replaced_mailpoetsignup', 10, 2 );
    /**
     *
     * @param string $replaced modifier
     * @param string $submitted submitted value from contact form
     * @return string
     */
    function wpcf7_mail_tag_replaced_mailpoetsignup($replaced, $submitted) {
    
    	if (wpcf7_is_mailpoetsignup_element($submitted)) {
    
    		$list_names = wpcf7_get_list_names(explode(',', $submitted));
    		$replaced = implode(', ', $list_names);
    	}
    
    	return $replaced;
    }
    
    /**
     * Get name of lists based on their ids
     * @param array $list_ids
     */
    function wpcf7_get_list_names(Array $list_ids = array()) {
    	// make sure we have the class loaded
    	$mailpoet_lists = array();
    	if (class_exists( 'WYSIJA' )) {
    		// get MailPoet / Wysija lists
    		$model_list = WYSIJA::get('list','model');
    		$result = $model_list->get( array( 'name' ), array( 'list_id' =>  $list_ids) );
    		foreach ($result as $list) {
    			$mailpoet_lists[] = $list[ 'name' ];
    		}
    	}
    	return $mailpoet_lists;
    }
    
    /**
     * Make sure the current element is mailpoetsignup
     * @param 	string $submitted submitted value from contact form
     * @return 	boolean
     */
    function wpcf7_is_mailpoetsignup_element( $submitted ) {
    
    	// for Contact-Form-7 3.9 and above, http://contactform7.com/2014/07/02/contact-form-7-39-beta/
    	if( class_exists( 'WPCF7_Submission' ) ) {
    
    		// get the submission object
    		$submission = WPCF7_Submission::get_instance();
    
    		// if there's an object, get the posted data
    		if( $submission )
    			$posted_data = $submission->get_posted_data();
    
    	} else {
    
    		// if they are on an old version of cf7, get straight _POST data
    		$posted_data = $_POST;
    	}
    
    	// if we have data
    	if( ! empty( $posted_data ) ) {
    
    		// find all of the keys in $posted_data that belong to mailpoet-cf7's plugin
    		$keys 				= array_keys( $posted_data );
    		$mailpoet_signups 	= preg_grep( '/^mailpoetsignup.*/', $keys );
    
    		// if we have posted fields
    		if( ! empty( $mailpoet_signups ) ) {
    
    			// go through each one
    			foreach( $mailpoet_signups as $mailpoet_signup_field ) {
    
    				// get the value
    				$_field = trim( $posted_data[ $mailpoet_signup_field ] );
    
    				// and see if it matches
    				if( $_field == $submitted )
    					return true;
    
    			}
    		}
    	}
    	return false;
    }
    // that's all folks!
Viewing 15 replies - 1 through 15 (of 22 total)