Posts by hus_hmd

    If you are on standard Perch, you will also need to add the following at the bottom of the page:


    PHP
    1. PerchUtil::output_debug();



    You may also need to hold the redirects to see the debug message like so:


    You need to call perch_shop_checkout() before outputting any HTML or whitespace to the page. In fact, you don't need to output anything. You either redirect to PayPal or perhaps back to the cart or payment confirmation page. This is, more or less, all you need on the page:



    The above only relies on the user being a logged in member before redirecting them to PayPal. You can perform further checks like checking whether the cart has items and/or requiring a form (single button) to be submitted from the previous page.

    This is how related items data is fetched. If you need the related item's data, you'll need to fetch that separately.


    perch_collection() behaves the same way. However, inside a template the perch:related tags fetches the related items (and renders the content) for you. When you add fields inside a perch:related these are only used for output. It makes no difference to how Perch saves the data.


    So you'd use something like this:


    Hi,


    I don't think Perch ships with the language packs. You need to download it. This is the German translation.


    Place the file in /perch/addons/plugins/editors/redactor/langs/.


    In /perch/addons/plugins/editors/config.js, specify the language and load the translation file:


    Hi Tony,


    A possible option could be to skip the templating when you fetch the items, reverse the array and then render the template with perch_template():


    I'm not aware of any CMS solution that charges a fee so if a project ends, why wouldn't a license owner want to re-purpose or re-sell their license?


    There is nothing stopping you from reassigning older licenses to new projects. I'm not sure whether the license agreement even prohibits you from doing so.


    As for reselling a license, the license terms do not allow that. You purchase a license to use the product. You are granted permission to use the product. The third-party to which you would resell the license would not have permission to use the product, which is fair.



    The proposed license model sounds like it would continue to allow customers to reassign licenses to different projects. That's what many customers do anyway. Perch didn't suggest they'd stop this. However, this time they're not going to give free updates forever. You get 1 year's worth of updates. If you need more (perhaps it's an ongoing project or you're reusing a license after an old project dies and now need the latest version), you pay for another year's worth of updates. It's a fair model to both parties.

    How do you actually reuse a license anyway?


    I was under the impression that when you specify a domain in your account, that unless the license matched your domain wouldn't work.

    You can reassign the license to a different domain. This normally happens when one an old project dies or stops using Perch, so the owner of the license reassigns the license to a new domain for a new project instead of purchasing a new license. It is perhaps worth noting that v2 licenses get a free upgrade to v3, which means people have been reusing old v2 licenses for new projects on v3.


    This reminds me of Chris Ferdinandi's post: Running a trust-based business. Now that Perch has communicated how the reuse of old licenses hurts them I wonder whether people will continue reusing old licenses for new projects.

    Yes, you'd be able to use clean URLs. You would set up a route to the page (Pages > your page > location tab).


    Your route in this case would be (no slash at the start):


    Code
    1. products/[slug:s]


    slug is the type of value the URL segment represents. s is what you are naming this URL segment (so you can use it on the page). You can get the value of this segment with perch_get() just like you would with URL query parameter.

    Hi,


    perch_item_index does not give you a unique ID. It gives you the number of the item in a list in whatever context it is (number of item in a region, number of item in a repeater, etc). So I would prepend the region unique ID to avoid possible clashes.


    You can use _id which is the unique ID of the region. And you can use the scope-parent attribute on the repeater tag to make the content from outside the repeater available inside it:


    HTML
    1. RegionID_RegionItemNumber: <perch:content id="_id" type="hidden">_<perch:content id="perch_item_index" type="hidden">
    2. <perch:repeater id="my_repeater" scope-parent>
    3. RegionID_RegionItemNumber_RepeaterItemNumber: <perch:content id="parent._id" type="hidden">_<perch:content id="parent.perch_item_index" type="hidden">_<perch:content id="perch_item_index" type="hidden">
    4. </perch:repeater>

    Hi James,


    This is the expected behaviour. You need to pass the slug dynamically.


    If your URL is something like /products?s=example-product, you can use perch_get() to get the value of the URL query parameter s:


    PHP
    1. perch_shop_product(perch_get('s'), [
    2. 'template' => 'products/product_detail.html',
    3. ]);