Posts by Byron Fitzgerald

    If that's the case the issue is unlikely to be due to perch translations and more likely a locale issue with the date field type. The date picker field type utilises strftime to get a list of months, this relies on the locale set.


    You could try using setlocale() to update the locale english which should then show all the months correctly. If the rest of the site is also in English it would make sense as well to do so.

    I'm pretty sure you'll have to use a discount code, but you can set it programmatically like


    Code
    1. $product_count = // your check for products
    2. if($product_count >= 5) {
    3.     perch_shop_set_discount_code('MULTIBUYDISCOUNT');
    4. } else {
    5.    perch_shop_set_discount_code('');
    6. }

    Setting an empty discount code should remove the discount currently in use

    Is this standard perch or runway? I imagine it will be to do with the rewrite rules, as its typical to only use a-z, A-Z, 0-9, and _ -. The + character is a reserved character in URLs so it shouldn't really be used in a slug. So I guess this is an issue the with the slug field type rather than the rewrite rules.

    Clive Walker is right here.


    The paging shown in the example template is just the standard pagination example, it makes no assumptions as to your URL structure. You could quite easily enough have some URL rewriting so that your search URL was domain.com/search/query, in which case the template example would work fine.


    You can probably tidy up the template code using the rewrite attribute on the paging tags. The docs for it are here https://docs.grabaperch.com/templates/attributes/rewrite/

    I don't think there is a way without creating a custom app or editing the perch_forms runtime file.


    For the most part your idea works, but the form tries to find the attributes to assign a form title. In the perch_forms/runtime file this is the section that is causing the issues (lines 26 - 31)


    Code
    1. $attrs = $SubmittedForm->get_form_attributes();
    2. if ($attrs->label()) {
    3. $data['formTitle'] = $attrs->label();
    4. }else{
    5. $data['formTitle'] = PerchUtil::filename($formKey, false);
    6. }

    As $attrs is being returned as null, I think if you just add a null check onto $attrs it should work

    Unfortunately your idea won't work.


    When perch gets the form attributes it fetches the content of the template file, so no template processing occurs. So when perch tries to get the ID it sees


    <perch:form id="<perch:forms id="formID" />" method="post" app="mbk_forms">


    instead of


    <form id="form1_tester" action="/landing-page-3" method="post">.


    This format also happens to break the regex used to find the ID of the form which is why you get the error

    You don't want the $API->on method, as it won't be called until after the form has been processed by the forms_app, which won't happen if you redispatch the form within the closure.


    In your ipltd_filename_form_handler() You'll just need to access the form attributes and rename them, so when you redispatch the form perch_forms handles it in the manner you want. You should be able to fetch the data as $SubmittedForm->data. You could also add an attribute to your file field such, as <perch:input type="file" attribute="timestamp"/> Which you can then access the field with $SubmittedForm->get_attribute_map('timestamp');. That will then return you the field name/ID which should make it easier to edit the data as you need

    It might be the way the arrays are added together? As the items that return a single post will actually be $news[0], so if we just the single items in and update the sort function that could work

    Could you not do what you were doing before then use perch_template to output the results? Should let you use the category tags as well.

    In a MySQL DB ordering is case sensitive and needs to be customised to allow for case insensitive ordering. In raw SQL you'd need to do something like

    Code
    1. Select col
    2. from myTable
    3. order by lower(col)

    Though as perch adds quotes to the order column I'm not sure you'd be able to create a query in this manner

    Could be a timezone thing? Your web server is likely running on UTC, so depending on the timezone of whoever created the post it might have published the post in the future according to the server, so it takes an hour or so for the post to match the UTC time

    At the moment Perch Shop uses Omnipay to provide a unified API to manage the different payment gateways. Currently Omnipay doesn't support recurring billing so adding Paypal subscriptions directly to shop would be difficult.


    Your best option would probably be to create a stand alone app to handle subscriptions