Skip Navigation

[Resolved] Front end posts to directory, with payments via Woocommerce

This support ticket is created 4 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

Author
Posts
#1608125

Hi there,

I hope that you're able to help with this, and thanks for your time.

Let me explain what i am trying to achieve, and hopefully you can let me know if and how this can be achieved in Toolset.

  • We have a directory of service providers on this website (here: hidden link ).
  • Site visitors are able to post their service to the directory, to promote to other site visitors.
  • I want to create a front end form for people to submit their services directly, using Toolset Forms (I know how to do this part).
  • When the form is submitted (this is the part I struggle with) I need to charge a fee for the listing.
  • The fee should be charged in WooCommerce, as this is the ecommerce solution we have o the site.
  • So they service should only be listed when payment is made.
  • A further complication: the price for a listing is €45 to list the service in one category. However, they should be able to add t up to four categories. The price for doing this is an additional €5 per additional category (on top of the initial €45 for the listing).
  • So the form needs to work out how much is owed, based on the number of categories selected for the listing to appear within.

I hope that all makes sense and look forward to your reply.

Thanks again for your time, and stay safe!
Andrew.

#1608883

Hello Andrew, and thank you for contacting the Toolset support.

I believe that this use case can be done with Toolset. Adding up to four categories will probably need some custom code.
Check the following article, it explains most of the requirements of your use case:
https://toolset.com/documentation/user-guides/front-end-forms/using-cred-commerce-to-add-payments-to-forms/

To charge different amounts, you can use different products:
- Default listing: €45
- Default listing + 1 category: €50
- Default listing + 2 category: €55
- Default listing + 3 category: €60
- Default listing + 4 category: €65

The custom code will be required for validation, to make sure that the number of categories is correct and the corresponding product is required. The validation code must use the cred_form_validate filter. Read more about it here https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate

For user experience, you may want to add a Javascript code that will allow the user to select only the required number of categories and disable selection after that. You may also want to select automatically the product depending on the number of categories, but true validation should be done with the cred_form_validate filter.
Check this answer on StackOverflow https://stackoverflow.com/questions/19001844/how-to-limit-the-number-of-selected-checkboxes

I hope this helps. Let me know if you have any questions.

#1613029

Hi Jamal, and thanks for getting back to me.

I'm struggling with that. Is there anyway, instead, to do the following (changes marked in bold):

  • We have a directory of service providers on this website (here: hidden link ).
  • Site visitors are able to post their service to the directory, to promote to other site visitors.
  • Users can choose which category to list their service in. This is limited to one category per purchase.
  • I want to create a front end form for people to submit their services directly, using Toolset Forms (I know how to do this part).
  • When the form is submitted (this is the part I struggle with) I need to charge a fee for the listing.
  • The fee should be charged in WooCommerce, as this is the ecommerce solution we have o the site.
  • So they service should only be listed when payment is made.
  • Users can choose whether to list for 3 months, six months, or twelve months, with different fees depending upon which they choose.

I hope to hear back from you soon.

Very best wishes,
Andrew.

#1613661

Hello Andrew,

To limit the user to one category per purchase, you can display the categories in a dropdown list. The categories can be displayed on the form as a dropdown list, checkboxes, or a multi-select list using the attribute "display" and the attribute "single_select". Read more about it here https://toolset.com/documentation/user-guides/front-end-forms/cred-shortcodes/#cred_field

[cred_field field='category' force_type='taxonomy' display='select' single_select='true']

To offer 3m, 6m, or 12m listing period, Toolset Forms introduced the expiration feature. Read more about it here https://toolset.com/documentation/user-guides/front-end-forms/automatic-post-expiration/
If you want to create a solution without custom code, you will need to create 3 products and 3 forms. The visitor should choose the offer, which will display the corresponding form.
Or you may use one form and 3 products, and use custom code to select the correct product depending on which offer.

Please follow this article, it has everything needed to charge a fee for a post listing https://toolset.com/documentation/user-guides/front-end-forms/using-cred-commerce-to-add-payments-to-forms/
You can start by a simple example until you get the payment and publishing working, then you can work on different offers.

Let me know if you have any trouble implementing any steps.

#1615843

Thank you. I'm going to give this a go and get back to you.

Is there no way I can setup a Grouped Product in WooCommerce (for different payment schedules) and link to that with the Toolset form?

Very best wishes,
Andrew.

#1616695

Hi Andrew,

Using a grouped product won't actually help, because the products are not linked to the forms. Instead, the forms are linked to products. Which means, that you either:
- Use 1 form per product. Without custom code.
- Use 1 form for all products with custom code that will select the correct product depending on the form data.

I'll remain at your disposal.

#1621875

Hi there,

I prefer option 1 (using one form per product). But can I ask, is there any way of linking this with a recurring subscription? So that someone can subscribe to three monthly renewals, for example? Perhaps with WooCommerce Subscriptions extension?

Very best wishes,
Andrew.

#1621955

Hi there.

I just wanted to follow up on my most recent post with more detail...

