基于这个问题,我在我正在建立的商店的运输方式中添加了一些图标。我通过使用以下代码使用了 png 图像:
add_filter( 'woocommerce_cart_shipping_method_full_label', 'filter_woocommerce_cart_shipping_method_full_label', 10, 2 );
function filter_woocommerce_cart_shipping_method_full_label( $label, $method ) {
// Use the condition here with $method to apply the image to a specific method.
if( $method->method_id == "flat_rate" ) {
$label = $label.('<img src="https://www.website-link/wp-content/uploads/2020/08/002-truck.png">');
} else if( $method->method_id == "local_pickup" ) {
$label = $label.('<img src="https://www.website-link/wp-content/uploads/2020/08/001- discount.png">');
}
return $label;
}
我想改变一件事,但我不知道如何去做。我希望图标显示在送货方式名称旁边。不,它在下面。关于如何解决这个问题有什么想法吗?
qq_遁去的一_1