【问题标题】:Merge description & additional information tab in woocommerce在 woocommerce 中合并描述和附加信息选项卡
【发布时间】:2018-12-12 21:19:56
【问题描述】:

我在我的 wordpress 网站上使用 woocommerce,我想合并产品页面上的描述和附加信息选项卡。我想将两个选项卡的内容放在彼此下方。请注意,此处发布了一个类似的问题(有答案):Merge Description and additional information tab in Woocommerce

但是,此答案将选项卡的内容放在两列中,而不是在彼此下方。我尝试使用此答案并对其进行调整以使内容显示在彼此下方,但是我对 html 和 css 的了解不足以解决此问题(我是编码新手,尽管我很自豪地说我设法进行了一些编辑和小修复,这个问题绝对超出了我的范围......)

有谁能帮帮我吗?

提前致谢! :)

【问题讨论】:

    标签: html wordpress woocommerce


    【解决方案1】:

    我找到了一个简单的方法来做到这一点。 (评论会很棒!) descriptionadditional information 选项卡中显示的内容从数据库中提取并显示在这些文件中:
    主题/woocommerce/single-product/description.php
    主题/woocommerce/single-product/additional-information.php

    通过将additional-information.php 的以下代码复制到description.php 中,将两者的内容合并到一个选项卡中。

    global $product;
    $heading = esc_html( apply_filters( 
    'woocommerce_product_additional_information_heading', __( 'Specification', 
    'rehub_framework' ) ) );
    
    ?>
    
    <?php if ( $heading ) : ?>
        <div class="rh-woo-section-title"><h2 class="mt0"><?php echo ''.$heading; ? 
    >: <span class="rh-woo-section-sub"><?php the_title();?></span></h2></div>
    <?php endif; ?>
    
    <?php do_action( 'woocommerce_product_additional_information', $product ); ?>
    

    【讨论】:

      猜你喜欢
      • 2012-09-11
      • 1970-01-01
      • 2018-05-21
      • 2020-07-10
      • 2018-06-06
      • 2018-09-12
      • 1970-01-01
      • 2017-02-17
      • 2021-12-21
      相关资源
      最近更新 更多