1
woocommerce 제품 템플릿을 수정하여 주요 제품 설명 바로 뒤에 있지만 관련 제품 앞에 일부 코드 (배너)를 추가하고 싶습니다.Wordpress/Woocommerce - 제품 컨텐트 이후에 관련 제품 이전에 템플릿 편집
코드 편집 중 (/wp-content/plugins/woocommerce/templates/single-product.php);
<?php
/**
* woocommerce_before_main_content hook.
*
* @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)
* @hooked woocommerce_breadcrumb - 20
*/
do_action('woocommerce_before_main_content');
?>
<?php while (have_posts()) : the_post(); ?>
<?php wc_get_template_part('content', 'single-product');
/*My code start*/
echo "<div class=\"product-footer\">";
echo "<h1 class=\"product-footer-text\">Need some additional help? Or have an enquiry?</h1>";
echo "<h5 class=\"product-footer-text\"><i class=\"fa fa-phone\"></i> Call one of our sales team on <strong>01782</strong></h5>";
echo "<h5 class=\"product-footer-text\" style=\"margin-top: -40px;\"><i class=\"fa fa-envelope\"></i> Contact us via our contact page <strong><a style=\"color: #ffffff;\" href=\"/../contact\" target=\"_blank\">HERE</a></strong></h5>";
echo "<p class=\"product-footer-text\"><i><strong>Order note: </strong>All prices above are subject to delivery charges and VAT where applicable </i></span></p>
</div>";
/*My code end*/
?><?php endwhile; // end of the loop. ?>
<?php
/**
* woocommerce_after_main_content hook.
*
* @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)
*/
do_action('woocommerce_after_main_content');
?>
<?php
/**
* woocommerce_sidebar hook.
*
* @hooked woocommerce_get_sidebar - 10
*/
do_action('woocommerce_sidebar');
?>
나에게 결과를 제공되며,
https://i.stack.imgur.com/sTgY6.png
하단의 배너를 제품 desc 아래에 표시하고 싶습니다. 필자는 꽤 잠시 동안 코드를 엉망으로 만들었고 그냥 작동하지 않는 것 같습니다.
대단히 감사합니다! –