Я пытаюсь экспортировать настраиваемое поле из моего извлечения в настраиваемое поле 2 в ShipStation, но данные не переносятся в настраиваемое поле 2. Возможно, я использую неправильный мета в моем коде?
Я скопировал отрывок с сайта судовых станций, который я должен добавить к своим функциям. Php
// Add this code to your theme functions.php file or a custom plugin
add_filter( 'woocommerce_shipstation_export_custom_field_2', 'shipstation_custom_field_2' );
function shipstation_custom_field_2() {
return '_meta_key'; // Replace this with the key of your custom field
}
// This is for custom field 3
add_filter( 'woocommerce_shipstation_export_custom_field_3', 'shipstation_custom_field_3' );
function shipstation_custom_field_3() {
return '_meta_key_2'; // Replace this with the key of your custom field
}
Для сайта, над которым я работаю, в моей кассе есть настраиваемое поле оформления заказа для отсутствующих опций. Я заменил '_meta_key_2' на мета для клиентов, у которых нет в наличии опции 'outofstockoption'
function my_custom_checkout_field_update_order_meta( $order_id ) {
if ( ! empty( $_POST['outofstockoption'] ) ) {
update_post_meta( $order_id, 'Out of Stock Option', sanitize_text_field( $_POST['outofstockoption'] ) );
}
}
// Add this code to your theme functions.php file or a custom plugin
add_filter( 'woocommerce_shipstation_export_custom_field_2', 'shipstation_custom_field_2' );
function shipstation_custom_field_2() {
return 'outofstockoption'; // Replace this with the key of your custom field
}
Я надеюсь, что кто-то может направить меня в правильном направлении, как заставить ShipStation вытянуть 'outofstockoption' и поместить это в настраиваемое поле ShipStation. Заранее спасибо.