-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Styling WooCommerce template also getting all products
- Loading branch information
Michel Moraes
committed
Oct 15, 2018
1 parent
90c45c5
commit 947552b
Showing
28 changed files
with
11,082 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
|
||
/** | ||
* Edit WooCommerce Checout Fields | ||
*/ | ||
|
||
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); | ||
|
||
function custom_override_checkout_fields( $fields ) { | ||
unset($fields['billing']['billing_company']); | ||
|
||
$fields['billing']['billing_cpf'] = array( | ||
'label' => __('CPF', 'woocommerce'), | ||
'placeholder' => _x('CPF', 'placeholder', 'woocommerce'), | ||
'required' => true, | ||
'class' => array('form-row-wide'), | ||
'clear' => true | ||
); | ||
|
||
return $fields; | ||
} | ||
|
||
/** | ||
* Display field value on the order edit page | ||
*/ | ||
|
||
add_action( 'woocommerce_admin_order_data_after_billing_address', 'my_custom_checkout_field_display_admin_order_meta', 10, 1 ); | ||
|
||
function my_custom_checkout_field_display_admin_order_meta($order){ | ||
echo '<p><strong>'.__('CPF').':</strong> ' . get_post_meta( $order->get_id(), '_billing_cpf', true ) . '</p>'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
/** | ||
* Handle Custom WooCommerce Redirects | ||
*/ | ||
add_action('template_redirect', 'woocommerce_custom_redirections'); | ||
|
||
function woocommerce_custom_redirections() { | ||
/* Case1: Non logged user on checkout page (cart empty or not empty) */ | ||
if ( !is_user_logged_in() && is_checkout() ) | ||
wp_redirect( get_permalink( get_option('woocommerce_myaccount_page_id') ) ); | ||
|
||
/* Case2: Logged user on my account page with something in cart */ | ||
// if( is_user_logged_in() && ! WC()->cart->is_empty() && is_account_page() ) | ||
// wp_redirect( get_permalink( get_option('woocommerce_checkout_page_id') ) ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?php | ||
|
||
// Bootstrapping theme | ||
require_once __DIR__ . '/app/bootstrap.php'; | ||
require_once __DIR__ . '/app/bootstrap.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,9 @@ | |
padding: 17px 0 | ||
border-radius: 50% | ||
|
||
&__items | ||
display: flex | ||
|
||
&__item | ||
margin-top: 15px | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
.woocommerce-thankyou-order-received | ||
&.woocommerce-notice--success | ||
font-size: 28px | ||
padding: 22px | ||
background: #34E990 | ||
color: #464646 | ||
margin-bottom: 45px | ||
letter-spacing: 2.5px | ||
|
||
+mobile | ||
font-size: 22px | ||
|
||
.woocommerce-thankyou-order-failed | ||
&.woocommerce-notice--error | ||
font-size: 28px | ||
padding: 22px | ||
background: #dc4649 | ||
color: #464646 | ||
margin-bottom: 45px | ||
letter-spacing: 2.5px | ||
|
||
+mobile | ||
font-size: 22px | ||
|
||
thead | ||
.woocommerce-table__product-name | ||
&.product-name | ||
background: #e4e4e4 | ||
|
||
.woocommerce-table__product-table | ||
&.product-total | ||
background: #e4e4e4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
@import common | ||
@import single-product | ||
@import tease-product | ||
|
||
@import checkout/thankyou |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.