wordpress Woocommerce订单页面-更改处理订单的背景颜色?

v7pvogib  于 2023-01-04  发布在  WordPress
关注(0)|答案(3)|浏览(194)

使用WordPress & Woocommerce我想改变的背景表时,收到一个新的订单,并显示为'处理'如我的图片如下所示。
(例如:tr#post-441 {背景色:#bbff7d;})
Background colour on table on woocommerce orders PROCESSING only
我知道有办法通过functions.php文件来实现这一点,我已经搜索了又搜索,但只是需要一个帮手来让它改变颜色。
这将是一个项目的点睛之笔,所以任何帮助都非常感谢。非常感谢-阿什

5vf7fwbs

5vf7fwbs1#

在主题functions.php文件中使用此代码

function change_order_processing_row_color(){?>

 <style type="text/css">
 .status-wc-processing {
        background: green !important;
        color: white !important;
       }
     </style>

   <?php }

   add_action('admin_head','change_order_processing_row_color');
mqkwyuun

mqkwyuun2#

如果有人想改变订单中所有状态的颜色,那么你可以这样做:

order-procesing - red
on-hold - orange
failed - grey
completed - green

将此代码添加到子主题functions.php文件的底部:

function change_order_processing_row_color(){?>

    <style type="text/css">
        .status-wc-processing {
               background: #e98787 !important;
               color: white !important;
              }
    
        .status-wc-on-hold {
               background: #ffd88a !important;
               color: white !important;
              }

        .status-wc-failed {
               background: #999999 !important;
               color: white !important;
              }
    
        .status-wc-completed {
               background: #aad17d !important;
               color: white !important;
              }
            </style>
       
          <?php }
       
          add_action('admin_head','change_order_processing_row_color');
7hiiyaii

7hiiyaii3#

我认为这样更好:

function change_order_processing_row_color(){?>

  <style type="text/css">
      .order-status.status-processing {
                background-color: transparent;
    background-image: linear-gradient(180deg, #017621 8%, #00CC37 100%);
    border-color: #0C9F34;
    border-radius: 360 px !important;
    padding: 360 px;
         color: white;
}
 .status-wc-completed { 
  background-color: transparent;
    background-image: #00CC37;
    border-color: #0C9F34;
    border-radius: 360 px !important;
    padding: 360 px;
         color: white;
    
       }
     .order-preview {
    font-size: 18px;
    font-weight: 700;
    line-height: 28px;
    background-color: transparent;
    background-image: linear-gradient(180deg, #017621 8%, #00CC37 100%);
    border-color: #0C9F34;
    border-radius: 360 px !important;
    padding: 360 px;
         color: white;
}
.post-type-shop_order .wp-list-table .order-preview, .woocommerce_page_wc-orders .wp-list-table .order-preview {
    border: none!important;
    border-radius: 360px!important;
}
      .order-preview:hover {
       background-color: transparent;
    background-image: linear-gradient(180deg, #005617 0%, #00CC37 100%);
          color: white;
}
      
    .post-type-shop_order .wp-list-table tbody td, .post-type-shop_order .wp-list-table tbody th, .woocommerce_page_wc-orders .wp-list-table tbody td, .woocommerce_page_wc-orders .wp-list-table tbody th {

    color: black;
}
     .post-type-shop_order .wp-list-table .column-billing_address .description, .post-type-shop_order .wp-list-table .column-shipping_address .description, .woocommerce_page_wc-orders .wp-list-table .column-billing_address .description, .woocommerce_page_wc-orders .wp-list-table .column-shipping_address .description {
    display: block;
    color: blue;
         font-weight:600;
}
     .order-view{
color:black;
}    

      

   <?php }

   add_action('admin_head','change_order_processing_row_color');

相关问题