This support ticket is created 7 years, 4 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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
Your site is too complicated to understand as it has hundreds of fields but its OK 🙂
Now, I review your site and as I understand, on checkout page you have two different products one is for home display and one is for top display.
Now, you want that if user by product with product ID 1174 (home), it should display at home page and when user buy this product the taxonomy term "inhome" should be assigned automatically so that with view one home page which is displaying product you can add filter there and you filter that view by inhome taxonomy term - correct?
I did not ask you to make changes but could you please confirm the flow which I explained in my previous reply.
What I was saying that and I want confirmation on that:
I review your site and as I understand, on checkout page you have two different products one is for home display and one is for top display. - correct?
Now, you want that if user by product with product ID 1174 (home), it should display at home page and when user buy this product the taxonomy term "inhome" - correct?
That means taxonomy term "inhome" should be assigned automatically so that with view one home page which is displaying product you can add filter there and you filter that view by inhome taxonomy term - correct?
See this entry - I've set payments taxonomy term "inhome" for this product:
=> hidden link
Check the view where I've added taxonomy query filter for taxonomy payments - section "Query Filter":
=> hidden link
As - taxonomy term "inhome" is set its displaying on home page:
=> hidden link
So - what I want to confirm finally is - when user will buy product with product ID 1174 (home), it should display at home page (so - we need to automate the process of assigning "inhome" payment taxonomy term when we buy this product) - correct?
Luo, your code works well - when you add to the "In home" option, the post is shown on the main page.
I have 6 CRED forms for adding posts and 3 highlighting options. I understand that I need to repeat this code for everyone, right?
If so, unfortunately I do not know how - I did it, but wrong, because it does not work.
1. I repeated your code and changed the product ID, CRED form ID, and the "Payment" option ID - for the "featured" option.
2. I added a new post by selecting the "In home" and "featured" options.
3. Post is added, but not on the home page.
What should the shortcode for "featured" or "intop" look like? I want to put this on the list of posts to see if it works, but I do not know how to write such a shortcode now.
I understand that the Custom field "featured-opt" I have previously created is not useful and can be deleted, right?
$cred_form_ids = array(39);// here you can add more CRED form IDs
For example you can apply the custom codes to more CRED forms, like this:
$cred_form_ids = array(39, 123, 456);// here you can add more CRED form IDs
Please replace 123, 456 with your CRED form IDs
2) you can specific other products post to specific term, for example, from:
if($product_id == 1174){ // this is product ID of "home"
$terms[] = 795; // this is term ID of "inhome"
}
To:
if($product_id == 1174){ // this is product ID of "home"
$terms[] = 795; // this is term ID of "inhome"
}
if($product_id == 123){ // this is product ID of "featured"
$terms[] = 456; // this is term ID of "featured"
}
Please replace 123 with product ID of "featured", replace 456 with term ID of "featured"
For other new questions: What should the shortcode for "featured" or "intop" look like?
please create new thread for them, this will help other users to find the answers. thanks
"What should the shortcode for "featured" or "intop" look like?" - without this I can not verify whether the "featured" and "intop" options work correctly. But ok - I will create a new topic.