تابع ووکامرسی wc_cart_totals_shipping_html نمایش کد html روش های حمل و نقل
تابع ووکامرسی wc_cart_totals_shipping_html – نمایش کد html روش های حمل و نقل
Syntax – سینتکس
wc_cart_totals_shipping_html();
Usage – نحوه استفاده
if ( !function_exists( 'wc_cart_totals_shipping_html' ) ) { require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-cart-functions.php'; } // NOTICE! Understand what this does before running. $result = wc_cart_totals_shipping_html();
Defined – محل تعریف
/includes/wc-cart-functions.php
function wc_cart_totals_shipping_html() { $packages = WC()->shipping->get_packages(); foreach ( $packages as $i => $package ) { $chosen_method = isset( WC()->session->chosen_shipping_methods[ $i ] ) ? WC()->session->chosen_shipping_methods[ $i ] : ''; $product_names = array(); if ( sizeof( $packages ) > 1 ) { foreach ( $package['contents'] as $item_id => $values ) { $product_names[ $item_id ] = $values['data']->get_name() . ' ×' . $values['quantity']; } $product_names = apply_filters( 'woocommerce_shipping_package_details_array', $product_names, $package ); } wc_get_template( 'cart/cart-shipping.php', array( 'package' => $package, 'available_methods' => $package['rates'], 'show_package_details' => sizeof( $packages ) > 1, 'package_details' => implode( ', ', $product_names ), // @codingStandardsIgnoreStart 'package_name' => apply_filters( 'woocommerce_shipping_package_name', sprintf( _nx( 'Shipping', 'Shipping %d', ( $i + 1 ), 'shipping packages', woocommerce ), ( $i + 1 ) ), $i, $package ), // @codingStandardsIgnoreEnd 'index' => $i, 'chosen_method' => $chosen_method, ) ); } }
versions – نسخه ها
از نسخه : 3.0.2
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
ارسال نظر