Skip Navigation

[Fermé] Coupon Websiet with Business Profile and Coupons posts/pages

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.

This topic contains 8 réponses, has 3 voix.

Last updated by Adriano Il y a 8 années et 1 mois.

Assigned support staff: Adriano.

Auteur
Publications
#156170

Hi

I have recently purchased TVC Toolset; however, I am finding that I spend a lot of time to work out how to implement its features on my project. (Please note that I am not good with PHP, although I have tried to educate myself on its basics, I am not confident enough to use it unless there are step-by-step instructions).
I would really appreciate it if could direct me in the right direction or probably you would be able to tell me if it is possible to achieve what I want to achieve with TVS Toolset at all.
Here is what I am trying to do with as little as possible backend intervention:
• I am trying to build a website where local business can:
- Sign up (with recurring annual Paypal payment)
- Once the membership is approved, log on to the website
- Add or delete coupons (printable coupons, not coupon codes)
- Edit only some of the business information that they provide with the registration form (such as business description, logo, or photos, but not the website, business name, , address, city/location, registration number or contact number – just for security purposes)
(I have already purchased the Gravity Form developer’s licence and created a multi-step form with its User Registration and Paypal Addons. With this form, I am able to collect login details (username, password, email address) and business details (business name, business description, business registration number, logo, photos, address, tel number, website, two business categories from two sep drop down boxes (to limit the categories to two only)). The form is working perfectly fine; I can register users as authors; send them to Paypal to make the payment, and after receiving payments I can activate the membership with no problem)
• I do want the website to have a business profile page eg. mywebsite.com/business-name (preferable auto generated page by using the information provided in the registration form) and at the end listing the active coupons listed with coupon deal names linked to the coupon deal page

• When the user posts coupons, it want the website to create a coupon deal page for this particular coupon e.g mywebsite.com/business-name/coupon-deal-name (I also would like the coupon deal posts could be searchable for its location or business categories)

