在移动magento的一页结帐中,“继续”按钮无效

时间:2015-09-18 05:45:36

标签: javascript jquery magento magento-1.9 magento-1.9.1

我在我的网站中使用一页结账。当点击“继续”按钮时,我使用了fadein和fadeout js。它在系统和选项卡中工作正常。但是在移动设备上,当我点击“继续”按钮转到下一个选项卡时,它似乎没有工作,似乎js当时没有调用。我使用alert()检查但没有用。

我不知道是什么原因,请查看代码并告诉我它为何无法在移动设备上运行:

<script type="text/javascript">
jQuery(document).ready(function(){  
    jQuery('#first').click(function() { 
            jQuery(".row1").addClass("fade-in");
            jQuery(".row1").removeClass("fade-out");
            jQuery(".row2").addClass("fade-out");
            jQuery(".row2").removeClass("fade-in");
            jQuery(".row3").addClass("fade-in");
            jQuery(".row3").removeClass("fade-out");          
        });         
});        
   </script> 

onepage.phtml

<script type="text/javascript" src="<?php echo $this->getSkinUrl('lotusbreath/onestepcheckout/mage/opcheckout.js') ?>"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('lotusbreath/onestepcheckout/opcheckout_override_mage.js') ?>"></script>
<?php //echo $this->getChildHtml("login");
$isAllowComment = Mage::getStoreConfig('lotusbreath_onestepcheckout/general/allowcomment');

?>

<script id="loader-template" type="text/x-handlebars-template">
    <div class="osc-loader" id="osc-loader">
        <div class="osc-loader-background"></div>
        <div class="loading-mask" data-role="loader">
            <div class="loader">
                <img alt="{{imgAlt}}" src="{{icon}}">
                <p>{{loaderText}}</p>
            </div>
        </div>
    </div>
</script>
<script>
    var loaderJson = {
        imgAlt: '<?php echo $this->__("Please wait...");?>',
        icon: '<?php echo $this->getSkinUrl('lotusbreath/onestepcheckout/images/ajax-loader_3.gif');?>',
        loaderText: '<?php echo $this->__("Please wait...");?>'
    };
</script>



