Forum

Thread tagged as: Error, Members, Shop

Shop passwordless registration error

As part of my shop purchase process I have the customer enter their details using the passwordless registration form.

However if the member already exists (has made a purchase in past) and tries to make a new purchase using the same email address I get a "password failed to match" error in debug along with a template file not found. It reloads the page and displays the <perch:success> message and does not redirect to the cart like it should. I notice in the template file not found error there is a strange url (see debug below).

details.php

<?php 

    include($_SERVER['DOCUMENT_ROOT'].'/admin/runtime.php');

    if (perch_member_logged_in()) {
        PerchSystem::redirect('confirm');
    }

    perch_layout('header', array(
        'title' => "Your details",
    )); 

?>


<div class="clear feature-block ta-c mb-0">

    <div class="wrap wrap--large">

        <h1 class="mb-0">Your details</h1>

    </div>

</div>

<div class="clear">

    <div class="wrap wrap--small">

        <?php perch_content('Intro text'); ?>

        <?php
            // New customer sign up form
            perch_shop_registration_form([
                'template' => 'checkout/customer_create_passwordless.html'
            ]);

        ?>

    </div>

</div>

<div class="clear">
    <div class="wrap wrap--small">
        <?php perch_content('Shop footer'); ?>
    </div>
</div>


<?php 

    perch_layout('footer', array(
        'hide-social' => true,
    )); 

?>

customer_create_passwordless.html

<div class="clear">

<perch:form id="register" method="post" app="perch_shop">

    <div class="blocks blocks--3-cols blocks--mobile-1-col">

        <div>
            <perch:label for="first_name" class="apply-form__label">First name</perch:label>
            <perch:input type="text" id="first_name" required="true" label="First name" class="apply-form__input" />
            <perch:error for="first_name" type="required">Please add your name</perch:error>
        </div>

        <div>
            <perch:label for="last_name" class="apply-form__label">Last name</perch:label>
            <perch:input type="text" id="last_name" required="true" label="Last name" class="apply-form__input" />
            <perch:error for="last_name" type="required">Please add your name</perch:error>
        </div>

        <div>
            <perch:label for="email" class="apply-form__label">Email</perch:label>
            <perch:input type="email" id="email" required="true" placeholder="you@company.com" class="apply-form__input" />
            <perch:error for="email" type="required"><span style="color:red;">Please add your email address</span></perch:error>
            <perch:input type="hidden" id="password" value="__auto__" />
        </div>

    </div>

    <h2>Billing address</h2>

    <div class="blocks blocks--3-cols blocks--mobile-1-col">

        <div>
            <perch:label for="address_1" class="apply-form__label">Address 1</perch:label>
            <perch:input type="text" id="address_1" required="true" label="Address 1" class="apply-form__input" />
            <perch:error for="address_1" type="required">Please add the first line of your address</perch:error>
        </div>

        <div>
            <perch:label for="address_2" class="apply-form__label">Address 2</perch:label>
            <perch:input type="text" id="address_2" label="Address 2" class="apply-form__input" />
        </div>

        <div>
            <perch:label for="postcode" class="apply-form__label">Postal code</perch:label>
            <perch:input type="text" id="postcode" label="Postal code" class="apply-form__input" />
        </div>

        <div>
            <perch:label for="city" class="apply-form__label">City</perch:label>
            <perch:input type="text" id="city" label="City" class="apply-form__input" />
        </div>

        <div>
            <perch:label for="county" class="apply-form__label">State or County</perch:label>
            <perch:input type="text" id="county" label="County" class="apply-form__input" />
        </div>

        <div>
            <perch:label for="country" class="apply-form__label">Country</perch:label>
            <perch:input type="select" options="<perch:shop id="country_list" />" value="236" id="country" label="Country" />
        </div>

    </div>      

    <div class="clear mb-0">
        <perch:input type="submit" value="Next" class="button button--primary" />
    </div>

    <perch:success>
        <p>Thanks!</p>
    </perch:success>

</perch:form>

</div>

debug:

