Posts by hus_hmd

    Hello Andrew,


    It sounds like you added perch_shop_orders and perch_shop_products to your perch/config/apps.php file. Try removing them as you only need to add perch_members and perch_shop.

    Hi Claude,


    You need to customise the editor's configuration and enable the linkNewTab setting. You can refer to the Perch documentation for custom editors and this blog post for more information.


    This is probably all you need to add to your addons/plugins/editors/config.js:

    I don't think there is a way to do this. Displaying a different price on the product page (regardless of where the price is managed outside of the Shop app) would have no effect to how Shop calculates the order's total amount as far as I know.

    Hello,


    I want to create a field in the collection which will be used as the price of the product,


    Apart from displaying the Collection item's price instead of the Shop product's price on the product page, what are you trying to achieve? While you can output the Collection item's price on the product page, Perch Shop won't use that value in the cart or checkout.

    Hello Aleix,


    <perch:categories></perch:categories> has its own scope. Consider the following template:


    HTML
    1. <perch:content id="heading" type="text">
    2. <perch:categories id="my_location" set="location">
    3. <perch:category id="catTitle">
    4. <!--* you cannot access the field 'heading' in this scope *-->
    5. </perch:categories>


    You can't access the fields from the outer scope by default. In order to access the fields from the outer scope, you can use the scope-parent attribute:


    HTML
    1. <perch:content id="heading" type="text">
    2. <perch:categories id="my_location" set="location" scope-parent>
    3. <perch:category id="catTitle">
    4. <!--* you can now access the field 'heading' in this scope *-->
    5. <perch:category id="parent.heading" type="text">
    6. </perch:categories>


    So the scope-parent does not allow you to access a parent category and it is not the appropriate solution for your use-case.



    The closest thing to what you want as far as I know is catDisplayPath:


    HTML
    1. <perch:categories id="my_location" set="location">
    2. <perch:category id="catDisplayPath">
    3. </perch:categories>


    This would output "California › Los Angeles".

    you could of re-asked the question... Is that the refresh values question??


    I answered it twice in 2 separate posts..


    No, I was referring to the PHP session ID:

    If you turn on debug and add the following to your page, you will see the session ID in the debug message (highlighted blue):


    The point of my previous comment is that you received a decent amount of support from the Perch team and from a community member. I went silent because from my perspective it appeared like you didn't look into what I suggested, which is absolutely fine if you thought it was irrelevant, but in return I can't suggest a solution without knowing what's causing the issue.


    I'm not saying don't leave feedback or suggestions for improvements, but I don't think there was a particular lack of support on your issue here. I admit a follow-up was missing from both me and the Perch team. If I was in your shoes, I'd probably be frustrated. And again I'm not putting all the blame on you.


    In any case, I hope I'm not driving you away from the Perch community. My intention was not to be hostile or attack you in any way, so I really hope that is not how you feel. If I can help in any other way, feel free to reach out. If you ever get stuck near a deadline and need some urgent help, you can contact one of the registered developers.



    All the best

    Hussein

    You can group items without filtering from within the template.


    Output the list in the order you need:


    PHP
    1. perch_content_custom('Song List', array(
    2. 'sort' => 'songName',
    3. 'sort-order' => 'ASC',
    4. ));



    You can use conditional tags plus the format attribute inside the template to achieve what you want.


    The following outputs the first character of a field:


    HTML
    1. <perch:content id="songName" format="C:1">



    The following checks the previous item against the current item:

    HTML
    1. <perch:if different="songName" format="C:1" format-both>
    2. The first character of the previous item's songName is different than the current item's
    3. </perch:if>



    If you want the rendered HTML to be:




    You can use something like this:


    I have had to switch from Perch to CubeCart!

    Ah that's a shame. Well I hope the project went well otherwise.



    Though, since you addressed me by name I'd like to mention that I'm disappointed you have labelled this as "lack of support" because:

    1. Drew tried to help you and there was some back and forth correspondence between you two
    2. You had some further questions and I answered them
    3. You mentioned the cart ID keeps increasing, I explained why this may happen and tried to help you confirm whether this was indeed the reason
    4. You again mentioned the cart ID keeps increasing instead of working with me to try to work out the cause


    Communication is a two-way street. Good support relies on good communication. I tried to confirm whether you had a problem with PHP sessions:


    So this sounds like the PHP session expires prematurely and a new session is started, hence Perch Shop creating a new instance of the cart when you reload the page.

    Do you keep getting different values when you refresh the page?


    I'm not putting all the blame on you and I understand your frustration a little bit. I could have re-asked the question, but I'm not obligated to do so. I'm just another member of this community. No one pays me to help other Perch developers. I took the time to explain what could be the cause of your issue and tried to work with you to confirm the cause, but you frankly didn't adequately address that.



    I can't speak of how first-party support works, but you got some from Drew in a section of the forum that is clearly labelled "Help - Customer to Customer". I hope drewm and rachelandrew explain the type of first-party support the customers are entitled to. Hopefully that would help manage everyone's expectations.

    I feel like often the assumption is that any user who is not the developer of the site is either not able or not concerned with the site management.


    That's a little far from my point. To clarify, I don't think there's anything wrong with a UI to manage the app's settings even if only a developer would use it.


    Though there are settings that only a developer would change. For instance, I wrote an app that generates JSON file(s) containing keywords so the JSON can be used to provide search terms suggestions as the users type in a search box. I have a PHP file in which I can specify which Collection(s) I'm targeting, the keywords field ID, the template path and some filters. A simplified example:



    It is not impossible to build a UI for the above, but I don't think it is worth it. I can be certain the admins of the control panel won't need to worry about modifying this.


    To reflect your feeling, I feel you're thinking about your use case more than the point I've made in my previous comment ^^! To summarise my previous comment:

    • explained an alternative approach to handling custom app's configuration (a little off-topic I must admit)
    • said it is worth considering (in case it is ideal for your use case)
    • admitted it is not a good solution for all use cases

    I have no strong opinions regarding what you're suggesting. A sub-page within the app can be restricted to certain users as Byron Fitzgerald pointed out.


    I did find the Perch Settings limiting once and had to build a custom configuration page for an app. Then I realised only a developer would need to access and modify these settings, and all I really needed was a single PHP file that returns the configurations in an array. And even for simple configurations: if it is something only a developer would need to access/modify, a constant in the Perch config file is enough.


    I'm not saying that's true for all cases, but it is worth considering.

    Hi Stephen,


    I can't speak for Perch 4, but for you can solve your current issue (cropping the face of the person) in Perch 3 by using Imgix or Cloudinary as both services can detect faces and ensure the face is fully included in the cropped version of the image.


    Imgix even has an entropy crop mode which automatically crops to an area of interest in the image (not necessarily faces). Not sure if Cloudinary does the same.


    Integrating both services with Perch 3 can be done with a template filter:

    but i have noticed that when the user selects a radio button nothing changes anywhere on the front end for me to hinge changes to.


    HTML radio buttons have a checked state so you can target the checked one with Javascript and even CSS.



    How does the checkout button know the selection?


    I'd say it is an "add to cart" button. Anyway, it is a HTML form. As long as you've set up your form correctly, submitting the form will post the selected data and Perch Shop should take care of adding the correct variant to the cart. If you have followed the example in the docs, that should be all you need for your form. Though if a variant has no stock, I think Perch Shop won't add it to the cart.



    Back to your original question about updating the price. You probably need to write some Javascript to:

    1. get the selected options from the form
    2. figure out a mechanism to match the selected options to a variant
    3. update the price on the page to that of the matching variant's
    4. [optional] if the variant is out of stock, let the user know (e.g. display a message and disable the submit button)
    5. detect when the user updates their selection and re-do 1-4