<div class="lt-checkoutpage layout-2col " id="checkoutSteps">
    <?php echo $this->getChildHtml("loginform");?>

    <form id="checkout_form" name="checkout_form">
        <div class="grid">
            <?php if ($pageTitle = Mage::getStoreConfig('lotusbreath_onestepcheckout/content/pagetitle')):?>
            <h2 class="page-title"><?php echo $pageTitle;?></h2>
            <?php endif;?>
            <?php if ($pageDescription = Mage::getStoreConfig('lotusbreath_onestepcheckout/content/pagedescription')):?>
                <p class="page-description"><?php echo $pageDescription;?></p>
            <?php endif;?>
            <?php if (!Mage::helper('customer')->isLoggedIn()) : ?>
                <p><?php echo $this->__("Already registered? Please");?>
                    <a class="login_link" href="javascript:void(0);" id="loginFrmDlgO"> <?php echo $this->__("log in");?> </a></p>
            <?php endif; ?>
            <?php if (Mage::getStoreConfig('lotusbreath_onestepcheckout/content/display_bottom_static_block')): ?>
                <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('onestepcheckout_top_block')->toHtml(); ?>
            <?php endif;?>
            <div class="row  no-padding padding-mobile">
                <div class="four columns">
                    <h3 class="ptitle">
                        <?php if ($billingHeader = Mage::getStoreConfig('lotusbreath_onestepcheckout/content/billing_header')):?>
                            <?php echo $billingHeader;?>
                        <?php else:?>
                            1. <?php echo $this->__("Billing Information"); ?>
                        <?php endif;?>

                    </h3>
                    <?php echo $this->getChildHtml('billing'); ?>
                    <div id="shipping-area" style="display: none;">
                        <h3 class="ptitle">
                            <?php if ($shippingHeader = Mage::getStoreConfig('lotusbreath_onestepcheckout/content/shipping_address_header')):?>
                                <?php echo $shippingHeader;?>
                            <?php else:?>
                                <?php echo $this->__("Shipping Information");?>
                            <?php endif;?>

                        </h3>
                        <?php
                        echo $this->getChildHtml('shipping'); ?>
                    </div>
                </div>
                <div class="eight columns">
                    <div class="row">
                        <?php if(!$this->getQuote()->isVirtual()):?>
                        <div class="five columns">

                            <h3 class="ptitle">
                                <?php if ($shippingMethodHeader = Mage::getStoreConfig('lotusbreath_onestepcheckout/content/shipping_method_header')):?>
                                    <?php echo $shippingMethodHeader;?>
                                <?php else:?>
                                    2. <?php echo $this->__("Shipping Method"); ?>
                                <?php endif;?>
                            </h3>
                            <div id="shipping_partial">
                                <?php echo $this->getChildHtml('shipping_method'); ?>
                            </div>

                        </div>
                        <?php endif;?>
                        <div class="seven columns">
                            <h3 class="ptitle">
                                <?php if ($paymentMethodHeader = Mage::getStoreConfig('lotusbreath_onestepcheckout/content/payment_method_header')):?>
                                    <?php echo $paymentMethodHeader;?>
                                <?php else:?>
                                    3. <?php echo $this->__("Payment Method");?>
                                <?php endif;?>

                            </h3>
                            <div id="payment_partial">
                                <?php echo $this->getChildHtml('payment'); ?>
                            </div>
                        </div>
                    </div>


                    <div class="col-3">


                        <?php if( Mage::getStoreConfig('lotusbreath_onestepcheckout/general/allowshowgiftmessage') ):?>
                            <?php if (!$this->getQuote()->isVirtual()): ?>
                                <?php echo $this->helper('giftmessage/message')->getInline('onepage_checkout', $this->getQuote(), $this->getDontDisplayContainer()) ?>
                            <?php endif; ?>
                        <?php endif;?>
                        <?php if( Mage::getStoreConfig('lotusbreath_onestepcheckout/general/allowshowcoupon') ):?>
                            <div id="coupon_patial">
                                <h3 class="ptitle"><?php echo $this->__("Discount Codes");?></h3>

                                <?php echo $this->getChildHtml('coupon'); ?>
                            </div>
                        <?php endif;?>
                        <?php if( Mage::getStoreConfig('lotusbreath_onestepcheckout/general/allowcomment') ):?>
                            <div id="comment-patial">
                                <h3 class="ptitle"><?php echo $this->__("Comment");?></h3>
                                <ul class="form-list">
                                    <li class="fields">
                                        <div class="input-box">
                                            <textarea name="order_comment" placeholder="<?php echo $this->__("Type comment here");?>" class="input-text"></textarea>
                                        </div>
                                    </li>
                                </ul>
                            </div>
                        <?php endif;?>

                        <h3 class="ptitle">
                            <?php if ($reviewOrderHeader = Mage::getStoreConfig('lotusbreath_onestepcheckout/content/review_header')):?>
                                <?php echo $reviewOrderHeader;?>
                            <?php else:?>
                                4. <?php echo $this->__("Review Order"); ?>
                            <?php endif;?>

                        </h3>
                        <div id="review_partial">
                            <?php echo $this->getData("reviewHtml"); ?>
                            <?php echo $this->getChildHtml('review'); ?>
                        </div>


                    </div>
                </div>

            </div>
            <div class="clearfix"></div>
            <?php if (Mage::getStoreConfig('lotusbreath_onestepcheckout/content/display_bottom_static_block')): ?>
            <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('onestepcheckout_bottom_block')->toHtml(); ?>
            <?php endif;?>
        </div>
    </form>


</div>

billing.phtml

<?php
    $relatedLocationFields = Mage::getStoreConfig("lotusbreath_onestepcheckout/general/location_fields");
    if ($relatedLocationFields){
        $relatedLocationFields = explode(',',$relatedLocationFields);
    }else{
        $relatedLocationFields = array('postcode', 'country_id', 'region_id','city');
    }
    $isAllowGuest = Mage::helper('checkout')->isAllowedGuestCheckout(Mage::getSingleton('checkout/session')->getQuote());
    $isCheckEmailExists = false;
    if (!$isAllowGuest && !Mage::getSingleton('customer/session')->isLoggedIn())
        $isCheckEmailExists = true;

