Skip to content

Instantly share code, notes, and snippets.

@marcosfreitas
Last active December 22, 2015 09:48
Show Gist options
  • Save marcosfreitas/6453836 to your computer and use it in GitHub Desktop.
Save marcosfreitas/6453836 to your computer and use it in GitHub Desktop.
my custom add scripts and style to woorpress sites.
<?
# ARCHIVE ONS
wp_enqueue_style('custom_onservices', get_template_directory_uri().'/extras/custom_onservices.css',"09082013","all");
wp_enqueue_style('store style', get_template_directory_uri().'/extras/ons-store.css',"20082013","all");
# BOOTSTRAP
//wp_enqueue_style('bootstrap css', get_template_directory_uri() .'/extras/bootstrap/css/bootstrap.min.css');
wp_enqueue_style('extend bootstrap', get_template_directory_uri() .'/extras/bootstrap/extends/ons-bootstrap.css');
//wp_enqueue_style('bootstrap responsive', get_template_directory_uri() .'/extras/bootstrap/css/bootstrap-responsive.css');
wp_enqueue_script('bootstrap min js', get_template_directory_uri() .'/extras/bootstrap/js/bootstrap.min.js');
wp_enqueue_script('Extra JS ONSERVICES', get_template_directory_uri() .'/extras/ons-store.js');
# Make the theme compatible
add_theme_support( 'woocommerce' );
add_filter('single_add_to_cart_text', 'devons_button_cart_text', 10);
add_filter('add_to_cart_text', 'devons_button_cart_text', 10);
add_filter('woocommerce_order_button_text', 'devons_button_cart_text', 10);
function devons_button_cart_text() {
return __('Adquirir', 'woocommerce');
}
// tradução LAST NAME
add_filter( 'woocommerce_checkout_fields' , 'devons_override_checkout_fields' );
function devons_override_checkout_fields( $fields ) {
$fields['shipping']['shipping_last_name'] = array(
'label' => __('Sobrenome', 'woocommerce'),
//'placeholder' => _x('Phone', 'placeholder', 'woocommerce'),
'required' => true,
'class' => array('form-row-last'),
'clear' => true
); // Our hooked in function - $fields is passed via the filter!
$fields['billing']['billing_last_name'] = array(
'label' => __('Sobrenome', 'woocommerce'),
//'placeholder' => _x('Phone', 'placeholder', 'woocommerce'),
'required' => true,
'class' => array('form-row-last'),
'clear' => true
); // Our hooked in function - $fields is passed via the filter!
/* $fields['woocommerce_is_account_page']['order_comments'] = array(
'label' => __('Sobrenome', 'woocommerce'),
//'placeholder' => _x('Phone', 'placeholder', 'woocommerce'),
'required' => true,
'class' => array('form-row-first'),
'clear' => true
); // Our hooked in function - $fields is passed via the filter!*/
return $fields;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment