single-fp_product.php

single-fp_product.php

더시민 7 2330 0

<?php 
//2021-06-25                            
// Get the WC_Product Object from the product ID (optional)

echo "####test2021-06-25####";
    $tmp_config =  get_field( 'form_modes', get_the_ID() );
    print_r($tmp_config);

?>

 

<?php if ( $tmp_config['0'] == 'order' || get_the_ID() == 8612 || get_the_ID() == 8459 || get_the_ID() == 8457 || get_the_ID() == 8615 || get_the_ID() == 8460 || get_the_ID() == 78185 || get_the_ID() == 78301 || get_the_ID() == 78302 || get_the_ID() == 78303 || get_the_ID() == 78623 || get_the_ID() == 78624 || get_the_ID() == 78625 ): ?>

7 Comments
더시민 2021.06.25 17:04  
170290
더시민 2021.06.25 17:01  
11
더시민 2021.06.25 16:25  
'prices_table' => get_field( 'price_table', $post_id ),
더시민 2021.06.25 16:17  
&& config.id !== 170290
더시민 2021.06.25 15:31  
<?php
//2021-06-25
// Get the WC_Product Object from the product ID (optional)

//echo "####test2021-06-25####";
print_r($config);
$tmp_config =  get_field( 'form_modes', get_the_ID() );
if($tmp_config['0'] == 'order') {}

?>
더시민 2021.06.25 15:25  
<?php
//2021-06-25
// Get the WC_Product Object from the product ID (optional)

//echo "####test2021-06-25####";
print_r($config);
$tmp_config =  get_field( 'form_modes', get_the_ID() );
if($tmp_config['0'] == 'order') {}

?>
더시민 2021.06.25 15:24  
우선은 제품 id값으로 다 정해버렸더라구요..





et_the_ID() == 8612 || get_the_ID() == 8459 || get_the_ID() == 8457 || get_the_ID() == 8615 || get_the_ID() == 8460 || get_the_ID() == 78185 || get_the_ID() == 78301 || get_the_ID() == 78302 || get_the_ID() == 78303 || get_the_ID() == 78623 || get_the_ID() == 78624 || get_the_ID() == 78625 )



이렇게 아예 제품값을 고정입력해서 그런 경우에 실행유무를 정해버려서



form_mode값에 상관없이 작동되어진건데요.



아래로 ng-if에도 다양한 경우를 다 설정해 둔 경우래서



아마도 제품별로 출력되는 다양한 경우를 하나의 템플릿php에서 처리하느라 저렇게 한거같아요



가령 order인 경우에도 옆에 선택항목들이 다양하니 그렇게 나누느라



..음



방법은 제품 추가할때마다 하드 코딩 추가하는 방법.

Congratulation! You win the 24 Lucky Point!

제목
Category
Facebook Twitter GooglePlus KakaoStory KakaoTalk NaverBand