?>

<div style="color:red;" id="billing-error" class="error"></div>
<fieldset>
    <ul class="form-list">
        <?php if ($this->customerHasAddresses()): ?>
            <li class="already-add">
                <p><?php echo $this->__('Select a billing address from your address book or enter a new address.') ?></p>

                <div class="input-box field">
                    <?php echo $this->getAddressesHtmlSelect('billing') ?>
                </div>
            </li>
        <?php endif; ?>
        <li id="billing-new-address-form"<?php if ($this->customerHasAddresses()): ?> style="display:none;"<?php endif; ?>>
            <fieldset>
                <input type="hidden" name="billing[address_id]" value="<?php echo $this->getAddress()->getId() ?>"
                       id="billing:address_id"/>
                <ul>

                    <li class="fields"><?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress()->getFirstname() ? $this->getAddress() : $this->getQuote()->getCustomer())->setForceUseCustomerRequiredAttributes(!$this->isCustomerLoggedIn())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?></li>


                    <?php $_streetValidationClass = $this->helper('lotusbreath_onestepcheckout')->getAttributeValidationClass('street'); ?>
                    <li class="fields">

                        </label>

                          <div class="input-box field input-box-wide">
                        <select  id="billing:company" name="billing[company]"  class="input-text required-entry" >
                        <option value="">Select Address Type</option>
                        <option value="Home Address">Home Address</option>
                        <option value="Office Address">Office Address</option>

                        </select>
                         </div>







                        <div class="input-box field input-box-wide">
                            <input placeholder="Address Line 1" type="text" title="<?php echo $this->__('Address Line 1') ?>"
                                   name="billing[street][]" id="billing:street1"
                                   value="<?php echo $this->escapeHtml($this->getAddress()->getStreet(1)) ?>"
                                   class="input-text <?php echo $_streetValidationClass ?>"/>
                        </div>


                         <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
                    <?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>

                            <div class="input-box field input-box-wide">
                                <input placeholder="Address Line 2" type="text" title="<?php echo $this->__('Street Address %s', $_i) ?>"
                                       name="billing[street][]" id="billing:street<?php echo $_i ?>"
                                       value="<?php echo $this->escapeHtml($this->getAddress()->getStreet($_i)) ?>"
                                       class="input-text <?php echo $_streetValidationClass ?>"/>
                            </div>

                    <?php endfor; ?>

                    </li>

                    <?php
                    $isShowVATNumber = Mage::getStoreConfig('lotusbreath_onestepcheckout/billingaddress/allowshowvatnumberfield');
                    if ($isShowVATNumber && $this->helper('lotusbreath_onestepcheckout')->isVatAttributeVisible()) :
                    //if ($isShowVATNumber):
                    ?>

                        <li class="fields">
                            <div class="field">
                            <label for="billing:vat_id" class="required">
                                <em>*</em>
                                <?php echo $this->__('VAT Number') ?></label>
                            <div class="input-box">
                                <input type="text" id="billing:vat_id" name="billing[vat_id]"
                                       value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()) ?>"
                                       title="<?php echo $this->__('VAT Number') ?>"
                                       class="input-text <?php echo $this->helper('lotusbreath_onestepcheckout')->getAttributeValidationClass('vat_id') ?>"/>
                            </div>
                            </div>
                        </li>
                    <?php endif; ?>
                    <li class="fields">
                        <div class="field">
                            <?php
                            $changeLocationClass = '';
                            if (in_array('city', $relatedLocationFields))
                                $changeLocationClass = 'change_location_field';
                            ?>


                            <div class="input-box">
                                <input placeholder="City" type="text" title="<?php echo $this->__('City') ?>" name="billing[city]"
                                       value="<?php echo $this->escapeHtml($this->getAddress()->getCity()) ?>"
                                       class="<?php echo $changeLocationClass;?> input-text <?php echo $this->helper('lotusbreath_onestepcheckout')->getAttributeValidationClass('city') ?>"
                                       id="billing:city"/>
                            </div>
                        </div>
                        <div class="field region ">



                            <div class="input-box">
                                <?php
                                $changeLocationClass = '';

                                if (in_array('region_id', $relatedLocationFields))
                                    $changeLocationClass = 'change_location_field';
                                ?>
                                <select id="billing:region_id" name="billing[region_id]"
                                        title="<?php echo $this->__('State/Province') ?>" class="validate-select"
                                        class="<?php echo $changeLocationClass;?>"

                                        style="display:none;"
                                        <?php if (Mage::getStoreConfig('general/region/display_all') == false):?>disabled="disabled"<?php endif; ?>
                                    >
                                    <option
                                        value=""><?php echo $this->__('Please select region, state or province') ?></option>
                                </select>
                                <script type="text/javascript">
                                    //<![CDATA[
                                    $('billing:region_id').setAttribute('defaultValue', "<?php echo $this->getAddress()->getRegionId() ?>");
                                    //]]>
                                </script>
                                <input type="text" id="billing:region" name="billing[region]"
                                       value="<?php echo $this->escapeHtml($this->getAddress()->getRegion()) ?>"
                                       title="<?php echo $this->__('State/Province') ?>"
                                       class=" <?php echo $changeLocationClass;?> input-text <?php echo $this->helper('lotusbreath_onestepcheckout')->getAttributeValidationClass('region') ?>"
                                       style="display:none;"
                                       <?php if (Mage::getStoreConfig('general/region/display_all') == false):?>disabled="disabled"<?php endif; ?>
                                    />
                            </div>
                        </div>
                    </li>
                    <li class="fields">
                        <div class="field">


                            <div class="input-box">
                                <?php
                                $changeLocationClass = '';
                                if (in_array('postcode', $relatedLocationFields))
                                    $changeLocationClass = 'change_location_field';
                                ?>
                                <input placeholder="Zip code" type="text" title="<?php echo $this->__('Zip code') ?>"
                                       name="billing[postcode]" id="billing:postcode"
                                       value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>"
                                       class="<?php echo $changeLocationClass; ?> input-text validate-zip-international <?php echo $this->helper('lotusbreath_onestepcheckout')->getAttributeValidationClass('postcode') ?>"/>
                            </div>
                        </div>
                        <div class="field">

                            <div class="input-box">
                                <?php echo $this->getCountryHtmlSelect('billing') ?>
                            </div>
                            <?php
                            $changeLocationClass = '';
                            if (in_array('country_id', $relatedLocationFields)):
                                $changeLocationClass = 'change_location_field';

                            ?>
                            <script>
                                var billingCountry = document.getElementById("billing:country_id");
                                billingCountry.setAttribute('class', billingCountry.getAttribute('class') + ' <?php echo $changeLocationClass;?>');

                            </script>
                            <?php endif;?>
                            <?php
                            $changeLocationClass = '';
                            if (in_array('region_id', $relatedLocationFields)):
                                $changeLocationClass = 'update-location-region-class';
                            ?>
                            <script>
                                var billingCountry = document.getElementById("billing:country_id");
                                billingCountry.setAttribute('class', billingCountry.getAttribute('class') + ' <?php echo $changeLocationClass;?>');

                            </script>
                            <?php endif;?>
                        </div>
                    </li>
                    <li class="fields">
                        <div class="field">


                            <div class="input-box">
                                <input placeholder="Phone No" type="text" name="billing[telephone]"
                                       value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>"
                                       title="<?php echo $this->__('Phone No') ?>"
                                       class="input-text <?php echo $this->helper('lotusbreath_onestepcheckout')->getAttributeValidationClass('telephone') ?>"
                                       id="billing:telephone"/>
                            </div>
                        </div>
                        <?php if (Mage::getStoreConfig('lotusbreath_onestepcheckout/billingaddress/allowshowfaxfield')): ?>
                            <div class="field">
                                <label for="billing:fax"><?php echo $this->__('Fax') ?></label>

                                <div class="input-box">
                                    <input type="text" name="billing[fax]"
                                           value="<?php echo $this->escapeHtml($this->getAddress()->getFax()) ?>"
                                           title="<?php echo $this->__('Fax') ?>"
                                           class="input-text <?php echo $this->helper('lotusbreath_onestepcheckout')->getAttributeValidationClass('fax') ?>"
                                           id="billing:fax"/>
                                </div>
                            </div>
                        <?php endif; ?>
                    </li>
                    <?php if (!$this->isCustomerLoggedIn()): ?>

                        <?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
                        <?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
                        <?php if ($_dob->isEnabled() || $_gender->isEnabled()): ?>
                            <li class="fields">
                                <?php if ($_dob->isEnabled()): ?>
                                    <div class="field">
                                        <?php echo $_dob->setDate($this->getQuote()->getCustomerDob())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
                                    </div>
                                <?php endif; ?>
                                <?php if ($_gender->isEnabled()): ?>
                                    <div class="field">
                                        <?php echo $_gender->setGender($this->getQuote()->getCustomerGender())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
                                    </div>
                                <?php endif ?>
                            </li>
                        <?php endif ?>

                        <?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
                        <?php if ($_taxvat->isEnabled()): ?>
                            <li>
                                <?php echo $_taxvat->setTaxvat($this->getQuote()->getCustomerTaxvat())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
                            </li>
                        <?php endif ?>
                        <?php if ($isAllowGuest):?>
                        <!--<li class="fields">
                            <input type="checkbox" name="billing[create_new_account]"
                                   value=1/> <?php echo $this->__("Register new account"); ?>?
                        </li>-->
                        <?php else: ?>
                            <p><strong><?php echo $this->__("Register new account - Enter your password:"); ?></strong></p>
                        <?php endif; ?>
                        <?php $passwordLiId = $isAllowGuest ? 'register-customer-password' : ''; ?>
                        <li class="fields" id="<?php echo $passwordLiId;?>">
                            <div class="field">
                                <label for="billing:customer_password"
                                       class="required"><em>*</em><?php echo $this->__('Password') ?></label>

                                <div class="input-box">
                                    <input type="password" name="billing[customer_password]"
                                           id="billing:customer_password" title="<?php echo $this->__('Password') ?>"
                                           class="input-text required-entry validate-password"/>
                                </div>
                            </div>
                            <div class="field">
                                <label for="billing:confirm_password"
                                       class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>

                                <div class="input-box">
                                    <input type="password" name="billing[confirm_password]"
                                           title="<?php echo $this->__('Confirm Password') ?>"
                                           id="billing:confirm_password"
                                           class="input-text required-entry validate-cpassword"/>
                                </div>
                            </div>
                        </li>
                    <?php endif; ?>
                    <?php if ($this->isCustomerLoggedIn() && $this->customerHasAddresses()): ?>
                        <li class="control">
                            <input type="checkbox" name="billing[save_in_address_book]" value="1"
                                   title="<?php echo $this->__('Save in address book') ?>"
                                   id="billing:save_in_address_book"
                                   onchange="if(window.shipping) shipping.setSameAsBilling(false);"<?php if ($this->getAddress()->getSaveInAddressBook()): ?> checked="checked"<?php endif; ?>
                                   class="checkbox"/><label class="same-add"
                                for="billing:save_in_address_book"><?php echo $this->__('WANT SAME ADD, FOR MY BILLING') ?></label>
                        </li>
                    <?php else: ?>
                        <li class="no-display"><input type="hidden" name="billing[save_in_address_book]" value="1"/>
                        </li>
                    <?php endif; ?>
                    <?php echo $this->getChildHtml('form.additional.info'); ?>
                </ul>
            </fieldset>
        </li>                
    </ul>
    <?php if (!$this->canShip() || $alwaysusesameasbilling == true): ?>
        <input type="hidden" name="billing[use_for_shipping]" value="1"/>
    <?php endif; ?>
<input type="button" name="button" value="Continue" class="con button gap" id="first">
</fieldset>

0 个答案:

没有答案