Here are my questions:
• How can I automatically create a business profile page or post (by using the data entered via the Gravity Forms registration form)
• If it is not possible to do this automatically, I am happy to manually enter in this information before I activate the membership (in this case should I be creating a post or a page)
• How can I allow user to amend some business profile fields (not all fields) (eg business description, logo and photos)
• Business and its coupons will be listed in certain categories and for certain locations (cities in this case), (categories will be limited to two categories and there will be one location that the the user can list its coupons) e.g accommodations, eating out etc. (in the business registration form I created two drop down box to choose from, or e.g. city-name to choose from a drop down box) How can I transfer these to TVC in a way that the user can publish coupons by choosing either or both of these categories only or the city chosen in the registration form?
• How did you guys add a Google map to your Real Estate site? (Can I auto generate this map by using the address details that the consumer has provided via the GF registrations form?
• Or any other suggestions, recommendations or things to watch out for in this planning process would be appreciated?

Thanks heaps

#156263

Amir
Supporter

Is your planned implementation going to save the business profiles as WordPress 'users' or 'posts'?

I'm asking this first, because it will determine a lot next. If you plan to save the business profiles as posts, you can implement everything here with CRED and Views. If these are 'users', you will need to implement the front-end creation and editing either with Gravity Forms or via the WordPress admin.

Let me know and we'll see how to implement it best.

#156285

Hi Amir, at the moment, my GF registration form creates "users" but does not create a profile page.
As long as I end up with a business page/post and individual page/post for each coupon, I don't mind how they are going to be saved. However, it sounds that saving business profiles as posts is the easier option. What I am trying to achieve is something like this website: hidden link
Looking forward to your response
Thanks in advance

#156310

Amir
Supporter

If you do all this with custom post types, I think that it would work a lot simpler. You will have full flexibility for everything.

I suggest to look into CRED for the registration process. CRED includes everything that you will need, including creating the posts and later editing them. You can connect between coupons and businesses using parent / child relationship. If you need tags and categories, you can also apply them to both the businesses and the coupons.

For integration with payments (to add coupons), look at CRED Commerce:
https://toolset.com/home/cred-commerce/

Would this work for you?

#156311

Amir
Supporter

Of course, to display the businesses and the coupons, use Views. Are you familiar with Views? If not, start with the tutorials here:
https://toolset.com/documentation/user-guides/getting-started-with-views/

#156378

Dear jamesH-3,

Question: How can I automatically create a business profile page or post (by using the data entered via the Gravity Forms registration form)?
R.: As Amir said before I would recommend you to use CRED instead of GF, because it is part of Toolset. Just to introduce you to how to create a CRED form, I would like to show this: https://toolset.com/documentation/user-guides/creating-cred-forms/

CRED has an API that might be used to trigger some functions when an action happens (when submit a form). I know that you are not a PHP developer, but anyway it is the documentation about the API: https://toolset.com/documentation/user-guides/cred-api/

So after create a CRED form to add some custom post type, you can trigger some function using cred_submit_complete hook to do that. Add the code below in functions.php of your theme:

add_action('cred_submit_complete', 'my_success_action',10,2);
function my_success_action($post_id, $form_data)
{
// if a specific form
if ($form_data['id']==101)  
{
$idUser = wp_create_user( $_POST['wpcf-username'], $_POST['wpcf-password'], $_POST['wpcf-email-address'] );
}
}

You need to replace the $form_data['id'] with the correct ID of the CRED form, also you need to replace the variables with the custom field correct names. So it is done, when you create a new post in this custom post type, a new user will be added in the database.

Question: How can I allow user to amend some business profile fields (not all fields) (eg business description, logo and photos)
R.: You should create a CRED edit form, and create a page (a dashboard page) where you can add a link to edit the this post. Take a look at this document on "Forms for editing content" section: https://toolset.com/documentation/user-guides/creating-cred-forms/

Question: How can I transfer these to TVC in a way that the user can publish coupons by choosing either or both of these categories only or the city chosen in the registration form?
R.: You can create custom taxonomies with Types to store this. This is a interesting documentation about how to do that: https://toolset.com/documentation/user-guides/create-custom-taxonomies/

Question: How did you guys add a Google map to your Real Estate site? (Can I auto generate this map by using the address details that the consumer has provided via the GF registrations form?
R.: To create a Google map custom fields, you simply need to create a new group of custom fields first: https://toolset.com/learn/use-a-fields-table-to-create-a-relational-real-estate-listing/#2

Then use a single line field to paste the Google map iframe HTML code. You need to use the iframe tag to automatically render the map in your page. Read here for details: hidden link

I would recommend some articles which will be very useful to understand the basic of Toolset:

https://toolset.com/documentation/user-guides/getting-starting-with-types/
https://toolset.com/documentation/user-guides/getting-started-with-views/
https://toolset.com/documentation/user-guides/view-templates/
https://toolset.com/documentation/user-guides/views/
https://toolset.com/documentation/user-guides/using-cred-to-create-and-edit-content-from-front-pages/
https://toolset.com/documentation/user-guides/using-cred-commerce-to-add-payments-to-forms/
https://toolset.com/documentation/user-guides/creating-cred-forms/
https://toolset.com/documentation/user-guides/setting-access-control/

Feel free to ask me more details if it was not clear enough. You can also create a discover site (discover-wp.com) to explain somethings. If you need to have access to edit files as functions.php I can create a test site for you which we can do some tests.

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.

#156936

Hi Adriano
Thanks for your detailed response. It will take a while to go through them.

I am trying to do work out how to do the registration using CRED forms.
I have created custom fields, then attached them to a custom type and then created a CRED form by inserting all of the fields I created; however, it does not seem to work.
Here is the code that I added to the punctions.php file:

add_action('cred_submit_complete', 'my_success_action',10,2);
function my_success_action($post_id, $form_data)
{
// if a specific form
if ($form_data['id']==77)
{
$idUser = wp_create_user( $_POST['wpcf-first-name'],
$_POST['wpcf-last-name'],
$_POST['wpcf-username'],
$_POST['wpcf-password'],
$_POST['wpcf-business-name'],
$_POST['wpcf-logo'],
$_POST['wpcf-website'],
$_POST['wpcf-address-line1'],
$_POST['wpcf-city'],
$_POST['wpcf-business-description'],
$_POST['wpcf-business-registration-number'] );
}
}

Thanks

#156961

Hi Adriano

I think I have found what I was doing wrong. When I created the form, I auto generated the form which seemed to have fixed the issue. I can now bring up the CRED form for registration. I have just tested it and it creates a user; however, in the profile page, all I can see is the username and the nickname which is the first name entered in the form.

Everything else seems to have gone nowhere?

Thanks

#157191

Dear jamesH-3,

First you need to know about the function I'm using wp_create_user. That's a WordPress default function which receive only 3 parameters ($username, $password and $email). So you can not do what you did, the correct is:

wp_create_user($_POST['wpcf-username'], $_POST['wpcf-password'], $_POST['wpcf-email']);

My idea is for each Profile (with all of these custom fields) to have an User. So I think that you don't need to create custom user fields to store this information, as they already are stored on its Profile page.

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.

Le sujet ‘[Fermé] Coupon Websiet with Business Profile and Coupons posts/pages’ est fermé à de nouvelles réponses.