hi ive replied with new finidngs your plug in doesnt like my functions.php with custom codes
3 things in my functions
1: codes for changing in stock to in stock with suppliers (out of stock and backorder the same
2: admin page on orders shows the VAT with total so its easy for me to view orders at the correct pricing structure
3: an alert to tell users at checkout they have a backorder in their cart (as a warning).
im rolling back again cuase i updated it and was fine until i reuploaded my functions (Woocommerce and my theme had a update and hence the functions got wiped so i re applied the lines of code.
This is the lines of code
add_filter( ‘woocommerce_get_availability’, ‘wcs_custom_get_availability’, 1, 2);
function wcs_custom_get_availability( $availability, $_product ) {
// Change In Stock Text
if ( $_product->is_in_stock() ) {
$availability['availability'] = __('In stock with Supplier', 'woocommerce');
}
// Change Out of Stock Text
if ( ! $_product->is_in_stock() ) {
$availability['availability'] = __('Supplier out of stock', 'woocommerce');
}
// Change Available on backorder Text
if ( $_product->is_on_backorder() ) {
$availability['availability'] = __('Available on Backorder / Request', 'woocommerce');
}
return $availability;
}
add_action( ‘woocommerce_admin_order_item_values’, ‘action_woocommerce_admin_order_item_values’, 10, 3 );
function action_woocommerce_admin_order_item_values( $null, $item, $item_id ) {
$validOrderItemTypes = [‘line_item’, ‘shipping’, ‘fee’];
$val = ( in_array( $item[‘type’], $validOrderItemTypes )) ? $item[‘total’] + $item[‘total_tax’] : ‘?’;
$price = wc_price( $val );
?>
<?php
};
add_action( ‘woocommerce_admin_order_item_headers’, ‘action_woocommerce_admin_order_item_headers’, 10, 3 );
function action_woocommerce_admin_order_item_headers( $order ) {
echo ‘Price incl. VAT’;
}
I dont know how tihs breaks the site when your plug is updated