如何查询woocommerce运输方式税价?

时间:2017-10-22 20:18:09

标签: php woocommerce

如何查询woocommerce运输方式税价?

Porblem我不征税+ prive查询! 价格查询:

<?php if($method->cost > 0) : ?>+<span style="font-weight: normal"><?= $method->cost ?> Ft</span><?php endif; ?>
                                        </label>
                                    </div>

我的代码是:

            <h2>Átvételi mód</h2>
            <?php
            $packages = WC()->shipping->get_packages();
            $first = true;
            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() . ' &times;' . $values['quantity'];
                    }
                    $product_names = apply_filters('woocommerce_shipping_package_details_array', $product_names, $package);
                }

                /** @var WC_Shipping_Rate[] $available_methods */
                $available_methods = $package['rates'];
                $show_package_details = sizeof( $packages ) > 1;
                $package_name = apply_filters( 'woocommerce_shipping_package_name', sprintf( _nx( 'Shipping', 'Shipping %d', ( $i + 1 ), 'shipping packages', 'woocommerce' ), ( $i + 1 ) ), $i, $package );

                ?>
                <div class="shipping atvetelimod">
                    <td data-title="<?php echo esc_attr( $package_name ); ?>">
                        <?php if ( 1 < count( $available_methods ) ) : ?>
                            <div id="shipping_method row">
                                <?php
                                foreach ( $available_methods as $method ) : ?>
                                    <div class="col-lg-6 balraszoveg">
                                        <div class="jobbelvalaszto">
                                            <label class="checkjel">
                                                <input class="legyenelottefeher" type="radio" name="shipping_method[<?= $i ?>]" data-index="<?= $i ?>" id="shipping_method_<?= $i ?>_<?= sanitize_title( $method->id ) ?>" value="<?= esc_attr( $method->id ) ?>" class="shipping_method" <?= checked( $method->id, $chosen_method, false ) ?> />
                                            </label>
                                        </div>
                                        <label class="jobboldaliszoveg" for="shipping_method_<?= $i ?>_<?= sanitize_title( $method->id ) ?>">
                                            <strong><?= $method->get_label() ?></strong><br />
                                            <?php if($method->cost > 0) : ?>+<span style="font-weight: normal"><?= $method->cost ?> Ft</span><?php endif; ?>
                                        </label>
                                    </div>
                                <?php endforeach; ?>
                            </div>
                        <?php elseif ( 1 === count( $available_methods ) ) :  ?>
                            <?php
                            $method = current( $available_methods );
                            printf( '%3$s <input type="hidden" name="shipping_method[%1$d]" data-index="%1$d" id="shipping_method_%1$d" value="%2$s" class="shipping_method" />', $index, esc_attr( $method->id ), wc_cart_totals_shipping_method_label( $method ) );
                            do_action( 'woocommerce_after_shipping_rate', $method, $index );
                            ?>
                        <?php elseif ( WC()->customer->has_calculated_shipping() ) : ?>
                            <?php echo apply_filters( is_cart() ? 'woocommerce_cart_no_shipping_available_html' : 'woocommerce_no_shipping_available_html', wpautop( __( 'There are no shipping methods available. Please ensure that your address has been entered correctly, or contact us if you need any help.', 'woocommerce' ) ) ); ?>
                        <?php elseif ( ! is_cart() ) : ?>
                            <?php echo wpautop( __( 'Enter your full address to see shipping costs.', 'woocommerce' ) ); ?>
                        <?php endif; ?>

                        <?php if ( $show_package_details ) : ?>
                            <?php echo '<p class="woocommerce-shipping-contents"><small>' . esc_html( $package_details ) . '</small></p>'; ?>
                        <?php endif; ?>

                        <?php if ( ! empty( $show_shipping_calculator ) ) : ?>
                            <?php woocommerce_shipping_calculator(); ?>
                        <?php endif; ?>
                    </td>
                </div>
            <?php }; ?>

0 个答案:

没有答案