Sunday, December 25, 2022
HomeWordPress Developmentplugins - qTranslate‑X isn't translating all shortcodes

plugins – qTranslate‑X isn’t translating all shortcodes


I’m utilizing the plugins “WooCommerce”, “qTranslate‑X” and “WooCommerce & qTranslate-X”.

The cart web page is displaying superb on the German web page, however on the English web page, the browser reveals the textual content “Sorry, this entry is just out there in German.“.

I’ve discovered that it’s due to do_action( 'woocommerce_cart_collaterals' ) in cart.php. If I take away that code, the English web page could be loaded usually, however in fact the shortcode part can be eliminated then.

The identical drawback I’ve on the English checkout web page. That is how your complete code appears like:

<?php
/**
 * Cart Web page
 *
 * This template could be overridden by copying it to yourtheme/woocommerce/cart/cart.php.
 *
 * HOWEVER, now and again WooCommerce might want to replace template information and also you
 * (the theme developer) might want to copy the brand new information to your theme to
 * preserve compatibility. We strive to do that as little as attainable, nevertheless it does
 * occur. When this happens the model of the template file can be bumped and
 * the readme will record any necessary modifications.
 *
 * @see     https://docs.woocommerce.com/doc/template-structure/
 * @writer  WooThemes
 * @package deal WooCommerce/Templates
 * @model 3.3.0
 */

if ( ! outlined( 'ABSPATH' ) ) {
    exit;
}

wc_print_notices();

do_action( 'woocommerce_before_cart' ); ?>

