Skip to content

Commit

Permalink
Merge pull request woocommerce#5198 from claudiosmweb/credit_card_form
Browse files Browse the repository at this point in the history
Becomes possible to translate the credit card form placeholders
  • Loading branch information
mikejolley committed Mar 24, 2014
2 parents a9df2ee + 7ba14b4 commit 34f2170
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions includes/abstracts/abstract-wc-payment-gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,22 +156,22 @@ public function process_payment( $order_id ) {}
*/
public function validate_fields() { return true; }

/**
* If There are no payment fields show the description if set.
* Override this in your gateway if you have some.
*
* @access public
* @return void
*/
public function payment_fields() {
if ( $description = $this->get_description() ) {
echo wpautop( wptexturize( $description ) );
}

if ( $this->supports( 'default_credit_card_form' ) ) {
$this->credit_card_form();
}
}
/**
* If There are no payment fields show the description if set.
* Override this in your gateway if you have some.
*
* @access public
* @return void
*/
public function payment_fields() {
if ( $description = $this->get_description() ) {
echo wpautop( wptexturize( $description ) );
}

if ( $this->supports( 'default_credit_card_form' ) ) {
$this->credit_card_form();
}
}

/**
* Check if a gateway supports a given feature.
Expand Down Expand Up @@ -204,16 +204,16 @@ public function credit_card_form( $args = array(), $fields = array() ) {

$default_fields = array(
'card-number-field' => '<p class="form-row form-row-wide">
<label for="' . esc_attr( $this->id ) . '-card-number">' . __( "Card Number", 'woocommerce' ) . ' <span class="required">*</span></label>
<label for="' . esc_attr( $this->id ) . '-card-number">' . __( 'Card Number', 'woocommerce' ) . ' <span class="required">*</span></label>
<input id="' . esc_attr( $this->id ) . '-card-number" class="input-text wc-credit-card-form-card-number" type="text" maxlength="20" autocomplete="off" placeholder="•••• •••• •••• ••••" name="' . ( $args['fields_have_names'] ? $this->id . '-card-number' : '' ) . '" />
</p>',
'card-expiry-field' => '<p class="form-row form-row-first">
<label for="' . esc_attr( $this->id ) . '-card-expiry">' . __( "Expiry (MM/YY)", 'woocommerce' ) . ' <span class="required">*</span></label>
<input id="' . esc_attr( $this->id ) . '-card-expiry" class="input-text wc-credit-card-form-card-expiry" type="text" autocomplete="off" placeholder="MM / YY" name="' . ( $args['fields_have_names'] ? $this->id . '-card-expiry' : '' ) . '" />
<label for="' . esc_attr( $this->id ) . '-card-expiry">' . __( 'Expiry (MM/YY)', 'woocommerce' ) . ' <span class="required">*</span></label>
<input id="' . esc_attr( $this->id ) . '-card-expiry" class="input-text wc-credit-card-form-card-expiry" type="text" autocomplete="off" placeholder="' . __( 'MM / YY', 'woocommerce' ) . '" name="' . ( $args['fields_have_names'] ? $this->id . '-card-expiry' : '' ) . '" />
</p>',
'card-cvc-field' => '<p class="form-row form-row-last">
<label for="' . esc_attr( $this->id ) . '-card-cvc">' . __( "Card Code", 'woocommerce' ) . ' <span class="required">*</span></label>
<input id="' . esc_attr( $this->id ) . '-card-cvc" class="input-text wc-credit-card-form-card-cvc" type="text" autocomplete="off" placeholder="CVC" name="' . ( $args['fields_have_names'] ? $this->id . '-card-cvc' : '' ) . '" />
<label for="' . esc_attr( $this->id ) . '-card-cvc">' . __( 'Card Code', 'woocommerce' ) . ' <span class="required">*</span></label>
<input id="' . esc_attr( $this->id ) . '-card-cvc" class="input-text wc-credit-card-form-card-cvc" type="text" autocomplete="off" placeholder="' . __( 'CVC', 'woocommerce' ) . '" name="' . ( $args['fields_have_names'] ? $this->id . '-card-cvc' : '' ) . '" />
</p>'
);

Expand Down

0 comments on commit 34f2170

Please sign in to comment.