LemonStand Forum: Ajax/Login/Signup Issue - LemonStand Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Ajax/Login/Signup Issue

#1 User is offline   thaynes 

  • Member
  • Group: Members
  • Posts: 2
  • Joined: 19-January 12

Posted 19 January 2012 - 02:12 AM

Hi All,

I wondered if you can lend me some assistance with an issue I am having, it is quite likely it is user error in this case as I am quite new to Lemon Stand.

Ok here goes,

I load up a page via AJAX which includes a login and a signup screen with the action set as shop:login

First issue is, when I use the login part, code below.

<?= open_form() ?>
<table class='details half' cellspacing='0'>
	<tr>
		<th class='title' colspan='2'>Have an account? Please login..</th>
	</tr>
	<tr>
		<td class='title'>*Email Address</td>
		<td class='input'><input class='text' name="email" value="<?= h(post('email')) ?>" type="text"></td>
	</tr>
	<tr>
		<td class='title'>*Password</td>
		<td class='input'><input class='text' name="password" value="" type="password"> <a href='#' class='small-font'>Forgotten your password?</a></td>
	</tr>
	<tr class='footer'>
		<td class='title'></td>
		<td class='input button'><input value='Login >' type="button" name="login" onclick="return $(this).getForm().sendRequest('shop:on_login', {update: {'mini_cart': 'shop:mini_cart', 'popup':'checkout_billing'}})" /></td>
	</tr>
</table>
</form>


When I click on Login, an alert box pops up saying "Please specify a first name."

I believe that it is logging me in and trying to load the partial for the billing section, I do have a hunch its because its not loading the "shop:checkout" action, and if so how can I load it for a partial?

The sign up part follows along the lines of the same issue, an account is created and again I believe it tries to display the billing partial but I get the alert box with the error "Please specify a street address." I am only asking got first name, last name and password in the sign up form but from reading the docs that should be fine.

Thanks in advance!
0

#2 User is online   Aleksey 

  • Co-Founder
  • Group: +Administrators
  • Posts: 3,633
  • Joined: 31-October 09

Posted 22 January 2012 - 03:24 PM

Hi!

Please try to remove the "'popup':'checkout_billing'" part from the AJAX update list? Will it log you in without errors? If it works, please post the checkout_billing partial code.

Thank you

#3 User is offline   thaynes 

  • Member
  • Group: Members
  • Posts: 2
  • Joined: 19-January 12

Posted 23 January 2012 - 02:16 AM

Hi,

Yes it does login me in.

The code for the checkout billing partial is

<div id="content_detail">
          <div class="close"><a rel="popup_close" href="#">x close</a></div>
          <div class="page_title">Secure Checkout</div>
          <div class='table_holder'>
            <div class='progress_header'>
              <ul>
                <li class='current'>1) Billing Address</li>
                <li>2) Delivery Details</li>
                <li>3) Order Summary</li>
                <li>4) Receipt</li>
              </ul>
            </div>
            <?echo open_form()?>
            <table class='details half' cellspacing='0'>
              <tr>
                <th class='title' colspan='2'>Your details</th>
              </tr>
              <tr>
                <td class='title'>*First Name</td>
                <td class='input'><? if ($this->customer){ echo $this->customer->first_name;} else { ?><input class='text' name="first_name" value="<?= h($billing_info->first_name) ?>" type="text"><?}?></td>
              </tr>
              <tr>
                <td class='title'>*Last Name</td>
                <td class='input'><? if ($this->customer){ echo $this->customer->last_name;} else { ?><input class='text' name="last_name" value="<?= h($billing_info->last_name) ?>" type="text"><?}?></td>
              </tr>
              <tr>
                <td class='title'>Telephone</td>
                <td class='input'><input class='text' name="phone" value="<?= h($billing_info->phone) ?>" type="text"></td>
              </tr>
            </table>
            <?
			if(isset($billing_info))
			{
			?>
            <table class='details half' cellspacing='0'>
              <tr>
                <th class='title' colspan='2'>What is the Billing Address?</th>
              </tr>
              <tr>
                <td class='title'>*Address</td>
                <td class='input'><input class='text' name="street_address" value="<?= h($billing_info->street_address) ?>" type="text"></td>
              </tr>
              <tr>
                <td class='title'>*Town</td>
                <td class='input'><input class='text' name="city" value="<?= h($billing_info->city) ?>" type="text"></td>
              </tr>
              <tr>
                <td class='title'>*Country</td>
                <td class='input'><select id="country" name="country" onchange="return $(this).getForm().sendRequest(
        'shop:on_updateStateList', {
          extraFields: {'country': $(this).val(),
          'control_name': 'state', 'control_id': 'state', 'current_state': '<?= $billing_info->state ?>'},
          update: {'billing_states': 'shop:state_selector'}
      })">
      <? foreach ($countries as $country): ?>
        <option <?= option_state($billing_info->country, $country->id) ?> value="<?= h($country->id) ?>">
          <?= h($country->name) ?>
        </option>
      <? endforeach ?>
    </select></td>
              </tr>
              <tr>
                <td class='title'>*State</td>
                <td class='input'><?= $this->render_partial('shop:state_selector', array(
        'states'=>$states,
        'control_id'=>'state',
        'control_name'=>'state',
        'current_state'=>$billing_info->state)) ?></td>
              </tr>
              <tr>
                <td class='title'>*Postcode</td>
                <td class='input'><input class='text' name="zip" value="<?= h($billing_info->zip) ?>" type="text"></td>
              </tr>
            </table>
            <?
			}
			else
			{
            ?>
            <table class='details half' cellspacing='0'>
              <tr>
                <th class='title' colspan='2'>What is the Billing Address?</th>
              </tr>
              <tr>
                <td class='title'>*Address</td>
                <td class='input'><input class='text' name="street_address" value="" type="text"></td>
              </tr>
              <tr>
                <td class='title'>*Town</td>
                <td class='input'><input class='text' name="city" value="" type="text"></td>
              </tr>
              <tr>
                <td class='title'>*Country</td>
                <td class='input'><select id="country" name="country" onchange="return $(this).getForm().sendRequest(
        'shop:on_updateStateList', {
          extraFields: {'country': $(this).val(),
          'control_name': 'state', 'control_id': 'state', 'current_state': null},
          update: {'billing_states': 'shop:state_selector'}
      })">
      <? foreach ($countries as $country): ?>
        <option value="<?= h($country->id) ?>">
          <?= h($country->name) ?>
        </option>
      <? endforeach ?>
    </select></td>
              </tr>
              <tr>
                <td class='title'>*State</td>
                <td class='input'><?= $this->render_partial('shop:state_selector', array(
        'states'=>$states,
        'control_id'=>'state',
        'control_name'=>'state',
        'current_state'=>null)) ?></td>
              </tr>
              <tr>
                <td class='title'>*Postcode</td>
                <td class='input'><input class='text' name="zip" value="" type="text"></td>
              </tr>
            </table>
            <?
			}
            ?>
            <div class='clear'></div>
            <div class='progress_footer'><input value='Continue >' type="button" onclick="return $(this).getForm().sendRequest('shop:on_checkoutSetShippingInfo',{update:{'popup': 'checkout_delivery'}})" /></div>
            </form>
          </div>
</div>


Cheers,

Tim
0

#4 User is online   Aleksey 

  • Co-Founder
  • Group: +Administrators
  • Posts: 3,633
  • Joined: 31-October 09

Posted 23 January 2012 - 03:19 PM

Hi Tim,

I don't see any problems with your code. Is the store online now? Can you post the fron-end URL?

Thank you

Share this topic:


Page 1 of 1

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users