Eshop
B2B / Invoice
When you activate the B2B option (Invoice required), the website will have all the prices and "Add to Cart" buttons hidden, unless the user is logged-in. Additionally, four new fields will appear about the Invoice fields.
// Filter to change default state of invoice
add_filter('hta_invoice_default_value', function() { return '0'; });
// Disallow user to change their invoice data
add_filter('hta_allow_invoice_editing', '__return_false');
// Add a new field to the Invoice
function add_officer_invoice($fields) {
$fields['billing_officer'] = array(
'label' => __('Υπεύθυνος Επικοινωνίας', 'xlate'),
'required' => true,
'type' => 'text',
'placeholder' => '',
);
return $fields;
}
add_filter('hta_invoice_fields', 'add_officer_invoice');
Product Attributes
If you want to show default custom attribute labels for products, you can use the filter below:
function custom_set_selected_attributes($selected_attributes) {
if (!is_tax()){
$selected_attributes = array('sklirotita');
}
return $selected_attributes;
}
add_filter('custom_selected_attributes', 'custom_set_selected_attributes');
The code above will modify the labels only on non-category pages. If you want to have the same labels shown universally, you can remove the if (!is_tax())
part.
Secondary product image
Use the snippet below to deactivate the secondary image that appears when you hover a product.
add_filter('enable_secondary_product_image', '__return_false');