Skip to content

Commit

Permalink
Remove brand identification in checkout and tweak styles (#154)
Browse files Browse the repository at this point in the history
* Remove WooCommerce (Payments) reference from default title and description

* Checkout style tweaks

* Bump phpcs testVersion to minimum PHP version
  • Loading branch information
dechov committed Jul 30, 2019
1 parent d21233b commit 0e65042
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 8 deletions.
18 changes: 17 additions & 1 deletion assets/css/wc-payment-checkout.css
@@ -1,5 +1,21 @@
.wc-payment-card-mounted {
#payment .payment_methods li .payment_box.payment_method_woocommerce_payments fieldset {
padding: 0;
}

.payment_method_woocommerce_payments > fieldset > legend {
padding-top: 0;
}

.payment_method_woocommerce_payments .woocommerce-error {
margin: 1em 0 0;
}

#wc-payment-card-element {
border: 1px solid #ddd;
padding: 5px 7px;
min-height: 29px;
}

.wc-payment-card-mounted {
background-color: #fff;
}
2 changes: 1 addition & 1 deletion assets/js/wc-payment-checkout.js
Expand Up @@ -33,7 +33,7 @@ jQuery( function( $ ) {
displayError.html( '<ul class="woocommerce-error"><li /></ul>' )
.find( 'li' ).text( event.error.message );
} else {
displayError.html( '' );
displayError.empty();
}
} );

Expand Down
13 changes: 8 additions & 5 deletions includes/class-wc-payment-gateway-wcpay.php
Expand Up @@ -63,7 +63,7 @@ public function __construct( WC_Payments_API_Client $payments_api_client ) {
$this->icon = ''; // TODO: icon.
$this->has_fields = true;
$this->method_title = __( 'WooCommerce Payments', 'woocommerce-payments' );
$this->method_description = __( 'Accept payments via a WooCommerce-branded payment gateway', 'woocommerce-payments' );
$this->method_description = __( 'Accept payments via credit card.', 'woocommerce-payments' );
$this->supports = array(
'products',
'refunds',
Expand All @@ -82,14 +82,14 @@ public function __construct( WC_Payments_API_Client $payments_api_client ) {
'title' => __( 'Title', 'woocommerce-payments' ),
'type' => 'text',
'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-payments' ),
'default' => __( 'Credit Card (WooCommerce Payments)', 'woocommerce-payments' ),
'default' => __( 'Credit Card', 'woocommerce-payments' ),
'desc_tip' => true,
),
'description' => array(
'title' => __( 'Description', 'woocommerce-payments' ),
'type' => 'text',
'description' => __( 'This controls the description which the user sees during checkout.', 'woocommerce-payments' ),
'default' => __( 'Pay with your credit card via WooCommerce Payments.', 'woocommerce-payments' ),
'default' => '',
'desc_tip' => true,
),
'stripe_account_id' => array(
Expand Down Expand Up @@ -183,9 +183,12 @@ public function payment_fields() {

// Output the form HTML.
?>
<p><?php echo wp_kses_post( $this->get_description() ); ?></p>
<fieldset>
<div id="wc-payment-card-element" class="form-row"></div>
<?php if ( ! empty( $this->get_description() ) ) : ?>
<legend><?php echo wp_kses_post( $this->get_description() ); ?></legend>
<?php endif; ?>

<div id="wc-payment-card-element"></div>
<div id="wc-payment-errors" role="alert"></div>
<input id="wc-payment-method" type="hidden" name="wc-payment-method" />
</fieldset>
Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml.dist
Expand Up @@ -10,7 +10,7 @@

<!-- Configs -->
<config name="minimum_supported_wp_version" value="4.7" />
<config name="testVersion" value="5.2-" />
<config name="testVersion" value="5.6-" />

<!-- Rules -->
<rule ref="WooCommerce-Core" >
Expand Down

0 comments on commit 0e65042

Please sign in to comment.