Theme doesn’t show Uni CPO options on woocommerce product page

Question

I copied the entire twenty-twenty template to customize it and create a new WordPress template for a website that uses Woocommerce to sell products. This site needed to add options to the products so the user can choose options and the system calculates the price. I use the Uni CPO plugin for this, but it does not work with my theme. It works fine with the original twenty-twenty theme. My searchform.php and singular.php files are exactly the same as twenty-twenty, I have not even edited them. I also tried replacing the twenty-twenty header.php file with mine, but that did nothing either.

It’s not a css issue like none display or 0 opacity. It does not print at all, I checked Inspect and Page Source.

This is the output when the twenty-twenty theme is active (Only Uni CPO part, not the whole page):

<div id="uni_cpo_options" class="uni-builderius-container">
    <input type="hidden" class="js-cpo-pid" name="cpo_product_id" value="49" />
    <input type="hidden" name="add-to-cart" value="49" />
    <input type="hidden" class="js-cpo-product-image" name="cpo_product_image" value="47" />
    <input type="hidden" class="js-cpo-product-layered-image" name="cpo_product_layered_image" value="" />
    <input type="hidden" class="js-cpo-cart-item" name="cpo_cart_item_id" value="1644413296" />
    <div id="" class="uni-node-acf9c4f7">
        <div class="uni-row-content-wrap">
            <!-- -->
            <div class="uni-row-content uni-node-content">
                <div id="" class="uni-node-a59d799c">
                    <div class="uni-col-content uni-node-content">
                        <div id="uni_cpo_cream2" class="uni-module uni-module-select uni-node-209f4efd">
                            <label class="uni-cpo-module-select-label ">
            خامه                        </label>
                            <select class="uni_cpo_cream2-field js-uni-cpo-field js-uni-cpo-field-select" id="uni_cpo_cream2-field" name="uni_cpo_cream2" data-parsley-trigger="change focusout submit">
                                <option value="">Please select...</option>
                                <option value="yes">
                    بله                </option>
                                <option value="no">
                    خیر                </option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

and this is the output when my theme is active:

<div id="uni_cpo_options" class="uni-builderius-container"></div>

and this is my header.php

<?php

/**
 * I removed comments :)))
 */
?>
<!DOCTYPE html>

<html class="no-js" <?php language_attributes(); ?> id="html">

<head>

    <meta charset="<?php bloginfo('charset'); ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/style.css">
    <link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/assets/fonts/fonts.css">
    <link rel="profile" href="https://gmpg.org/xfn/11">
    <script src="<?php echo get_theme_file_uri('/assets/js/jquery.min.js') ?>"></script>
    <title><?php echo get_the_title(); ?></title>
    <?php
    if (taiwbi_admin_bar_capability() == '__return_false') {
    ?>
        <style>
            #site-header {
                top: 0 !important;
            }
        </style>
    <?php
    }
    wp_head(); ?>
    <?php
    if (current_user_can('edit_published_posts')) {
    ?>
        <style>
            #site-header {
                top: 32px;
            }
        </style>
    <?php
    }
    ?>
</head>

<body <?php body_class(); ?>>

    <?php
    wp_body_open();
    ?>

    <header id="site-header" class="header-footer-group">

        <div class="header-inner section-inner two-columns">

            <div class="header-titles-wrapper">
                <a class="img-link" href="<?php echo site_url(); ?>" style="max-height: 55px;">
                    <img src="<?php echo get_site_icon_url(60) ?>" alt="logo" class="site-logo" id="header-logo">
                </a>
                <nav class="header-menu-wrapper" id="header-menu">
                    <ul class="header-menu inlineList Roboto-Regular inlineList">

                        <?php
                        if (has_nav_menu('header-menu')) {

                            wp_nav_menu(
                                array(
                                    'container'  => '',
                                    'items_wrap' => '%3$s',
                                    'theme_location' => 'header-menu',
                                )
                            );
                        }
                        ?>
                    </ul>
                </nav>

            </div>
            <div class="header-join-wrapper">
                <?php
                if (is_user_logged_in()) {
                ?>
                    <?php
                    $cart = wc()->cart;
                    if (!$cart->is_empty()) {
                    ?>
                        <a href="<?php echo get_page_uri(34); ?>" class="button" id="login-header-but">
                            سبد خرید
                        </a>
                    <?php
                    } else {
                    ?>
                        <a href="<?php echo get_page_uri(33); ?>" class="button" id="login-header-but">
                            فروشگاه
                        </a>
                    <?php
                    }
                    ?>
                    <a href="<?php echo get_page_uri(36); ?>" class="button" id="myacc-header-but">
                        حساب من
                    </a>
                <?php
                } else {
                ?>
                    <a href="<?php echo get_page_uri(62); ?>" class="button" id="login-header-but">
                        ورود
                    </a>
                    <a href="<?php echo get_page_uri(63); ?>" class="button" id="join-header-but">
                        عضویت
                    </a>
                <?php
                }
                ?>
            </div>
        </div>
    </header>

As I said, the singular.php and searchform.php files are exactly the same as twenty-twenty

0
Mohammad Mahdi 6 months 2022-02-09T05:25:29-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse