JSFiddle - React, Tailwind, and code Playground
JavaScript
< ? php
/**
* Main functions file
*
* @package WordPress
* @subpackage Shop Isle
*/
/**
* Initialize all the things.
*/
require get_template_directory().
'/inc/init.php';
/**
* Note: Do not add any custom code here. Please use a child theme so that your customizations aren't lost during updates.
* http://codex.wordpress.org[...]
*/
// Fjerner firma fra checkout
add_filter('woocommerce_checkout_fields', 'custom_override_checkout_fields');
function custom_override_checkout_fields($fields) {
unset($fields['billing']['billing_company']);
return $fields;
}
add_filter('woocommerce_email_attachments', 'attach_terms_conditions_pdf_to_email', 10, 3);
function attach_terms_conditions_pdf_to_email($attachments, $status, $object) {
$allowed_statuses = array('customer_processing_order');
if (isset($status) && in_array($status, $allowed_statuses)) {
$your_pdf_path = get_stylesheet_directory().'/handelsbetingelser.pdf';
$attachments = [
$your_pdf_path,
];
}
return $attachments;
}