2015-07-20 84 views
0

我試圖按照這裏的教程,實現了一個簡單的購物車網站上的一個頁面結帳:鏌鋣SimpleCart單頁結帳不工作

https://tutorials.modxsimplecart.com/one-page-checkout

雖然我已經這樣做了,我得到當我嘗試退出時出現(SimpeCart生成)錯誤。正常的2頁檢出工作正常。

有人會知道我能做些什麼來解決這個問題嗎?我的代碼(在一個頁結帳模板)是:

[[!scGetCart]] 

    [[!FormItRetriever? &redirectToOnNotFound=`[[*parent]]`]] 

[[!FormIt? 
    &store=`1` 
    &hooks=`spam,scCreateOrder,redirect` 
    &submitVar=`checkout` 
    &redirectTo=`[[*id:scFirstChild]]` 
    &validate=`nospam:blank, 
     deliveryMethod:required, 
     paymentMethod:required, 
     firstname:required, 
     lastname:required, 
     street:required, 
     number:required, 
     zip:required, 
     city:required, 
     country:required, 
     email:email:required` 
    &orderAddress=`address1:street,address2:number` 
]] 

<form action="[[~[[*id]]]]" method="post" id="simplecartCheckout"> 
    <input type="hidden" name="nospam" value=""> 

    <div> 
     <label for="checkout_firstname">[[%simplecart.orderdetails.address.firstname? &namespace=`simplecart`]]: <span>*</span></label> 
     <input type="text" name="firstname" id="checkout_firstname" value="[[+fi.firstname]]" /> 
     <label class="error">[[+fi.error.firstname]]</label> 
    </div> 

<!--OTHER FORM FIELDS HERE--> 

    <div> 
     <label for="checkout_email">[[%simplecart.orderdetails.address.email]]: <span>*</span></label> 
     <input type="email" name="email" id="checkout_email" value="[[+fi.email]]" /> 
     <label class="error">[[+fi.error.email]]</label> 
    </div> 

    [[!scDeliveryMethods]] 

    [[!scPaymentMethods? &delivery=`[[+fi.deliveryMethod]]`]] 

    <div class="submit"> 
     <input type="submit" name="checkout" value="[[%simplecart.cart.checkout? &namespace=`simplecart` &topic=`cart`]]" /> 
    </div> 

</form> 

我不知道我做錯了或如何解決這個問題。任何人都可以將我指向正確的方向嗎?

回答

0

,我發現這是因爲我是缺少中檢查出的形式交付方法值:

<input type="hidden" name="deliveryMethod" value="[[+fi.deliveryMethod]]" />