How best to manage registered users for MarketPress

Yes, I am well. Thank you. :wink: And, no you may not have access to muck around in my settings.

I have been attempting to set up marketpress even though it seems from searching online that virtually nobody actually uses it. Even the plugin authors can't seem to be bothered to write a decent Getting Started guide or provide a ReadMe file.

It seems like it should work okay for this site, for now, as long as I keep everything extremely simple.

Anyway, I was finally getting into testing the checkout process and I notice that it is throwing up an option to log in or checkout as a guest.

Oh, boy. That's not simple.

For simplicity's sake, and to not try to do anything marketpress cannot do, we planned on skipping all that and not saving any customer info for now. But, if we want to do that, marketpress makes checkout awkward and exposes our login area unnecessarily We have scoured the settings and can't find any way to change it.

Question 1: If we don't want to save customer info, can you describe which part of the code we'd need to change, e.g. which actions or filters we can tie into to change that behavior?

Then, we decided to go ahead and give customers the ability to register and login and have their address and other info saved for easier checkout, since marketpress seems to indeed have that ability.

Question 2: Does marketpress actually have that capability? Will it populate registered users address fields on checkout if logged in? What other integrations with the wp user system are provided?

Question 3: Which user profile altering plugins do you recommend to add profile and registration fields? I see that Membership 2 Pro can do it. But, it seems like overkill for this task.

Thank You!

  • Mark Russell
    • The Most Well

    Looks like I can use something like the Profile Builder plugin (And maybe also the Advanced Custom Fields plugin since the free version of Profile Builder does everything but actually build out the user profile fields. ) to create a simple user profile interface on the frontend plus registration forms.

    But, if I were to go to all that trouble, will MarketPress populate it's shipping and customer info fields with the saved user profile information? There's not much point for it unless it can make checkout easier for customers.

  • Adam Czajczyk
    • Support Gorilla

    Hello Mark Russell

    I hope you're fine today and thank you for your question!

    Question 1: If we don't want to save customer info, can you describe which part of the code we'd need to change, e.g. which actions or filters we can tie into to change that behavior?

    Since it's code/development related I'll need some consultation on this from our developers. I have already passed this question to them so please keep an eye on this ticket and we'll respond to you here as soon as we got additional info from our developers.

    Question 2: Does marketpress actually have that capability? Will it populate registered users address fields on checkout if logged in? What other integrations with the wp user system are provided?

    If a registered user made an order, filling in the billing/shipping form, data from that form would be remembered and used upon next purchase. It's stored by MarketPress itself.

    I'm not sure though what do you mean by "other integrations with WP User system", could you elaborate a bit on this please?

    Question 3: Which user profile altering plugins do you recommend to add profile and registration fields? I see that Membership 2 Pro can do it. But, it seems like overkill for this task.

    Membership 2 Pro cannot add fields. It has a "Profile Fields" add-on which you most likely are referring to but that add-on is not for creating/adding new fields - it's for managing what fields would be visible/required on registration/profile editing form. Adding new fields to registration - if Membership 2 Pro is used - also requires either custom coding or additional plugin, for example those that you already mentioned or BuddyPress.

    But, if I were to go to all that trouble, will MarketPress populate it's shipping and customer info fields with the saved user profile information? There's not much point for it unless it can make checkout easier for customers.

    The billing and shipping fields are already included in MarketPress, there's no need to use any additional plugin for this. Information provided there upon initial purchase will be auto-populated upon next purchases.

    Kind regards,
    Adam

  • Mark Russell
    • The Most Well

    Thank you, Adam! I love the way you get to the point and answer questions so clearly. I don't know if you have anything to do with producing this plugin. But, whoever is in charge should hire you to write that sorely needed walkthrough type getting started guide that explains things like the flow of customer data and how and where it's stored.

    Now I'd like to know all about how MarketPress stores this data, how to retrieve it, and/or any shortcodes or actions already included to handle it. Why should I have to come ask on a forum for this information when this plugin has been around for years at least...

    You've already done enough, Adam. But, maybe ( and it's doubtful because I've searched for weeks and found nothing on actually using MarketPress... like nobody uses it? spooky ) maybe you could point me towards some info on this stuff? Thanks

    P.S.

    I'm not sure though what do you mean by "other integrations with WP User system", could you elaborate a bit on this please?

    MarketPress seems to create a "Customer" subscriber type. I'd like to know all about that and how that is normally used. I also wanted to know how MarketPress interacts with the user profiles since I thought I had to store the address info in there. Now that I hear MarketPress stores it, I need to know all about that... not only good documentation of the code, but how it is normally used by admins.

    In fact, I need to know all about just about every aspect of this plugin if we're going to seriously use it for ecommerce. I don't appreciate getting charged each month for undocumented plugins and the "privilege" to ask every little question I ever have on your support forum.

  • Mark Russell
    • The Most Well

    Membership 2 Pro cannot add fields. It has a "Profile Fields" add-on which you most likely are referring to but that add-on is not for creating/adding new fields - it's for managing what fields would be visible/required on registration/profile editing form. Adding new fields to registration - if Membership 2 Pro is used - also requires either custom coding or additional plugin, for example those that you already mentioned or BuddyPress.

    Since MarketPress stores these values on it's own, it isn't necessary to add any fields. So, then are you saying that Membership 2 Pro is a good solution for this? It would need to keep users out of the admin area though.

  • Adam Czajczyk
    • Support Gorilla

    Hello Mark Russell

    Thank you for your response and I'm sorry for keeping you waiting!

    I don't know if you have anything to do with producing this plugin. But, whoever is in charge should hire you to write that sorely needed walkthrough type getting started guide that explains things like the flow of customer data and how and where it's stored.

    Thank you! I didn't have anything to do with the plugin creation/coding and I'm not a developer, neither involved in a project management, I'm merely a support guy who tries to help as much as possible :slight_smile: But I appreciate these kind words a lot!

    Now I'd like to know all about how MarketPress stores this data, how to retrieve it, and/or any shortcodes or actions already included to handle it. Why should I have to come ask on a forum for this information when this plugin has been around for years at least...

    Yes, I know what you mean. I suppose the plugin wasn't really meant to be extended or integrated with other plugins/tools in a "custom way" at the beginning and then it was growing and changing over time... but that's honestly just my guess. But I fully understand your point and I'm really sorry that such docs weren't so far provided. I hope though that I and my colleagues will be able to assist you as much as you need (within the scope of the support).

    But, maybe ( and it's doubtful because I've searched for weeks and found nothing on actually using MarketPress... like nobody uses it? spooky ) maybe you could point me towards some info on this stuff? Thanks

    That'd be "yes and no". "No" because there's still no full, complete "developers docs" for MarketPress. But there are are some things that can be checked:

    - a usage guide here: https://premium.wpmudev.org/project/e-commerce/#wpmud-hg-project-documentation

    - in-built guide about MarketPress templating that you'll find on "yourdomain.com/wp-content/plugins/marketpress/ui/themes/Theming_marketPress.txt" URL (or from a link on "Store Settings -> Presentation") page

    - full list of shortocdes (but explanations are further down the file as comments to shortcode functions) in the "/wp-content/plugins/marketpress/includes/public/class-mp-short-codes.php" file

    - list/code/explanation of available "template tags"/functions that you'll find in the "/wp-content/plugins/marketpress/includes/common/template-functions.php" file

    + there's quite a lot of action/filter hooks but those are, unfortunately, only documented in the code. So if you got any further/specific questions, please ask and I'll do what I can to help.

    MarketPress seems to create a "Customer" subscriber type. I'd like to know all about that and how that is normally used. I also wanted to know how MarketPress interacts with the user profiles since I thought I had to store the address info in there. Now that I hear MarketPress stores it, I need to know all about that... not only good documentation of the code, but how it is normally used by admins.

    I probably should be a bit more specific. The data is not "in a user profile" in that sense that it's not stored as a "plain data" and is not "hooked up" to the profile page. But it is in fact stored in _usermeta db table so it can be fetched, updated and removed just like any other user meta.

    For example:

    - meta_value for "mp_billing_info" meta_key for a given user ID is billing address info
    - "mp_shipping_info" would be shipping address
    - "mp_order_history" is, accordingly, a history of user's orders

    Basically "meta_value" for a "meta_key" that starts with "mp_" would in most cases be MarketPress "user" data. What's important to remember though is that everything there is stored as serialized arrays.

    Since MarketPress stores these values on it's own, it isn't necessary to add any fields. So, then are you saying that Membership 2 Pro is a good solution for this? It would need to keep users out of the admin area though.

    Now I admit I'm a bit confused :slight_frown: MarketPress stores that data for registered users. You can keep users away from admin area but to store that you'd still need to let them register. Otherwise the data will only be kept "temporarily" (I think in cookies but I'm not 100% sure about this) but not permanently in the db. For the registered users (and logged in, even if they don't have access to the back-end) that data will be stored as explained above. Still, to make it visible anywhere else than on checkout form, you'd need custom code to fetch these meta_values from _usermeta table.

    Kind regards,
    Adam

  • Panos
    • SLS

    Hi Mark Russell ,

    Question 1 : On Guest checkout, checkout info is stored in sessions, they are not stored in db, as Adam already mentioned.

    Question 2 : Yes. It populates shipping and billing fields if member is logged in and has already done an order with this user account. If you want, you can remove those with the following snippet:

    add_action( 'mp_order/new_order', function( $order ){
    
    	$post = get_post( (int) $order->ID );
    	$user_id = $post->post_author;
    
    	delete_user_meta( $user_id, 'mp_billing_info' );
    	delete_user_meta( $user_id, 'mp_shipping_info' );
    
    } );

    Question 3 : MarketPress stores shipping and billing info serialized in user's meta. It has certain fields that it uses in the checkout page. In case you need to add/edit fields with other user meta there is no integration with any profile plugin but we can provide some custom snippet that could help here.

    If you need some specific additional user_meta fields added upon new order, this is possible also with some snippet.

    Please let us know if you would like us to provide some code for Question 3.

    Kind regards!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.