HTML을 WordPress Woocommerce 단일 제품 페이지에 통합하는 방법
사실 저는 WordPress Woocommerce를 작업하고 있습니다.WooCommerce Plugin에서 검색해 보니 단일 제품 페이지, 즉 단일 제품이 있었습니다.php를 템플릿 폴더에 저장합니다.그리고 완전한 제품 설명을 표시하는 루프가 있습니다.
<?php while ( have_posts() ) : the_post(); ?>
<?php wc_get_template_part( 'content', 'single-product' ); ?>
<?php endwhile; // end of the loop. ?>
<?php
?>
페이지 전체 설정이 어디에 있는지, 가격, 이미지, 상품 설명 등 다양한 상품 속성을 표시하는 순서를 재설정하는 방법을 이해하지 못했습니다.
그래서 제 HTML을 Woo Commerce Single Product Page에 삽입하거나 통합하는 방법을 알려주세요.
어떤 도움이라도 감사합니다.
감사해요.
다음 이름의 폴더를 생성해야 합니다.woocommerce테마 폴더 안에 있는 woocommere 플러그인의 템플릿 폴더 내용을 테마 폴더 안에 복사합니다.이렇게 하면 기본 내용을 덮어쓸 수 있습니다.
위의 작업을 완료한 후 에서 파일 내용(단일 제품)을 찾습니다.woocommerce폴더를 선택합니다.갈고리가 많이 있고do_actions. 당황하지 마세요.이것들은 단지 파일들을 호출하고 있다.single-product내부 폴더woocommerce폴더입니다.이 폴더에서는 파일 제목이 잘 지정되고 그룹화되어 있으며 파일 제목만 봐도 파일 하나를 알 수 있습니다.예를들면price.php가격표시를 위해서product-attributes.php제품 속성의 경우(제품이 가변적인 경우).
이 파일들을 가지고 놀아라.원본이 필요한 경우 woocommerce 플러그인의 폴더에서 다시 찾을 수 있습니다.
편집
40 ~ 60 행 사이의 content-single-product.disc를 참조해 주세요.
<div class="summary entry-summary">
<?php
/**
* woocommerce_single_product_summary hook
*
* @hooked woocommerce_template_single_title - 5
* @hooked woocommerce_template_single_rating - 10
* @hooked woocommerce_template_single_price - 10
* @hooked woocommerce_template_single_excerpt - 20
* @hooked woocommerce_template_single_add_to_cart - 30
* @hooked woocommerce_template_single_meta - 40
* @hooked woocommerce_template_single_sharing - 50
*/
do_action( 'woocommerce_single_product_summary' );
?>
</div><!-- .summary -->
이것.do_action( 'woocommerce_single_product_summary' );는 위의 후크함수를 호출하는 역할을 합니다.이름 옆에 있는 숫자가 순서입니다.숫자가 작을수록 순서가 높아집니다.이 섹션의 순서가 다르다고 가정하고, 이 섹션을 다음과 같이 바꿉니다.
<div class="summary entry-summary">
<?php
/**
* woocommerce_single_product_summary hook
*
* @hooked woocommerce_template_single_title - 5
* @hooked woocommerce_template_single_rating - 10
* @hooked woocommerce_template_single_price - 10
* @hooked woocommerce_template_single_excerpt - 20
* @hooked woocommerce_template_single_add_to_cart - 30
* @hooked woocommerce_template_single_meta - 40
* @hooked woocommerce_template_single_sharing - 50
*/
//do_action( 'woocommerce_single_product_summary' );
// now call these function directly and change their order ;
woocommerce_template_single_title();
woocommerce_template_single_rating();
woocommerce_template_single_price(); // this will output the price text
woocommerce_template_single_excerpt(); // this will output the short description of your product.
woocommerce_template_single_add_to_cart();
woocommerce_template_single_meta();
woocommerce_template_single_sharing();
?>
</div><!-- .summary -->
woocommerce 플러그인 폴더의 이 파일로 이동
\woocommerce\wc-syslog-syslog.php
후크를 수정하여(변경 또는 신규 추가) 단일 제품 페이지에서 레이아웃 및 모든 항목을 변경할 수 있습니다.
언급URL : https://stackoverflow.com/questions/23801195/how-to-integrate-html-into-wordpress-woocommerce-single-product-page
'programing' 카테고리의 다른 글
| JSON 문자열을 사전으로 변환하는 방법 (0) | 2023.02.28 |
|---|---|
| Oracle에서 테이블 잘라내기 오류 발생 (0) | 2023.02.28 |
| 필드 유형을 변경하려면 어떻게 해야 합니다. (0) | 2023.02.28 |
| ASP에서 JSON 개체를 반환하는 중입니다.NET 페이지 (0) | 2023.02.28 |
| AngularJS: 모델 요소가 모델 배열에서 스플라이스된 경우 ng-repeat 목록이 업데이트되지 않음 (0) | 2023.02.28 |