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 4 years, 4 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
November 19, 2019 at 6:02 pm #517819
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
November 19, 2019 at 6:14 pm #517826If 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.
November 19, 2019 at 8:17 pm #517847No, 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
November 19, 2019 at 8:46 pm #517848Hi 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.
November 20, 2019 at 6:55 am #517885Select 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.
November 28, 2019 at 1:41 pm #519018Thanks 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.
November 28, 2019 at 9:21 pm #519084We are unable to help with customizations here in the forum. If you need help you can contact a GD Expert here:
November 28, 2019 at 11:25 pm #519093Hi 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,
November 29, 2019 at 12:29 am #519106Hi 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
November 29, 2019 at 5:43 pm #519229Great. 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
November 29, 2019 at 6:32 pm #519233You are very welcome! 🙂
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket