반응형
WooCommerce 주문 합계 가져오기
현재 구글 애드워즈 변환으로 발송할 수 있도록 WooCommerce 체크아웃의 총 오더를 받고 있습니다.
코드는 다음과 같습니다.
<?php
$get_order_total = floatval( preg_replace( '#[^\d.]#', '', $order->get_formatted_order_total() ) );
?>
<!-- Google Code for ATS Conversion Page -->
<?php if ( $get_order_total ) { ?>
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 1066553725;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "CzWXCLmwn1YQ_aLJ_AM";
if (<?php echo $get_order_total; ?>) { var google_conversion_value = <?php echo $get_order_total; ?>; var google_conversion_currency = "GBP"; }
var google_conversion_currency = "GBP";
var google_remarketing_only = false;
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/1066553725/?value=<?php echo $get_order_total; ?>&currency_code=GBP&label=CzWXCLmwn1YQ_aLJ_AM&guid=ON&script=0"/>
</div>
</noscript>
<?php } ?>
어떤 이유로 페이지 $get_order_total = floatval ( preg _ replace ( ' # [ ^ \ d . ]# , ' , $order - > get _ > get _ order _ order _ total ) ) it and and and and the the the the the the the:::::::::: the: 。
/woocommerce/checkout/thankout의 비오브젝트 멤버 함수 get_formated_order_total()을 호출합니다.409행의 php
둘러보고 글로벌 $woocommerce 변수를 추가하려고 했지만 성공하지 못했습니다.사용하고 있는 버전은 2.1.12 입니다.
잘 부탁드립니다.
이미 에 액세스 할 수 있는 경우는, 주문의 합계수를 표시하기 위해서 다음과 같은 것을 시험해 주세요.$order
물건.
<?php echo $order->get_total(); ?>
언급URL : https://stackoverflow.com/questions/33755713/woocommerce-get-order-total
반응형
'programing' 카테고리의 다른 글
Wordpress 사이트가 해킹됨 - 다른 사이트로 리디렉션 (0) | 2023.03.13 |
---|---|
oracle sql developer를 사용하여 데이터베이스 간에 복사 - 연결에 실패했습니다. (0) | 2023.03.13 |
C# 프로젝트를 빌드할 수 없습니다. (0) | 2023.03.13 |
리액트 및 노드에 대해 프록시가 작동하지 않음 (0) | 2023.03.13 |
JSON에서 TypeScript 클래스 인스턴스로? (0) | 2023.03.13 |