Skip Navigation

[Résolu] Display child post as taxonomy

This support ticket is created Il y a 6 années et 3 mois. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Marqué : 

Ce sujet contient 4 réponses, a 2 voix.

Dernière mise à jour par Ljuba Il y a 6 années et 3 mois.

Assisté par: Nigel.

Auteur
Publications
#1084884
02.png
01.png

==> Tell us what you are trying to do?
Parent post Hotels have Child posts "Payments" (precisely > Payments Media Types, also known as Forms of the payments). Child post View is grounded on taxonomies (6 possible > CC/DC - Banks, Payment Gateways, ...). It meant that post content depends on selected taxonomy. So, if post is to set data for Bank Transfers, post should be displayed trough "Banks" taxonomy. Image 01 shows example of Content Template of the post (as it is modal, appear as icon). Basically, visitors can see what banks are available for bank transfer.

I created the View for Payments post to nest it in Hotel Content Template. For that View if I create Content Temp,late and place inside shortcode for taxonomies titles, all is displayed fine on Hotel (parent) frontend. But as I don't want the titles (template), I need to create single taxonomy template view and when I replace it, I have a mess (02). I think that No items mean that it list all posts (also without selected taxonomy = thats why) and for some reasons is displaye double (maybe even more if I will make more posts).

So, I'm bad (again) with filters and/or with logic where what I should to place.

Now I have >

Content Template (icons) > Single taxonomy View > Post View > parent Post Template

and it works as >

Taxonomy title > Post View > parent Post Template

#1085537

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+00:00)

Hi Ljuba

I read through this a few times and I'm still not sure I understand what you are aiming for.

I get that you have Alojamientos > Pagos and that there are several taxonomies for pagos (e.g. bancos, tipos de tarjeta etc.).

Right now you have one alojamiento post (Hostal Bumba) and all of the current Pagos posts belong to it, each with its own taxonomies set.

In the template for single alojamientos you have added a View "Post View de Pasarelos de Pago".

That View will list the pagos posts for the current alojamiento, i.e. for Hostal Bumba it will return the 6 child pagos posts, and iterate over each of them.

What is it that you then want to display?

In the Loop Output section you have inserted another View ("taxonomy-single-view-de-pasarelas-aceptadas-en-el-pagos").

So for each of the 6 child pagos posts you then run the taxonomy View which has a filter to set the term from the current post, and it will output fields for that term, if there is one, or No items found if not.

That doesn't sound right, but can you clarify just what it is you want to be displayed?

#1085761
01.png

Yeap, there is the mess.

EXPLANATION (attempt)

1) Goal is to present available 'payment methods' (payment forms or payment media), in sort of compact way (icons with modal). Available are:

==> Online payment (payment Gateway's taxonomy)

==> In-shop CC/DC payments (CC/DC taxonomy)

==> Cheques (same taxonomy)

==> Banks deposits, transfers (Banks taxonomy)

==> Other (same tax0nomy)

2) Taxonomies are chosen for reasons of Archive pages and availability that visitors can search (filter) ie Hotels who accept PayPal, but also for reason of possibility to be used same taxonomy for different purpose.

"DIFFERENT PURPOSE" (meaning and main problem)

Payment Gateways have different CC/DC coverage options, depends per country (by click on my icons of 2Checkout and PayPal, you will see in modal). In other words, PayPal Ecuador will charge ONLY FOUR CC/DC types (in US, it is 7).

Imagine that you are tourist and you see that I accept PayPal and you come with Union Pay card (what you can use in US), but I can't charge it. Huge problem, right? Same situation is with most in-store machines for CC/DC charge. machine issued by Banco Guayaquil for VISA will not charge Citibank (US or Ecuador CitiBank) VISA. So, if client publish that he charge VISA, but not expose that it is only for specific banks > PROBLEM.

Above implied necessity for child posts (but also will be more parents, not just within business), as ONE TAXONOMY PER POST can be used only once.

If you will open demo posts of Pagos, you will see 3 posts where appear MasterCard (2 are for online payments and one for in-shop payment). So business accept totally 6 types of CC/DC, but ONLY MasterCard is available for online and in-shop payment, where ONLY in-shop payment is without additional fees for payment, but ONLY is it is issued by Banco Guayaquil (in-shop machine issuer).

So, my front-end view display when you click on MasterCard, that you can use it trough PayPal with 6.5% of fees, 2Checkout with 3.9% of fees and in-store without any fees (but only if it is issued from Banco Guayaquil).

WHAT I HAVE (now)

1) I have done Content Template for front view (use name as "Plantilla de Pagos para Pasarelas de pagos aceptadas" and just replace Pasarelas de pagos for other to get access to other templates). That is what you see when you click on icon (see image 01) at the DEMO TEST TEMPORARY CODE PLACE (at top). Ffor Alojamientos, it is "Single Plantilla para Alojamiento" and code at top is:

    	<!--START OF THE CONDITIONAL ROW-->
            <div class="row section">
                <!--START OF THE CONDITIONAL COLUMN-->
                    <div class="col-sm-12">
                        <span>
                            [wpv-view name="post-view-de-pasarelas-de-pago"]    
                        </span>
                    </div>
                <!--END OF THE CONDITIONAL COLUMN-->
            </div> 
        <!--END OF THE CONDITIONAL ROW-->

2) Post View de pasarelas de pago 'call' single taxonomy view, what call .... (I just repeated what you wrote, as that is correct).

So, somewhere, I did some wrong query/filtration as it call me all posts and show me double.

Hopefully, I explained (sorry).

WHAT I WANT (EXPECT)

I expected that it will list me ONLY POSTS WITH Pasarelas de pago (2 post). Other template, ie with Bancos soportados, should to list me only posts with the Banks, .....and so on.

So, (on image 01) 2Checkout and Paypal are 100% fine, but it appear twice and there are also No items found.

#1085832

You wrote:
"So for each of the 6 child pagos posts you then run the taxonomy View which has a filter to set the term from the current post, and it will output fields for that term, if there is one, or No items found if not."

Well, that is what I want, but to not get 'No items found' (and to not get listed twice). So, I can't see other way how to display existing child posts list with specific taxonomy, trough that same taxonomy.

In View for supported Payment Gateways, I don't want to list posts where are not checked/selected any of gateway (taxonomy). For Banks, I want only with banks... ad so on.

#1086630

Thanks. Solved. It was as I assumed from begin, filter.