css - WooCommerce 仪表板 - 突出显示标记为“本地取货”的订单
问题描述
在 WooCommerce 后端,您能否通过 CSS 突出显示“运送至”列中具有“本地取货”的订单?
像这样的东西(黄色背景,边框,任何 css): https ://i.imgur.com/KktgHPL.jpg
我不得不模糊订单数据,我希望我问的很清楚。谢谢!
解决方案
尝试这个
add_action( 'manage_shop_order_posts_custom_column' , 'custom_orders_list_column_content', 10, 2 );
function custom_orders_list_column_content( $column, $post_id ) {
$order = wc_get_order($post_id);
if( $order->has_shipping_method('local_pickup') )
{
?>
<script>
jQuery(document).ready(function(){
jQuery("#post-<?php echo $post_id; ?>").css("background-color", "yellow");
});
</script>
<?php
}
}
推荐阅读
- android - ActivityViewModel + AdapterItemViewModel 连接
- flutter - 向我展示在 Flutter 中执行此操作的更好方法
- c - 取消引用 [] 和 * 之间差异的指针
- c++ - 初始化包含相同类型结构指针的结构指针
- artifactory - 自动删除用户组
- python - Forloop用于将目录中的所有pdf转换为excel文件不起作用 - python
- node.js - 我收到 npm 更新检查失败的警告
- django - Django:从 request.GET 到 QuerySet
- java - JVM 内存使用量超过操作系统报告的
- java - 如何使用Java通过for循环删除ArrayList中的元素