Skip Navigation

[Gelöst] Help with Filtering posts for pagination

This support ticket is created vor 7 Jahre, 10 Monate. 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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 19 Antworten, has 2 Stimmen.

Last updated by joshB-6 vor 7 Jahre, 10 Monate.

Assisted by: Minesh.

Author
Artikel
#409376
Filter Section.jpg
Query Section.jpg

I am trying to: Create Pagination between Auction Lots (child) of a particular Sale (parent)

Here is a basic workflow:
Visitor comes to the sale view page:
hidden link

Visitor selects an auction Lot they want to see:
hidden link

I expected to see: The Auction Lot details for the above mentioned Auction Lot.

Instead, I got: The first auction Lot in the database, i.e. Lot 1 from the first sale in the db

I am trying to get this view to paginate between the auction lots in the same parent sale.

I am pretty sure that I should be using the query filter to select only auction lots that share a common parent however I am yet to be able to figure out the correct way to do this.

Currently there is no filter selected which is why I am certain that 1) the wrong lot is displaying, i.e. the lot displayed does not correspond to the post title, and 2) all the lots in the database appear, not filtering out only lots that belong to the parent.

The Filter editor is pretty basic at the moment as all I have in the pagination:

[wpv-filter-start hide="false"]
[wpv-pager-prev-page][wpml-string context="wpv-views"]Previous Lot[/wpml-string][/wpv-pager-prev-page]
[wpv-pager-current-page][wpv-pager-nav-dropdown]
[wpv-pager-next-page][wpml-string context="wpv-views"]Next Lot[/wpml-string][/wpv-pager-next-page]
[wpv-filter-end]

The Loop Output section looks like this, but i don't have a problem with it, besides the fact that it is displaying the wrong info:

