Posts by tyler_hughes

    We have a client that is still on the foxycart app. We built their store a long time ago and they are dead set on using a credit card processor that is not supported in the new perch shop. Considering how old the foxycart app is at this point I have avoided upgrading their perch installation out of fear of losing the shop. Is it possible to upgrade to the newest version of perch or at least a newer version of perch than 2.8.24. They were on the final version of the foxycart app that was released.


    I am asking because our web host is forcing PHP 7 migration and this is our only hold out perch site that is in question.

    Hello tyler_hughes


    You can use the eqbetween option instead:


    PHP
    1. perch_content_custom('Event Details', [
    2. 'page' => '/events/*',
    3. 'filter'=>'event_date_start',
    4. 'match' => 'eqbetween',
    5. 'value' => '2018-08-01 00:00:00,2018-08-31 23:59:59'
    6. ]);

    This would work in theory but I need to get all events regardless of which year they start. Thanks for the input though. Drew's solution worked.

    I'd do exactly what you're currently doing but use regexp instead of contains.


    Contains filters for word boundaries, so your date partial won't match.


    Code
    1. 'filter'=>'event_date_start',
    2. 'match'=>'regexp',
    3. 'value'=> '-08-', //month of august

    That worked perfectly.

    Just fyi the perch documentation needs to be updated since it says possible values for match are 'regex' and not 'regexp'

    For example: https://docs.grabaperch.com/fu…ent/perch-content-custom/

    I have events pages that feature a single event that then need to be displayed on a custom calendar on another page. I need to use perch_content_custom() to display all the posts that occur in a specific month but I cannot get the filtering to work properly. Here is my code for the month of august:

    The ID event_date_start is a standard date fieldtype so the data is in the form of Y-m-d H:i:s My thinking is that 'match'=>'contains' would be able to find the month within the date string but it isn't working. I put dashes before the number (-08-) because only the month has a dash before and after it's number. Maybe I need to use 'match'=>'regex' ? I looked for examples of using 'match'=>'regex' and could never get it to work. Kind of at a loss at this point. Any ideas?