Debug Message
[1] SELECT * FROM perch2_pages WHERE pagePath='/pay/details.php' LIMIT 1
[1] SELECT * FROM perch2_shop_cart WHERE cartID=89
[1] SELECT * FROM perch2_shop_cart WHERE cartID=89
[40] SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
[1] SELECT * FROM perch2_members_forms WHERE formKey='register' LIMIT 1
INSERT INTO perch2_members(memberAuthType,memberEmail,memberPassword,memberStatus,memberCreated,memberProperties) VALUES('native','stephen@myemail.co.uk','$P$BdnWpCsul8RJxSORmXNcKfDG6faDRV/','pending','2017-03-07 13:18:28','{\"first_name\":\"Gordon\",\"last_name\":\"Banks\"}')
[1] SELECT * FROM perch2_members WHERE memberID='25' LIMIT 1
No ids to log.
UPDATE perch2_members SET memberAuthID='25', memberStatus='active' WHERE memberID='25'
No ids to log.
[1] SELECT * FROM perch2_members WHERE memberAuthType='native' AND memberPassword IS NOT NULL AND memberEmail='stephen@myemail.co.uk' AND memberStatus='active' AND (memberExpires IS NULL OR memberExpires>'2017-03-07 13:18:28') LIMIT 1
Password failed to match.
Array
(
)
Template file not found: /Users/turveyair/htdocs/website/adminlogin/login_form.html
------------------------------ here mem ------------------------------
Array
(
    [all] => login
)
UPDATE perch2_members SET memberPassword=NULL WHERE memberID='25'
No ids to log.
Using template: /templates/pages/attributes/seo.html
Using template: /templates/pages/attributes/body.html
[1] SELECT pageID, pageParentID, pageDepth, pageTreePosition FROM perch2_pages WHERE pagePath='/get-tefl-certified' OR pageSortPath='/get-tefl-certified' LIMIT 1
[3] SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 AND pageTreePosition LIKE '000-005%' ORDER BY pageTreePosition ASC
[1] SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/pay/details.php' LIMIT 1
[2] SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-008-003', '000-008', '000') ORDER BY pageTreePosition DESC
[2] Using template: /templates/navigation/pushy.html
[1] SELECT groupID FROM perch2_navigation WHERE groupSlug='tefl-jobs' LIMIT 1
[18] SELECT np.pageID, np.pageParentID, p.pagePath, p.pageTitle, p.pageNavText, p.pageNew, p.pageOrder, np.pageDepth, p.pageSortPath, np.pageTreePosition, p.pageAccessTags, p.pageAttributes FROM perch2_navigation_pages np, perch2_pages p WHERE p.pageID=np.pageID AND np.groupID=1 AND p.pageNew=0 ORDER BY np.pageTreePosition ASC
[0] SELECT np.pageTreePosition FROM perch2_pages p, perch2_navigation_pages np WHERE np.pageID=p.pageID AND np.groupID=1 AND p.pagePath='/pay/details.php' LIMIT 1
[18] Using template: /templates/navigation/pushy.html
[1] SELECT groupID FROM perch2_navigation WHERE groupSlug='tefl-internships' LIMIT 1
[4] SELECT np.pageID, np.pageParentID, p.pagePath, p.pageTitle, p.pageNavText, p.pageNew, p.pageOrder, np.pageDepth, p.pageSortPath, np.pageTreePosition, p.pageAccessTags, p.pageAttributes FROM perch2_navigation_pages np, perch2_pages p WHERE p.pageID=np.pageID AND np.groupID=2 AND p.pageNew=0 ORDER BY np.pageTreePosition ASC
[0] SELECT np.pageTreePosition FROM perch2_pages p, perch2_navigation_pages np WHERE np.pageID=p.pageID AND np.groupID=2 AND p.pagePath='/pay/details.php' LIMIT 1
[4] Using template: /templates/navigation/pushy.html
[1] SELECT groupID FROM perch2_navigation WHERE groupSlug='volunteer-programs' LIMIT 1
[3] SELECT np.pageID, np.pageParentID, p.pagePath, p.pageTitle, p.pageNavText, p.pageNew, p.pageOrder, np.pageDepth, p.pageSortPath, np.pageTreePosition, p.pageAccessTags, p.pageAttributes FROM perch2_navigation_pages np, perch2_pages p WHERE p.pageID=np.pageID AND np.groupID=3 AND p.pageNew=0 ORDER BY np.pageTreePosition ASC
[0] SELECT np.pageTreePosition FROM perch2_pages p, perch2_navigation_pages np WHERE np.pageID=p.pageID AND np.groupID=3 AND p.pagePath='/pay/details.php' LIMIT 1
[3] Using template: /templates/navigation/pushy.html
[1] SELECT pageID, pageParentID, pageDepth, pageTreePosition FROM perch2_pages WHERE pagePath='/community' OR pageSortPath='/community' LIMIT 1
[10] SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 AND pageTreePosition LIKE '000-006%' ORDER BY pageTreePosition ASC
[1] SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/pay/details.php' LIMIT 1
[2] SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-008-003', '000-008', '000') ORDER BY pageTreePosition DESC
[9] Using template: /templates/navigation/pushy.html
Using template: /templates/search/search_header.html
[5] SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/pay/details.php' OR regionPage='*' ORDER BY regionPage DESC
[250] SELECT country, countryID FROM perch2_shop_countries ORDER BY country ASC
Using template: /templates/shop/checkout/customer_create_passwordless.html
Stephen Turvey

Stephen Turvey 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you have members configured to require approval?

I did have yes. I unchecked that but still get the same error.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Is the member in question still pending approval?

No, all members have got an Active status in admin

Drew McLellan

Drew McLellan 2638 points
Perch Support

Is the error you're now getting still the same?