How to remove require fields, delivery and payment

shawty

No avatar

2008-05-11 12:16

Good day! I've got one more question...

How to change require fields in order form? I just don't need "Delivery and payment" and want to delete this fields...

» Quick.Cart v3.x

treewood (OpenSolution)

Avatar: treewood

2008-05-12 08:06

shawty -
1. edit templates/orders_form.tpl and if you want to disable require field for example sLastName then delete from input this: alt="simple"
2. edit core/orders.php and find function checkFields(). If You want to delete sLastName then delete this:
&& throwStrLen( $aForm['sLastName'] ) > 2

If You want delete delivery and payment then delete in this function that:

    if( isset( $aForm['sPaymentCarrier'] ) ){
      
$aExp explode';'$aForm['sPaymentCarrier'] );
      if( isset( 
$aExp[0] ) && isset( $aExp[1] ) )
        
$sPrice $this->throwPaymentCarrierPrice$aExp[0], $aExp[1] );
    }
    else{
      return 
false;
    }

and

&& isset( $sPrice )



In templates/orders_form.tpl find HTML code where is deliveryAndPayment and delete this

    <fieldset id="deliveryAndPayment">
      <
legend>$lang[Delivery_and_payment]</legend>
      
$sPaymentCarriers
    
</fieldset>



In order print templates/orders_print.tpl delete this:

      <tr class="summaryDelivery">
        <
th colspan="3">$lang[Delivery_and_payment]: $aOrder[sCarrierName], $aOrder[sPaymentName]</th>
        <
td id="carrierCost">$aOrder[sPaymentCarrierPrice]</td>
      </
tr>


Works?

shawty

No avatar

2008-05-12 09:02

If You want delete delivery and payment then delete in this function that:
if( isset( $aForm['sPaymentCarrier'] ) ){
$aExp = explode( ';', $aForm['sPaymentCarrier'] );
if( isset( $aExp[0] ) && isset( $aExp[1] ) )
$sPrice = $this->throwPaymentCarrierPrice( $aExp[0], $aExp[1] );
}
else{
return false;
}


In templates/orders_form.tpl find HTML code where is deliveryAndPayment and delete this
<fieldset id="deliveryAndPayment">
<legend>$lang[Delivery_and_payment]</legend>
$sPaymentCarriers
</fieldset>


In order print templates/orders_print.tpl delete this:
<tr class="summaryDelivery">
<th colspan="3">$lang[Delivery_and_payment]: $aOrder[sCarrierName], $aOrder[sPaymentName]</th>
<td id="carrierCost">$aOrder[sPaymentCarrierPrice]</td>
</tr>

This all works! But!


1. edit templates/orders_form.tpl and if you want to disable require field for example sLastName then delete from input this: alt="simple"

I didn't find this for delivery i payment method in this file.. I deleted "delivery and payment" from form. But script still wants that I choose delivery and payment method. May be it is still a require field?

shawty

No avatar

2008-05-12 09:21

So after I filled in First name,Last name (all this fields, in this form). It still ask to check ruquire fields.

treewood (OpenSolution)

Avatar: treewood

2008-05-13 09:14

shawty - if it still ask for delivery then you propably didn't delete this:

    <fieldset id="deliveryAndPayment">
      <
legend>$lang[Delivery_and_payment]</legend>
      
$sPaymentCarriers
    
</fieldset>

Where it ask? In JavaScript when small window display you errors or in PHP after You click "send" and page will reload?

shawty

No avatar

2008-05-13 10:31

I deleted this code.
Error after I click "send".
When get back what I deleted i choose delivery method, everything is ok.

But now... I changed and deleted everything like you said. "Delivery and payment" fields has gone. But after I file in all rest require fields and click "send order", page is reloading and still asking me to fill in fields. But I has done it already.

treewood (OpenSolution)

Avatar: treewood

2008-05-13 11:53

shawty - delete then from core/orders.php this:

&& isset( $sPrice )

shawty

No avatar

2008-05-13 14:52

Thank you very much! It works! Great!

lovevs

No avatar

2008-06-17 06:26

Hi Treewood.

I've followed all the above but after I click on "Send Order", it shows the message to ask me to go back and fill in all the required fields. Where did it go wrong?

I have attached my templates/orders_form.tpl

<?
<!-- BEGIN ORDER_FORM -->
<
script type="text/javascript" src="$config[dir_core]checkForm.js"></script>
<div id="order">
  <form action="$aData[sLinkName]" method="post" onsubmit="return checkForm( this )" id="orderForm">
    <fieldset id="personalDataBlock">
      <legend>$lang[Your_personal_information]</legend>
      <fieldset id="personalData">
        <fieldset id="setBasic">
          <div id="firstName">
            <label for="oFirstName">$lang[First_name]</label>
            <input type="text" name="sFirstName" value="$aUser[sFirstName]" maxlength="30" class="input" onblur="saveUserData( this.name, this.value )" id="oFirstName" alt="simple" />
          </div>
          <div id="lastName">
            <label for="oLastName">$lang[Last_name]</label>
            <input type="text" name="sLastName" value="$aUser[sLastName]" maxlength="40" class="input" onblur="saveUserData( this.name, this.value )" id="oLastName" alt="simple" />
          </div>
          <div id="company">
            <label for="oCompany">$lang[Company]</label>
            <input type="text" name="sCompanyName" value="$aUser[sCompanyName]" maxlength="100" class="input" onblur="saveUserData( this.name, this.value )" id="oCompany" />
          </div>
          <div id="street">
            <label for="oStreet">$lang[Street]</label>
            <input type="text" name="sStreet" value="$aUser[sStreet]" maxlength="40" class="input" onblur="saveUserData( this.name, this.value )" id="oStreet" alt="simple" />
          </div>
          <div id="zipCode">
            <label for="oZipCode">$lang[Zip_code]</label>
            <input type="text" name="sZipCode" value="$aUser[sZipCode]" maxlength="20" class="input" onblur="saveUserData( this.name, this.value )" id="oZipCode" alt="simple" />
          </div>
          <div id="city">
            <label for="oCity">$lang[City]</label>
            <input type="text" name="sCity" value="$aUser[sCity]" maxlength="40" class="input" onblur="saveUserData( this.name, this.value )" id="oCity" alt="simple" />
          </div>
        </fieldset>
        <fieldset id="setExtend">
          <div id="phone">
            <label for="oPhone">$lang[Telephone]</label>
            <input type="text" name="sPhone" value="$aUser[sPhone]" maxlength="40" class="input" onblur="saveUserData( this.name, this.value )" id="oPhone" alt="simple" />
          </div>
          <div id="email">
            <label for="oEmail">$lang[Email]</label>
            <input type="text" name="sEmail" value="$aUser[sEmail]" maxlength="40" class="input" onblur="saveUserData( this.name, this.value )" id="oEmail" alt="email" />
          </div>
          <div id="comment">
            <label for="oComment">$lang[Order_comment]</label>
            <textarea name="sComment" cols="50" rows="9" id="oComment"></textarea>
          </div>
        </fieldset>
      </fieldset>
    </fieldset>

    <fieldset id="orderedProducts">
      <legend>$lang[Ordered_products]</legend>
      $sOrderProducts
    </fieldset>
  </form>
</div>
<!-- END ORDER_FORM -->
<!-- BEGIN RULES_ACCEPT -->
<input type="hidden" name="iRules" value="1" />
<em><input type="checkbox" name="iRulesAccept" value="1" alt="box;$lang[Require_rules_accept]" /></em>
<span>$lang[Rules_accept] (<a href="$aRules[sLinkName]" class="new-window">$lang[rules_read] &raquo;</a>).</span>
<!-- END RULES_ACCEPT -->

<!-- BEGIN ORDER_PRODUCTS_LIST -->
<tr class="l$aData[sStyle]">
  <th>
    <a href="$aData[sLinkName]">$aData[sName]</a>
  </th>
  <td class="price">
    $aData[sPrice]
  </td>
  <td class="quantity">
    $aData[iQuantity]
  </td>
  <td class="summary">
    $aData[sSummary]
  </td>
</tr>
<!-- END ORDER_PRODUCTS_LIST -->
<!-- BEGIN ORDER_PRODUCTS_HEAD -->
<script type="text/javascript">
<!--
var fOrderSummary = "$aData[fProductsSummary]";
AddOnload( checkSavedUserData );
//-->
</script>
<div>
  <table cellspacing="0">
    <thead>
      <tr>
        <td class="name">
          $lang[Name]
        </td>
        <td class="price">
          <em>$lang[Price]</em><span>[$config[currency_symbol]]</span>
        </td>
        <td class="quantity">
          $lang[Quantity]
        </td>
        <td class="summary">
          <em>$lang[Summary]</em><span>[$config[currency_symbol]]</span>
        </td>
      </tr>
    </thead>
    <tfoot>
      <tr class="summaryProducts">
        <th colspan="3">
          $lang[Order_summary]
        </th>
        <td>
          $aData[sProductsSummary]
        </td>
      </tr>
      <tr class="summaryDelivery">
        <th colspan="3">
          $lang[Delivery_and_payment]
        </th>
        <td id="carrierCost">
          0.00
        </td>
      </tr>
      <tr class="summaryOrder">
        <th colspan="3">
          $lang[Summary_cost]
        </th>
        <td id="orderSummary">
          $aData[sProductsSummary]
        </td>
      </tr>
      <tr id="rulesAccept">
        <th colspan="4">
          $sRules
        </th>
      </tr>
      <tr id="nextStep">
        <th colspan="4" class="nextStep">
          <input type="submit" value="$lang[order_send] &raquo;" name="sOrderSend" class="submit" />
        </th>
      </tr>
    </tfoot>
    <tbody>
<!-- END ORDER_PRODUCTS_HEAD -->
<!-- BEGIN ORDER_PRODUCTS_FOOT -->
    </tbody>
  </table>
</div>
<!-- END ORDER_PRODUCTS_FOOT -->

<!-- BEGIN ORDER_PAYMENTS -->
<th>
  <em>$aData[sName]</em><span>[$config[currency_symbol]]</span>
</th>
<!-- END ORDER_PAYMENTS -->
<!-- BEGIN ORDER_CARRIERS -->
<tr>
  <th>$aData[sName]</th>
  $aData[sPayments]
</tr>
<!-- END ORDER_CARRIERS -->
<!-- BEGIN ORDER_PAYMENT_CARRIERS_LIST -->
<td><input type="radio" name="sPaymentCarrier" value="$aData[iCarrier];$aData[iPayment];$aData[fPaymentCarrierPrice]" onclick="countCarrierPrice( this )" alt="radio;$lang['Select_delivery_and_payment']" />$aData[sPaymentCarrierPrice]</td>
<!-- END ORDER_PAYMENT_CARRIERS_LIST -->
<!-- BEGIN ORDER_PAYMENT_CARRIERS_EMPTY -->
<td>&nbsp;</td>
<!-- END ORDER_PAYMENT_CARRIERS_EMPTY -->
<!-- BEGIN ORDER_PAYMENT_CARRIERS_HEAD -->
<table cellspacing="0">
  <thead>
    <tr>
      <td>&nbsp;</td>
      $aData[sPaymentList]
    </tr>
  </thead>
  <tbody>
<!-- END ORDER_PAYMENT_CARRIERS_HEAD -->
<!-- BEGIN ORDER_PAYMENT_CARRIERS_FOOT -->
  </tbody>
</table>
<!-- END ORDER_PAYMENT_CARRIERS_FOOT -->
?>

Lovevs

treewood (OpenSolution)

Avatar: treewood

2008-06-17 09:17

lovevs - you must edit core/orders.php and change required fields in function checkFields()

lovevs

No avatar

2008-06-17 20:19

HI Treewood. Thanks for your reply. I have remove from core/orders.php the following :

<?
 
if( isset( $aForm['sPaymentCarrier'] ) ){
      
$aExp explode';'$aForm['sPaymentCarrier'] );
      if( isset( 
$aExp[0] ) && isset( $aExp[1] ) )
        
$sPrice $this->throwPaymentCarrierPrice$aExp[0], $aExp[1] );
    }
    else{
      return 
false;
    }
and
&& isset( 
$sPrice 
?>



The same result happened that after I click on "Send Order", it shows the message to ask me to go back and fill in all the required fields. Where else goes wrong?

lovevs

No avatar

2008-06-20 13:44

HI anyone got any other solutions ? I would be really grateful cos I'm really lost on this ...

Back to top
about us | contact