3

I want to know exactly what is the difference between templates located in customer and persistent/customer and why Magento created the two ?

Exemple :

app/design/frontend/{package}/{theme}/template/customer/form/register.phtml

app/design/frontend/{package}/{theme}/template/persistent/customer/form/register.phtml

If I have to modify the register.phtml for exemple or login.phtml, I have to take the first one or the second ? In my case it was the second since always but I want to have an explanation.

5

If you diff the normal login/register templates with the persistent ones you will hopefully see some differences that affect the login/registration of users. – Ben Crook

Ben crook is right, but there seems to be a bug in Magento that causes always using files from persistent/customer - even when persistant cart is disabled.

When Magento merges all layout XML files base/default/layout/persistent.xml sets the template for some customer/checkout pages to persistent/customer, but this should only happen when persistant cart is enabled. To fix this add ifconfig="persistent/options/enabled" to <action method="setTemplate">

base/default/layout/persistent.xml

<layout version="0.1.0">
    <customer_account_login>
        <reference name="customer_form_login">
            <action method="setTemplate"><template>persistent/customer/form/login.phtml</template></action>
            ...
        </reference>
    </customer_account_login>

    <customer_account_create>
        <reference name="customer_form_register">
            <action method="setTemplate"><template>persistent/customer/form/register.phtml</template></action>
            ...
        </reference>
    </customer_account_create>

    <checkout_onepage_index>
        <reference name="checkout.onepage.login">
            <action method="setTemplate"><template>persistent/checkout/onepage/login.phtml</template></action>
            ...
        </reference>
        <reference name="checkout.onepage.billing">
            <action method="setTemplate"><template>persistent/checkout/onepage/billing.phtml</template></action>
            ...
        </reference>
    </checkout_onepage_index>
    ...
</layout>

From Bug: when persistence checkout turned off; then persistent/customer/form/login.phtml still being used

5
  • This is not at all my question and I know very well this, please delete this answer to not downvote it
    – PЯINCƎ
    Aug 5 '17 at 0:43
  • @Prince Then please make clear what you ask. Title says customer vs persistant/customer template? And this answers you why you should use persistant at the moment. If this is known, why ask?
    – sv3n
    Aug 5 '17 at 0:51
  • 1
    I never asked this problem, Is this my question : when persistence checkout turned off; then persistent/customer/form/login.phtml still being used ? You answer me for a problem that I don't need. And as I have said i don't wont to downvote, flag you
    – PЯINCƎ
    Aug 5 '17 at 1:01
  • Q: I have to take the first one or the second ? In my case it was the second since always but I want to have an explanation. A: Its the second since always because its kind of bug - that i've tried to explain ...
    – sv3n
    Aug 5 '17 at 1:11
  • @Prince updated answer to make it more clear. Hope this answers WHY you always have to edit files in persistent/customer directory.
    – sv3n
    Aug 6 '17 at 15:08
1

Ones inside persistent sound to be related to the functionality of keeping track of unpurchased items in the cart.

A persistent shopping cart keeps track of unpurchased items which are left in the cart, and saves the information for the customer's next visit. Customers who are “remembered” can have the contents of their shopping carts restored the next time they visit your store.

Source

5
  • Thanks for your time but is not my question, you are talking about cart instead my question was about register and login !
    – PЯINCƎ
    Jul 13 '17 at 13:49
  • 1
    @Prince It's the same thing just for a different area of the site, it's still related to logging in for the persistent cart functionality. See stackoverflow.com/questions/12600446/…
    – Ben Crook
    Jul 13 '17 at 13:52
  • 1
    If you diff the normal login/register templates with the persistent ones you will hopefully see some differences that affect the login/registration of users.
    – Ben Crook
    Jul 13 '17 at 13:53
  • The links that you have just sent me is not interesting ! there is not even one validate answer !
    – PЯINCƎ
    Jul 13 '17 at 13:55
  • 1
    I'm not sure what more you want then, I've explained what the difference is between persistent and standard templates. As for which one you use depends on whether you're using the persistent cart functionality or not.
    – Ben Crook
    Jul 13 '17 at 13:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.