1. As mentioned above, is there a way of making the product that is linked to the form a recurring subscription? So that when the form is submitted, and the product purchased, the buyer is subscribed to renewals every 3 months, for example?

2. Is there a way to make the post that is created be removed from the site after the period of the listing that was purchased? So that if, for example, someone purchases a three months listing, the listing would be removed after three months

3. As with other Toolset post forms, is there a way for buyers to edit their directory entry after submission and payment?

4. I see that the way this works is that someone fills out the form and is THEN directed to the checkout to complete the purchase. However, what if someone selects the product in the site's store page first – how do they get to the form to fill it in? Or would you recommend that the form is included on the product page?

Thanks for your time, and very best wishes.

Stay safe,
Andrew.

#1622623

Hello Andrew and thank you 🙂

1. This can be done by a WooCommerce extension for subscription products, such as https://woocommerce.com/products/woocommerce-subscriptions/
Or you may add a subscription feature with custom code. Personally, I would not reinvent the wheel.

2. Yes, you can define an expiration period on the form that creates the listing on the first time. Check this article https://toolset.com/documentation/user-guides/front-end-forms/automatic-post-expiration/

3. Yes, that will require creating a Post edit form and add it somewhere so the user can use it. Check this article https://toolset.com/documentation/getting-started-with-toolset/publish-content-from-the-front-end/forms-for-editing/

4. Yes, the user needs to go through the form first, then go to checkout. There is no way for Toolset to link back to the form from the product. The form needs to be added to a post single page(page, post, product) or in a Toolset view or content template.
I would not recommend adding the form to the product page. I would add it to a page(e.g. /add-your-service).

However for support rules, we are able to handle only one issue at the time. This helps us to bring you a better service and also helps other users to find all the information here exposed. I think, please correct me if I am wrong, I have answered your original question and more follow up questions. For that reason, I have to kindly ask you to mark this ticket as resolved and open a new ticket for any other question.

Stay safe.
Jamal

#1622643

Hi Jamal,

Thank you for your reply.

I am almost done Just two more follow-ups I believe:

1. I'm aware that WooCommerce Subscriptions exists, and use it on many sites. I just wanted to check that it works with Toolset Forms Commerce to create recurring payment, as in places on your website it suggests that you do not. If so, then this is perfect.

2. On expiring posts, can they be set to expire only if a subscription is not renewed?

Thank you so much, your support has been excellent.

Very best wishes,
Andrew.

#1622813

Hello Andrew.

1. My apologies, that was my mistake. Indeed, Toolset has limited integration with WooCommerce Subscriptions. And we cannot link a Toolset Form to a subscription product. Check the faq section at the bottom of this article https://toolset.com/learn/create-membership-site-wordpress-using-toolset-plugins/how-to-use-the-woocommerce-subscriptions-plugin-with-toolset/

I also found an old ticket where one of the users claims that he get it to work with another plugin but not sure which one of them. Read this ticket here https://toolset.com/forums/topic/cred-form-with-woocommerce-subscriptions-and-recurring-payments/

2. No, the expiration cannot be bound to the subscription product. Maybe it can be done with custom code.

All the best.
Jamal

#1625339

So does this link: https://toolset.com/learn/create-membership-site-wordpress-using-toolset-plugins/how-to-use-the-woocommerce-subscriptions-plugin-with-toolset/ mean that i can or cannot use Toolset with Subscriptions to create a recurring fee for the listing?

If not, can I setup the simple product to expire after x months...AND have Toolset trigger an email to the user to tell them that their listing is about to expire and then another when it has expired? To prompt them to buy a listing again?

#1625517

Yes, you can't use a Toolset form for listing submission and make the user pay each month using WooCommerce subscriptions.

Yes, you can configure the post to expire after x months and send a notification to the user to prompt them to buy a listing again.
The configuration is not done on the product, but on the form. The product is used, here, for payment only, it is not used on the logic of expiration.

You can configure expiration following this article https://toolset.com/documentation/user-guides/front-end-forms/automatic-post-expiration/

For sending notifications when or before the listing expires, check the section "Sending email notifications when posts expire" of the same article.

#1625673

Thanks for this, great help again!

So when the notification is sent (for example, five days before scheduled post expiry) and the user wants to extend for another three months, what do they do?

Can they renew the payment on the same listing?

Or do they have to buy the product again fresh, and then retype an entirely new post?

Many thanks again,
Andrew.

#1625803

Hello Andrew,

I believe that you can do it also on an edit form. Check this screenshot hidden link

Create an edit form, remove all fields and keep only the submit button with a different value "Renew" or "Promote again" etc.
Once the user clicks on the button, he will be redirected to checkout to complete the payment.

Depending on your form settings, the post will change the status to publish after payment and change it back to "Pending review" when it expires.

I discussed again this case with another colleague, and he believes that the limit on WooCommerce subscription is only set for user creation not posts creation. I need to test it to confirm. You may want to test it for your case or use only Toolset Forms and simple WooCommerce products.

Please let me know what do you think and what you will get.

All the best,
Jamal