WordPress.org

Ready to get started?Download WordPress

Forums

MarketPress - WordPress eCommerce
[resolved] disabling profile change on shipping and billing (12 posts)

  1. Robin W
    Member
    Posted 11 months ago #

    I have wordpress 3.5.1, BBpress 2.3.1 and Market Press lite 2.5.1 running on a child theme of twentyten.

    Marketpress is great !

    http://www.gospbc.co.uk

    BBpress allows users to edit their profile, which is really useful and lets me hide the toolbar in wordpress.

    However this edit profile shows not only the BBpress data, and allows them to change passwords etc - which I want/need them to do, but also shows the billing and shipping info from Marketpress, which I would prefer they didn't get the chance to amend, as this could lead to confusion say on what address was used to ship to etc.

    I presume there's a bit of Marketpress that "adds" this to the profile. Is there a simple (or complex!) way to stop the user being able to access this, whilst obviously letting marketpress store this info.

    If so, can I disable it or better still make it a role based view, so that admin can change it but user can't eg a place where I can add an if statement such as
    <?php if ( current_user_can( 'edit_users' ) ): ?>

    http://wordpress.org/extend/plugins/wordpress-ecommerce/

  2. Hello there @robin-w,
    I haven't tried this, but you could try commenting out line 371 of the marketpress.php file:
    include_once( $this->plugin_dir . 'marketpress-bp.php' );

    But I'm not so sure that will help... I mean, users can change their shipping address etc from /wp-admin/profile.php anyway! and having the ability to change an address is a pretty useful feature in the long run as not everyone stays at the same place all their lives!

    Cheers,
    Ari.

  3. Robin W
    Member
    Posted 11 months ago #

    Aristath,

    Thanks for that, got me thinking a bit more about it.

    I worked out Marketpress hooks onto an action in BBpress form-user-edit
    <?php do_action( 'bbp_user_edit_after' ); ?>

    to add shipping and billing info.

    Interestingly this has a bug, in that marketpress seems to be looking at a variable that is the ID of the logged-on ID, not the displayed ID, so when I as admin view the bbpress profile of anyone else via BBPress, I see my own details come up as their shipping address.

    Anyway I commented out the line in form-user-edit, and now it is disabled in BBPress profile, but available for admins in toolbar.

    It would of course be better to be able to do a

    Remove_action ('bbp_user_edit_after' , 'whatever marketpress function') but cannot work out where this function is set !

  4. Mike
    WPMU DEV Support Staff
    Posted 10 months ago #

    Hi @Robin W

    I'm afraid that we don't offer support for custom code, but out of interest did you get this sorted?

    If you have no more questions please mark this as resolved, this keeps the forum tidy so we can quickly identify the threads where people still need help :-)

  5. Robin W
    Member
    Posted 10 months ago #

    I had to go for custom code to fix this, but it Wasn't support for custom code I was after, just where abouts in the code marketpress sets the function that hooks shipping and billing onto the profile on bbpress.

  6. Mike
    WPMU DEV Support Staff
    Posted 9 months ago #

    Hi @Robin W

    Sorry about that I miss read. Have you sorted this out now or do you still need assistance?

    If you have sorted it out, please mark the thread as resolved, if you still need help, please ask your question again and we'll see if we can help :-)

  7. Robin W
    Member
    Posted 9 months ago #

    Mike,

    If someone from support could point me to the relevant bit, that would be great.

    To summarise

    I have Marketpres lite and BBpress. In BBpress there is an option to amend a users profile.

    Marketpress hooks onto an action in BBpress form-user-edit
    <?php do_action( 'bbp_user_edit_after' ); ?>

    to add the ability to change the shipping and delivery details.

    I presume it does this by adding an action, but can't see where it does this.

    So I commented out the line in form-user-edit, and now it is disabled in BBPress profile, but available for admins in toolbar.

    It would of course be better to be able to do a

    Remove_action ('bbp_user_edit_after' , 'whatever marketpress function') but cannot work out where this function is set !

  8. arohmann
    Member
    Posted 9 months ago #

    Hi Robin,

    I've checked MarketPress, and it doesn't directly hook into bbPress anywhere. Instead it only hooks the standard WordPress profile.

    It looks like bbPress just piggyback's off that action, (see bbPress functions.php line 959) which is why those fields are showing up.

    Doing something like this should remove it.

    global $mp;
    remove_action('show_user_profile',array($mp,'user_profile_fields'));
    remove_action('edit_user_profile',array($mp,'user_profile_fields'));
  9. Robin W
    Member
    Posted 9 months ago #

    Thanks arohmann - I'll have a play and see if that fixes it - much appreciated !

  10. Mike
    WPMU DEV Support Staff
    Posted 9 months ago #

    Hi @Robin W

    Hopefully that will help you achieve what you want to achieve.

    If it does, please mark this as resolved.

  11. Robin W
    Member
    Posted 9 months ago #

    Thanks

  12. Mike
    WPMU DEV Support Staff
    Posted 7 months ago #

    You're most welcome, I'm glad that we could help :-)

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.