[wpv-layout-start]
	[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
<div class="Auction Lot Box">
  <link rel="stylesheet" href="<em><u>hidden link</u></em>">
  <script src="<em><u>hidden link</u></em>"></script>
  <script src="<em><u>hidden link</u></em>"></script>
  
  <div class="container">
    
    <div class="row">
      <div class="col-sm-8"><h3>[wpv-post-title]</h3></div>
    </div>
    
    <div class="row">
      <div class="col-sm-4">
        <div class="row">[types field="image" size="large" align="centre" resize="pad" padding_color="transparent"][/types]</div>
        <div class="row">[wpv-post-body view_template="None"]</div>    
          [wpv-conditional if="( $(wpcf-write-up) ne '' )"]
            <div class="row"><h4>Write Up</h4></div>
            <div class="row">[types field="write-up"][/types]</div>
          [/wpv-conditional]
        </div>
        <div class="col-sm-3 col-sm-offset-1">
          <div class="row"><h4>Sale Details</h4></div>
          <div class="row"><b>Sale Name:</b> [types field="sale-name" id="$sale"][/types]</div>
          <div class="row"><b>Location:</b>  [types field="location" id="$sale"][/types]</div>
          <div class="row"><b>Date:</b>      [types field="start-date" id="$sale"][/types] - [types field="end-date" id="$sale"][/types]</div>
          <div class="row"><h4>Lot Details</h4></div>
          <div class="row"><b>Lot: </b>[types field="lot-number" format="FIELD_VALUE"][/types] <b>Session: </b>   [types field="session-number"][/types]</div>
          <div class="row"><b>Category:</b> [types field="lot-category"][/types]</div>
          <div class="row"><b>Low Estimate:</b>  R[types field="low-estimate"][/types]</div>
          <div class="row"><b>High Estimate:</b> R[types field="high-estimate"][/types]</div>
          
          [wpv-conditional if="( $(wpcf-dimensions) ne '' )"]
            <div class="row"><b>Dimensions:</b>    [types field="dimensions"][/types]</div>
          [/wpv-conditional]
          
          [wpv-conditional if="( $(wpcf-condition) ne '' )"]
            <div class="row"><b>Condition:</b>     [types field="condition"][/types]</div>
          [/wpv-conditional]

          [wpv-conditional if="( '[wpv-post-field name="wpcf-end-date-datetime" id="$sale"]' lt 'TODAY()' )"]
            <div class="row"><b>Status:</b> [types field="sold-unsold"][/types] </div>
          [/wpv-conditional]

          [wpv-conditional if="( $(wpcf-sold-unsold) eq 'sold' )"]
            <div class="row"><b>Hammer Price:</b><font color="green"> R[types field="hammer-price" format="FIELD_VALUE"][/types]</font></div>
            <div class="row"><b>Hammer Plus:</b><font color="green"> R[types field="hammer-plus" format="FIELD_VALUE"][/types]</font></div>
          [/wpv-conditional]
          <br>
          <div class="row">[addtoany]</div>
          [wpv-conditional if="( '[wpv-post-field name="wpcf-end-date-datetime" id="$sale"]' gt 'TODAY()' )"]
            <div class="row">
              <br><b>Absentee Bid Form: </b><a href='[types field="absentee-bid-form"][/types]'>Download</a>
            </div>
            <div class="row">
              <b>Condition Report:</b> [expand title="Click Here"][contact-form-7 id="35935" title="condition report"][/expand]
            </div>
          [/wpv-conditional]
        </div>
    </div>
  </div>
</div> 
</wpv-loop> 
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"] No lots have been added to this sale [/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]

I look forward to some advice an guidance for my problem.

Kind Regards.
Josh

#409545

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

As I understand - following is link your parent
=> hidden link

And you want display only records which are child of above parent. If this is true, you need to add query filter:
- Add Post relationship filter
- Select "Post where this View is shown"

does this help to resolve your issue?

#409603
Screen Shot 2016-06-22 at 10.02.55 AM.png

Hi Minesh

Thank you for your reply.

Unfortunately it does not help

That option does not appear to be there for me, please refer to screenshot

#409608

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

Select:
- Post Relationship - Post is a child of
- further select - - Select "Post where this View is shown"

#409614

Hi Minesh.

I have tried that previously but enabled the setting for you to see.

If you go to an example of a "sale" page such as this one hidden link
or this one hidden link

If you click on any of the lots get the error message saying there is no data. "No lots have been added to this sale"

The setting mentioned above was one of the first I tried but to no avail.

Please advise?

#409622

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

I need to check on your install, how you setup the things.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#409706

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

When I tried to access "wp-admin" it says:

You do not have sufficient permissions to access this page.

Could you please grant full permission to the user you created for me.

#409709

Sorry I have granted you admin rights now.

#409988

Hi Minesh.

Did you win with the Admin Login?

Josh

#410054

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

As I understand:

hidden link
=> Above URL displays Auction Lots, so when you click on any Auction Lot , you want to display only Auction Lots that are belongs to parent "ash-ct-auction-7-8-june-2016". is this correct?

#410059

100% correct. so if a customer clicks on any auction lot in Parent hidden link they will only see that particular lot and be able to page forward and back between lots belonging to the same parent.

Example. If the visitor clicks on this lot, which is Lot #2:
hidden link
The pagination should let them click back to lot 1 and forward to lot 3 etc..

#410072

I am not sure if you were working on the site, but the host went down for 15 minutes. Back up and running now.

#410326

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

That way pagination will not work.

I may help you to display only childs for selected parent sale but the pagination will be applied on the child post found and will be displayed child on different page.

#410346

So, as a potential solution I need to put the same name as a new field on the auction lot CPT?

Why is this not possible, I spent a log time last night browsing the forum and it seems like a common request that comes through.

Is it a possible future update or integration?

I am having a similar problem on an advanced search page where I am unable to have a filter called "sale-name" on the same page as filtering by auction lot fields. Would you say this is the same problem as well? and would adding the sale name as a field on the Auction lot CPT too be a solution as i suspect?

#410350

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

Pagination will work to the view's content type it attached.

The solution will be for you is you should pass a parent post ID as URL parameter and then add query filter "Post relationship - post is a child of" and select "Post with ID set by the URL parameter ".

This way - you are passing the parent ID as URL parameter and child view catch parent ID as URL parameter and your child view will display only posts that belongs to the parent which you passed as URL parameter.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.