mivaecommerce / readytheme-shadows

Shadows is the development framework and methodology used for creating our ReadyThemes as well as custom websites.
https://shadows.mivareadythemes.com/
MIT License
4 stars 3 forks source link

WLGN: Error when loading a wish list after creating a customer #110

Closed influxweb closed 3 years ago

influxweb commented 3 years ago

Current Behavior

If you press the "Add to Wish List" button from the product page when not logged in, then create a customer from the page that loads, you get an error. The issue is that the template code when using Customer Quick Insert behavior on WLGN is not adding the required product form data, nor is it re-attaching the ATWL action when a new customer is created, only when you log in.

Correcting the Issue

To make the update, without applying the latest release, you will need to update the code in User Interface -> Templates -> Pages -> WLGN -> Details -> Template:

<mvt:item name="html_profile" />
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <base href="&mvt:global:basehref;">
    <mvt:if expr="NOT ISNULL l.settings:page:title">
        <title>&mvt:page:title;</title>
    <mvt:else>
        <title>&mvt:store:name;: &mvt:page:name;</title>
    </mvt:if>
    <mvt:item name="head" param="css_list" />
    <mvt:item name="head" param="head_tag" />
</head>
<body id="js-&mvte:page:code;" class="o-site-wrapper t-page-&mvte:global:pageClass;">
    <mvt:item name="hdft" param="global_header" />

    <section class="o-layout">
        <div class="o-layout__item">
            <mvt:item name="hdft" param="header" />
            <mvt:item name="readytheme" param="contentsection( 'messages' )" />
            <p class="u-text-bold u-text-center">You must have a customer account to create a wish list.</p>
        </div>
    </section>

    <section class="o-layout o-layout--justify-around">
        <div class="o-layout__item u-width-12 u-width-6--m u-width-4--l">
            <p class="c-heading-delta u-text-uppercase">Welcome Back</p>
            <form method="post" action="&mvte:urls:WISH:secure;" autocomplete="off">
                <fieldset>
                    <legend>&mvt:page:name;</legend>
                    <mvt:if expr="ISNULL g.Action">
                        <mvt:assign name="g.Action" value="'LOGN,ATWL'" />
                    <mvt:else>
                        <mvt:assign name = "g.Action" value="'LOGN,' $ g.Action" />
                    </mvt:if>
                    <input type="hidden" name="Action" value="&mvte:global:Action;" />
                    <input type="hidden" name="Quantity" value="&mvte:global:Quantity;" />
                    <input type="hidden" name="Line_ID" value="&mvte:global:Line_ID;" />
                    <input type="hidden" name="Group_ID" value="&mvte:global:Group_ID;" />
                    <input type="hidden" name="Wish_ID" value="&mvte:global:Wish_ID;" />
                    <input type="hidden" name="Product_Code" value="&mvte:global:Product_Code;" />
                    <mvt:assign name="l.settings:attribute_index" value="0" />
                    <mvt:foreach iterator="attribute" array="global:Product_Attributes">
                        <mvt:assign name="l.settings:attribute_index" value="l.settings:attribute_index + 1" />
                        <input type="hidden" name="Product_Attributes[ &mvt:attribute_index; ]:code" value="&mvte:attribute:code;" />
                        <input type="hidden" name="Product_Attributes[ &mvt:attribute_index; ]:value" value="&mvte:attribute:value;" />
                        <mvt:if expr="l.settings:attribute:template_code NE 0">
                            <input type="hidden" name="Product_Attributes[ &mvt:attribute_index; ]:template_code" value="&mvte:attribute:template_code;" />
                        </mvt:if>
                    </mvt:foreach>
                    <div class="c-form-list">
                        <div class="c-form-list__item">
                            <label class="c-form-label u-font-small u-text-bold u-text-uppercase is-required &mvt:global:invalid_credentials;" for="l-Customer_LoginEmail">Email Address</label>
                            <input id="l-Customer_LoginEmail" class="c-form-input" type="text" inputmode="email" name="Customer_LoginEmail" value="&mvte:global:Customer_LoginEmail;" autocomplete="email" required>
                        </div>
                        <div class="c-form-list__item">
                            <label class="c-form-label u-font-small u-text-bold u-text-uppercase is-required &mvt:global:invalid_credentials;" for="l-Customer_Password">Password:</label>
                            <mvt:if expr="g.Customer_Temporary_Password">
                                <input type="hidden" name="Customer_Temporary_Password" value="&mvte:global:Customer_Temporary_Password;">
                                <input id="l-Customer_Password" class="c-form-input" type="password" name="Customer_Password" value="&mvte:global:Customer_Temporary_Password;" required>
                            <mvt:else>
                                <input id="l-Customer_Password" class="c-form-input" type="password" name="Customer_Password" autocomplete="current-password" required>
                            </mvt:if>
                        </div>
                        <div class="c-form-list__item u-text-right">
                            <mvt:item name="buttons" param="Login" />
                        </div>
                    </div>
                </fieldset>
            </form>
            <p class="u-font-small"><a data-dialog-trigger="forgot-password" href="&mvte:urls:FPWD:secure;">Forgot your password?</a></p>
        </div>
        <div class="o-layout__item u-width-12 u-width-6--m u-width-4--l">
            <p class="c-heading-delta u-text-uppercase">New Customers</p>
            <form class="o-layout" method="post" action="&mvte:urls:WISH:secure;">
                <fieldset class="o-layout__item">
                    <legend>Customer Log In</legend>
                    <mvt:if expr="ISNULL g.Action">
                        <mvt:assign name="g.Action" value="'ICSQ,ATWL'" />
                    <mvt:else>
                        <mvt:assign name = "g.Action" value="'ICSQ,' $ g.Action" />
                    </mvt:if>
                    <input type="hidden" name="Action" value="&mvte:global:Action;" />
                    <input type="hidden" name="Quantity" value="&mvte:global:Quantity;" />
                    <input type="hidden" name="Line_ID" value="&mvte:global:Line_ID;" />
                    <input type="hidden" name="Group_ID" value="&mvte:global:Group_ID;" />
                    <input type="hidden" name="Wish_ID" value="&mvte:global:Wish_ID;" />
                    <input type="hidden" name="Product_Code" value="&mvte:global:Product_Code;" />
                    <mvt:assign name="l.settings:attribute_index" value="0" />
                    <mvt:foreach iterator="attribute" array="global:Product_Attributes">
                        <mvt:assign name="l.settings:attribute_index" value="l.settings:attribute_index + 1" />
                        <input type="hidden" name="Product_Attributes[ &mvt:attribute_index; ]:code" value="&mvte:attribute:code;" />
                        <input type="hidden" name="Product_Attributes[ &mvt:attribute_index; ]:value" value="&mvte:attribute:value;" />
                        <mvt:if expr="l.settings:attribute:template_code NE 0">
                            <input type="hidden" name="Product_Attributes[ &mvt:attribute_index; ]:template_code" value="&mvte:attribute:template_code;" />
                        </mvt:if>
                    </mvt:foreach>
                    <input type="hidden" name="CSRF_Token" value="&mvte:global:Basket:csrf_token;">
                    <input type="hidden" name="WishList" value="1">
                    <div class="c-form-list">
                        <div class="c-form-list__item">
                            <label class="c-form-label u-font-tiny u-text-bold u-text-uppercase is-required" for="register_fname">First Name</label>
                            <input id="register_fname" class="c-form-input c-form-input--large" type="text" name="Customer_ShipFirstName" value="&mvte:global:Customer_ShipFirstName;" autocomplete="given-name" required aria-required="true">
                        </div>
                        <div class="c-form-list__item">
                            <label class="c-form-label u-font-tiny u-text-bold u-text-uppercase is-required" for="register_lname">Last Name</label>
                            <input id="register_lname" class="c-form-input c-form-input--large" type="text" name="Customer_ShipLastName" value="&mvte:global:Customer_ShipLastName;" autocomplete="family-name" required aria-required="true">
                        </div>
                        <div class="c-form-list__item">
                            <label class="c-form-label u-font-tiny u-text-bold u-text-uppercase is-required" for="register_email">Email Address</label>
                            <input id="register_email" class="c-form-input c-form-input--large" type="email" inputmode="email" name="Customer_LoginEmail" value="&mvte:global:Customer_LoginEmail;" autocomplete="email" required aria-required="true">
                        </div>
                        <div class="c-form-list__item">
                            <label class="c-form-label u-font-tiny u-text-bold u-text-uppercase is-required" for="register_password">Password</label>
                            <input id="register_password" class="c-form-input c-form-input--large" type="password" name="Customer_Password" autocomplete="new-password" required aria-required="true">
                        </div>
                        <div class="c-form-list__item u-text-right">
                            <input class="c-button c-button--full c-button--hollow c-button--huge u-bg-white u-color-gray-50 u-font-small u-text-bold u-text-uppercase" type="submit" value="Create My Account">
                        </div>
                    </div>
                </fieldset>
            </form>
            <br>
        </div>
    </section>

    <section class="o-layout">
        <div class="o-layout__item">
            <mvt:item name="hdft" param="footer" />
            <mvt:item name="readytheme" param="contentsection( 'forgot-password' )" />
        </div>
    </section>

    <mvt:item name="hdft" param="global_footer" />
</body>
</html>