<kind class="woocommerce-cart-form" motion="<?php echo esc_url( wc_get_cart_url() ); ?>" methodology="put up">
    <?php do_action( 'woocommerce_before_cart_table' ); ?>

    <desk class="shop_table shop_table_responsive cart woocommerce-cart-form__contents" cellspacing="0">
        <thead>
            <tr>
                <th class="product-remove">&nbsp;</th>
                <th class="product-thumbnail">&nbsp;</th>
                <th class="product-name"><?php esc_html_e( 'Product', 'woocommerce' ); ?></th>
                <th class="product-price"><?php esc_html_e( 'Worth', 'woocommerce' ); ?></th>
                <th class="product-quantity"><?php esc_html_e( 'Amount', 'woocommerce' ); ?></th>
                <th class="product-subtotal"><?php esc_html_e( 'Complete', 'woocommerce' ); ?></th>
            </tr>
        </thead>
        <tbody>
            <?php do_action( 'woocommerce_before_cart_contents' ); ?>

            <?php
            foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
                $_product   = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
                $product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key );

                if ( $_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters( 'woocommerce_cart_item_visible', true, $cart_item, $cart_item_key ) ) {
                    $product_permalink = apply_filters( 'woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink( $cart_item ) : '', $cart_item, $cart_item_key );
                    ?>
                    <tr class="woocommerce-cart-form__cart-item <?php echo esc_attr( apply_filters( 'woocommerce_cart_item_class', 'cart_item', $cart_item, $cart_item_key ) ); ?>">

                        <td class="product-remove">
                            <?php
                                // @codingStandardsIgnoreLine
                                echo apply_filters( 'woocommerce_cart_item_remove_link', sprintf(
                                    '<a href="%s" class="take away" aria-label="%s" data-product_id="%s" data-product_sku="%s">&instances;</a>',
                                    esc_url( wc_get_cart_remove_url( $cart_item_key ) ),
                                    __( 'Take away this merchandise', 'woocommerce' ),
                                    esc_attr( $product_id ),
                                    esc_attr( $_product->get_sku() )
                                ), $cart_item_key );
                            ?>
                        </td>

                        <td class="product-thumbnail"><?php
                        $thumbnail = apply_filters( 'woocommerce_cart_item_thumbnail', $_product->get_image(), $cart_item, $cart_item_key );

                        if ( ! $product_permalink ) {
                            echo $thumbnail;
                        } else {
                            printf( '<a href="%s">%s</a>', esc_url( $product_permalink ), $thumbnail );
                        }
                        ?></td>

                        <td class="product-name" data-title="<?php esc_attr_e( 'Product', 'woocommerce' ); ?>"><?php
                        if ( ! $product_permalink ) {
                            echo apply_filters( 'woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key ) . '&nbsp;';
                        } else {
                            echo apply_filters( 'woocommerce_cart_item_name', sprintf( '<a href="%s">%s</a>', esc_url( $product_permalink ), $_product->get_name() ), $cart_item, $cart_item_key );
                        }

                        // Meta information.
                        echo wc_get_formatted_cart_item_data( $cart_item );

                        // Backorder notification.
                        if ( $_product->backorders_require_notification() && $_product->is_on_backorder( $cart_item['quantity'] ) ) {
                            echo '<p class="backorder_notification">' . esc_html__( 'Accessible on backorder', 'woocommerce' ) . '</p>';
                        }
                        ?></td>

                        <td class="product-price" data-title="<?php esc_attr_e( 'Worth', 'woocommerce' ); ?>">
                            <?php
                                echo apply_filters( 'woocommerce_cart_item_price', WC()->cart->get_product_price( $_product ), $cart_item, $cart_item_key );
                            ?>
                        </td>

                        <td class="product-quantity" data-title="<?php esc_attr_e( 'Amount', 'woocommerce' ); ?>"><?php
                        if ( $_product->is_sold_individually() ) {
                            $product_quantity = sprintf( '1 <enter kind="hidden" identify="cart[%s][qty]" worth="1" />', $cart_item_key );
                        } else {
                            $product_quantity = woocommerce_quantity_input( array(
                                'input_name'    => "cart[{$cart_item_key}][qty]",
                                'input_value'   => $cart_item['quantity'],
                                'max_value'     => $_product->get_max_purchase_quantity(),
                                'min_value'     => '0',
                                'product_name'  => $_product->get_name(),
                            ), $_product, false );
                        }

                        echo apply_filters( 'woocommerce_cart_item_quantity', $product_quantity, $cart_item_key, $cart_item );
                        ?></td>

                        <td class="product-subtotal" data-title="<?php esc_attr_e( 'Complete', 'woocommerce' ); ?>">
                            <?php
                                echo apply_filters( 'woocommerce_cart_item_subtotal', WC()->cart->get_product_subtotal( $_product, $cart_item['quantity'] ), $cart_item, $cart_item_key );
                            ?>
                        </td>
                    </tr>
                    <?php
                }
            }
            ?>

            <?php do_action( 'woocommerce_cart_contents' ); ?>

            <tr>
                <td colspan="6" class="actions">

                    <?php if ( wc_coupons_enabled() ) { ?>
                        <div class="coupon">
                            <label for="coupon_code"><?php esc_html_e( 'Coupon:', 'woocommerce' ); ?></label> <enter kind="textual content" identify="coupon_code" class="input-text" id="coupon_code" worth="" placeholder="<?php esc_attr_e( 'Coupon code', 'woocommerce' ); ?>" /> <enter kind="submit" class="button" identify="apply_coupon" worth="<?php esc_attr_e( 'Apply coupon', 'woocommerce' ); ?>" />
                            <?php do_action( 'woocommerce_cart_coupon' ); ?>
                        </div>
                    <?php } ?>

                    <button kind="submit" class="button" identify="update_cart" worth="<?php esc_attr_e( 'Replace cart', 'woocommerce' ); ?>"><?php esc_html_e( 'Replace cart', 'woocommerce' ); ?></button>

                    <?php do_action( 'woocommerce_cart_actions' ); ?>

                    <?php wp_nonce_field( 'woocommerce-cart' ); ?>
                </td>
            </tr>

            <?php do_action( 'woocommerce_after_cart_contents' ); ?>
        </tbody>
    </desk>
    <?php do_action( 'woocommerce_after_cart_table' ); ?>
</kind>

<div class="cart-collaterals">
    <?php
        /**
         * Cart collaterals hook.
         *
         * @hooked woocommerce_cross_sell_display
         * @hooked woocommerce_cart_totals - 10
         */                         
         
        do_action( 'woocommerce_cart_collaterals' );
    ?>
</div>

<?php do_action( 'woocommerce_after_cart' ); ?>

This time, it’s due to do_action( 'woocommerce_cart_collaterals' );. If I take away that line, the english web page could be loaded usually.

I do not perceive the textual content “Sorry, this entry is just out there in German.“, because the important content material of WooCommerce is in English. So both method, it can’t be that the interpretation is lacking.

Additionally, I’ve discovered, it’s due to the plugin Auto Coupons for WooCommerce. If I deactivate this plugin, it really works superb.

How can I repair this?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments