How to turn off Packages field and link featured to Woocommerce Membership?

This topic contains 10 replies, has 5 voices, and was last updated by  Stiofan O’Connor 2 years, 8 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #517819

    Nick Henley
    Full Member
    Post count: 29

    Hi there,

    Have read a bit about https://wpgeodirectory.com/docs-v2/places/custom/#featured but can’t see anything about situation when not using Pricing Manager. We are using WooCommerce Memberships and Ultimate member and have user Premium Member role/type set up with our various post-types. All working fine.

    Only issue is we cannot add listings to CPT or Places (renamed) without packages turned on and even then the add listing just hangs after submit and is not linked to WooCommerce.

    What is the best way to link WooCommerce Membership purchase and packages, or can we turn off packages completely and link to the featured capability in another way? We want Premium member purchases (in Woo) to have featured status.

    I read something about setting up an additional CPT field related to featured but that didn’t seem to work for that user…

    Please advise which direction we should go.

    Thanks, Nick

    #517826

    Alex Rollin
    Moderator
    Post count: 27815

    If you don’t need Pricing Manager then deactivate it.

    You are saying that when it is deactivated you cannot add listings?

    If that is the case please share WP Admin credentials and login URL in a private reply so we can take a look at the issue.

    About the premium membership and featured, that will require your own customization.

    #517847

    Nick Henley
    Full Member
    Post count: 29

    No, we haven’t got Pricing Manager installed. I said (meant to say) that when ‘select package’ is deactivated in CPT settings/form then we can’t add a listing.

    As I understand it we cannot turn off packages. Or does deleting all package options mean that field has no active role to play?

    Thanks for confirming that we’ll need to do some custom work on Premium membership and featured linking.

    I’ll wait for your reply before providing a private message and WP details. Thanks, Nick

    #517848

    Kor
    Moderator
    Post count: 16516

    Hi Nick Henley,

    Thanks for your reply. There could be some sort of conflict going on there and could you please go through this conflict test and see if it helps? https://wpgeodirectory.com/docs-v2/faq/troubleshooting/#conflict-test . If the issue persists, share your Website WP admin access here in private reply and we’ll check this out for you.

    #517885

    Alex Rollin
    Moderator
    Post count: 27815

    Select package can be removed from the custom fields if you do not have pricing manager installed. If that isn’t possible then please allow us to take a look.

    #519018

    Nick Henley
    Full Member
    Post count: 29

    Thanks Alex. OK have removed the packages (after we deleted the Pricing Manager) and have written some code to link WooCommerce purchase of premium listing to featured, but its not setting. Can you see the issue please?

    Here is the code

    function ds_post_inserted( $post_id, $post, $update ) {

    $user = wp_get_current_user();
    if ( in_array( ‘um_premium’, (array) $user->roles ) ) {
    add_post_meta( $post_id, ‘geodir_featured’, 1 );
    }

    }
    add_action( ‘wp_insert_post’, ‘ds_post_inserted’, 10, 3 );

    As you can see we are setting the featured field to 1 but it is not setting it.

    #519084

    Alex Rollin
    Moderator
    Post count: 27815

    We are unable to help with customizations here in the forum. If you need help you can contact a GD Expert here:

    https://geodirectoryexperts.com/

    #519093

    Paolo
    Site Admin
    Post count: 31205

    Hi Nick,

    I’ve flagged your request for a developer. As soon as they come back online they’ll look into your question and help you fix your function.

    Thanks for your patience,

    #519106

    Stiofan O’Connor
    Site Admin
    Post count: 22954

    Hi Nick,

    I think i see where the confusion is. We allow you to grab info via the standard wp meta functions by prefixing it with geodir_ but to update you can either $_POST The filed to the standard wp post update function or simply use our own meta function, like (note there is no prefix to the field)

    
    
    
    geodir_save_post_meta($post_id, 'featured', 1);
    

    Thanks,

    Stiofan

    #519229

    Nick Henley
    Full Member
    Post count: 29

    Great. Thanks for your help. We’ll be moving on to our second installation using GeoDirectory – this was our first hence learning a few tricks on the smaller one first. Nick

    #519233

    Stiofan O’Connor
    Site Admin
    Post count: 22954

    You are very welcome! 🙂

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket