Home › Toolset Professional Support › [Resolved] Different Woocommerce products for different users
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: Asia/Karachi (GMT+05:00)
Tagged: Views plugin
This topic contains 11 replies, has 3 voices.
Last updated by Waqar 5 years, 8 months ago.
Assisted by: Waqar.
Hello,
I would like to have different products for different users (not roles).
More specifically, I would like to create custom digital products for different users, which are not available to anybody else.
I've read this thread below from 4 years ago, and was wondering if there is now a better/easier way to achieve this?
https://toolset.com/forums/topic/different-products-for-different-users-in-woocommerce
Thank you in advance,
Anthony
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
Hi Anthony
Can I get a little more info about how you plan to use this?
User A should "have" product A
User B should "have" products B1 and B2
etc.
What is the intention here?
That users visit the standard WC shop page and see the subset of products which apply to them?
Or each user will "have" only a single product, and you don't necessarily want the users to go to the shop page but you will display the product on some other page, and the current user (i.e. logged in user) should only see their product in that case?
And when it comes to assigning products to users, what's the workflow for this?
Hi Nigel,
Thanks for your reply.
What I’m trying to achieve, is a system so that customers can log in to view purchase(s) made offline. It’s effectively a record, both for the customer and for the site owner.
The workflow is as follows, once a customer has signed up:
1) Customers purchase an item over the phone
2) The item details are entered into a WooCommerce product (I figured WC is the best thing to use, as the admin will be able to view an aggregated list of all purchases and it’s easy to create extra fields, custom taxonomies, etc - but I’m happy for feedback here!)
3) The product is assigned to the Customer as a purchase
4) The customer can login and view a list of items they’ve purchased, and download a PDF invoice
If you can recommend a better way to achieve this, I would be very open to hearing it.
As a side question please, it is also possible to have pages/downloads for specific users only. In other words, customisable content and downloads on a per-user basis (without WooCommerce), using Toolset?
Thank you in advance,
Anthony
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
Hi Anthony
I'm not sure it makes sense to use WC for this, because a large part of WC relates to the checkout process and creating and managing orders for products, most of which you are not talking about using.
You could create a custom post type, let's call it "purchases", and add a variety of custom fields and taxonomies to flesh out the content as required.
When a customer makes a purchase over the phone, a "purchase" post is published recording its details, and assigning it to the customer (the easiest way to do that is to just make the customer the post author).
You can then have a page "my purchases" which includes a View to list purchase posts that includes a Query Filter to only show posts authored by the current user, so when the customer is logged in and visits that page they will see their purchases.
They can click links to see details of the individual purchase.
A missing part is how to generate a PDF from the post, but you would have the same issue with WC, I think. It's not a feature of Toolset, but you could surely find a plugin that adds such functionality.
Your administrators could see the purchase posts in the backend, or could have a front end custom search where they can filter the purchase posts for a particular customer (or by other fields/taxonomies as required).
Is there something missing there that you would need WooCommerce for, do you think?
Thanks for your help, Nigel. I need to give this some thought!
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
Yep! Let me mark this as awaiting your feedback so it's not sitting in my queue.
Quick Q, please:
<<You could create a custom post type, let's call it "purchases", and add a variety of custom fields and taxonomies to flesh out the content as required.>>
If I go down this route, am I correct in saying that I can create a dynamic HTML template to display the data on the frontend in my own style? this would actually be very helpful. How easy is it to create these templates?
Thanks!
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
Yes, that's right, it is one of the core features of Views (and also available with Layouts).
If you go to Toolset > Content Templates you can create a new template and assign it to a post type (e.g. a "purchases" post type).
You insert whatever HTML and fields (via shortcodes, inserted with the Fields and Views button) you need in the template, and then it will be used to display purchase posts.
Specifically, it will replace that part of the page where your theme would normally output the post body of single posts, so the header, footer, sidebar, and likely some post content such as the title and author, would be output by the theme, but the content is replaced by your content template.
Some page builders are supported for designing content templates if you prefer to use those, although we have a fairly major update coming soon where you can use the new Blocks editor to design templates and you may find you don't need a page builder.
See https://toolset.com/documentation/getting-started-with-toolset/create-templates-to-display-custom-posts/ for more.
Hi Nigel,
Thanks so much for this - I think I’ve cracked it but I still need some more help, please!
1) I’ve created the view ‘list of purchases’ (clickable ‘Name’, ‘ID’) - whereby you can click into the purchased item to view the entire list of fields per item. How can I make the purchased item page itself look better? Specifically, I’d like to create an template that resembles a professional certificate (and thus, can be saved to a PDF via the web browser). I have a background I’d like to use for this.
2) I’ve noticed that, even after allocating an Author, I can still click directly onto a ‘purchase’ when not logged in. As the details are confidential, I’d like them to only be visible to the author only and not public. How can I achieve this?
3) Is it possible to rename Author to ‘Owner’?
Finally, I’ve tried many times but haven’t yet managed to speak to an operator via live chat feature on Toolset. I reckon these issues could be solved in 15 minutes with live help. Is this operational?
Thanks again,
Anthony
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
Hi Anthony
1. When you create a custom template within Toolset (either a Content Template, or a template made with Layouts) it replaces just the content area of the page (e.g. the "Welcome to WordPress. This is your first post. Edit or delete it, then start writing!..." part of the Hello World! post).
The header, footer, sidebar, and typically the post title and meta such as post author and date are generated by your theme.
Depending on your theme it may have options for no sidebar and no header & footer, or alternative headers and footers than are used throughout the site (e.g. for landing pages).
If your theme doesn't have an easy way to change these within the admin pages you can create a dedicated PHP template for these particular pages, but that requires some coding knowledge. If your post type is "purchases" then you could duplicate the single.php template and rename it single-purchase.php to use as a starting point.
When you edit a Content Template it's basically an HTML editor that you can insert dynamic fields in via shortcodes, but you can use a number of page builders to make the process easier (not forgetting, of course, that you can create templates with Layouts which gives you more control over the placement of fields without needing to know much of the underlying HTML). Also, we will soon have a pretty big update that makes designing templates with the new blocks editor a viable alternative to paid page builders.
But in any case, if you want more control over the header, footer etc. that is dependent on the theme options (check the list of recommended themes which include support for setting theme options at the template level: https://toolset.com/documentation/recommended-themes/), unless you are able to go down the route of editing a specific PHP template.
WordPress doesn't feature anything for converting posts to PDFs, nor does Toolset, but if you search you should be able to find a plugin that offers such functionality (I don't have a particular one to recommend).
2. If you don't want the purchases to appear in the list in the first place to anyone other than the person they belong to, then you need to add a filter to your View for the post author, i.e. to only show posts where Post author is the same as the logged in user (screenshot).
3. Where is author appearing that you would want it to show Owner instead?
Hi Nigel,
Thanks for this.
1. This requires further investigation - my theme is Impreza (which uses WPBakery) and I'm having difficulty in creating the Layout (for the item view). Please can you help with this? I've spent hours researching but to no avail.
2. I have done this for the 'list of items' view and this is working fine; however, it's still possible to click into an item itself, if logged in as another user. Please help - the details are per customer and mustn't be viewed by anyone else. Is this in any way related to the above?
3. That's correct
Thanks Nigel, your help is much appreciated.
Hi Anthony,
Thank you for waiting and since Nigel is busy with some other tasks, I'll be happy to follow up.
1. As much as we would like to help, the support that we provide is limited around the code and the features from our own plugins ( ref: https://toolset.com/toolset-support-policy/ ).
If you need assistance around the code, layout, and/or features which are coming from the theme, it would be best to consult the theme author, for most accurate and updated information:
hidden link
2. Can you please share some example links which are still accessible from other users?
3. Can you please also share the link to a page where you'd like to rename 'Author' to 'Owner'?
regards,
Waqar