• Resolved Robin W

    (@robin-w)


    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 !

    https://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' ) ): ?>

    https://www.ads-software.com/extend/plugins/wordpress-ecommerce/

Viewing 11 replies - 1 through 11 (of 11 total)
  • 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.

    Thread Starter Robin W

    (@robin-w)

    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 !

    Mike

    (@michael-copestake)

    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 ??

    Thread Starter Robin W

    (@robin-w)

    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.

    Mike

    (@michael-copestake)

    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 ??

    Thread Starter Robin W

    (@robin-w)

    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 !

    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'));

    Thread Starter Robin W

    (@robin-w)

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

    Mike

    (@michael-copestake)

    Hi @robin W

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

    If it does, please mark this as resolved.

    Thread Starter Robin W

    (@robin-w)

    Thanks

    Mike

    (@michael-copestake)

    You’re most welcome, I’m glad that we could help ??

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘disabling profile change on shipping and billing’ is closed to new replies.