Posts by Clive Walker

    Here's my final code. It has some additional category and item filtering in it.


    I am using replace in the Perch template to get the correct URL so that's why I have used perch_template.


    Great stuff, that's working, thank you.


    I will add a filter on the categories so that I get some categories and not all:


    I may also template the output although perhaps not really needed.

    Many thanks again.

    Sorry, I meant counting the items that belong to a category. Your example would count the categories I think.


    Perhaps the Stephen Meehan example is misleading. I have a multiple item region with categories (countries). I want to display the categories (countries) with the number of items in each category.

    I want to create item counts for categories as described here Category count?


    Stephen Meehan - did you solve this?


    I can use <perch:content id="perch_item_count" type="hidden"> in a template on the region page but I need to display the counts on my category list on a separate page.


    I think this should be possible using each as follows:


    Code
    1. perch_categories([
    2. //category filtering here
    3. 'each' => function($item) {
    4. // get the count here
    5. return $item;
    6. },
    7. ]);

    Has anyone else done this??

    Hi Gareth S


    I asked my developer colleague for more details and he replied:


    Hi Gareth S - I've checked with my developer colleague and his reply was that the deprecation errors were all on screen so we're not quite sure why you cannot see these. He did the PHP 8 check as a favour to me and others in the Perchology Slack group and doesn't want to do more on this as a freebie.


    So, from his perspective, it's really up to your PHP devs to look into this.


    I've not used Perch with PHP 8 myself so cannot comment on this. Hopefully, my comments in previous post can help your team test this release in their testing process.

    Based on a discussion with a third party Perch developer (who's not on this forum), I believe there are several problems with the Shop update described here Perch V4 (and future) Megathread


    Two problems that he describes:


    1. Part of the code in the perch shop gateway now depends on a "confirm" option in the payment options. I don't have this "confirm" value in my setup

    Code
    1. Notice: Undefined index: confirm in /data/Workspace/some-website/public/perch/addons/apps/perch_shop/lib/gateways/PerchShopGateway_default.class.php on line 55


    2. The return_url has been changed to success_url in the payment options. so if you're just swapping out the shop app, you probably won't redirect to your confirmation page after a successful payment


    His other comments were that:

    Quote

    Neither Perch 3.2 or perch_shop are ready for PHP 8 in any way. Tonnes of deprecation warnings which will fill your logs in no time. Unless you're willing to go through them and correct them I would wait and keep my fingers crossed that the Perch team are going to fix it. In terms of a developer it's really not hard or that bad to correct

    ----


    I hope these problems can be reported back and fixed.

    I have seen this before on MediaTemple and GoDaddy servers (MT are part of GD). I don't have a solution I'm afraid and I think it's hosting related. Possibly a security measure that MT have in place. You need to go back to them but they weren't helpful in my case.


    My solution would be to set-up a copy of the site on another host. If no problems, you know it's hosting-related. Then, I would move hosts.

    Navigation dropdown menus


    I'm not very keen on using # for the parent. What's the search engine status for that practice? Does Google like it? I like to have a folder structure so that the parent page is an intro page with a simple list of links to subpages. The parent page can have a brief summary of that section of the site as well.


    In some cases, I've also seen sites using the first "sub-page" as the URL for the parent page instead of #. That wouldn't make it easy for your clients though.


    Overall, I think I prefer the folder structure option. Isn't that more logical and better for search engines? And simpler for clients?