Hello I'm tryng to show some content in checkout page, cart page and thankyou page, the cart and checkout page are okay so far, but I can't show the right content on thankyou page
here is what I'm tryng to do
<?php if (is_checkout() || is_cart() && sizeof($woocommerce->cart->cart_contents) == !0 || woocommerce_get_page_id('thanks')) { ?>
<div class="flow">
<?php if (is_cart()) { ?>
<?php
$fase2 = "done";
$fase3 = "wait";
$fase4 = "wait";
$icon2 = "<i class='fa fa-user'></i>";
?>
<?php } elseif (is_checkout()) { ?>
<?php
$fase2 = "done";
$fase3 = "done";
$fase4 = "wait";
$icon2 = "<i class='fa fa-check'></i>";
$icon3 = "<i class='fa fa-user'></i>";
?>
<?php } elseif (woocommerce_get_page_id('thanks')) { ?>
<?php
$fase2 = "done";
$fase3 = "done";
$fase4 = "done";
$icon2 = "<i class='fa fa-check'></i>";
$icon3 = "<i class='fa fa-user'></i>";
$icon4 = "<i class='fa fa-user'></i>";
?>
<?php } ?>
<ul>
<li><i class="fa fa-check"></i><span class="done">Product</span></li>
<li><?php echo $icon2 ?><span class="<?php echo $fase2 ?>">Cart</span></li>
<li><?php echo $icon3 ?><span class="<?php echo $fase3 ?>">Pay</span></li>
<li><?php echo $icon4 ?><span class="<?php echo $fase4 ?>">Order Received</span></li>
</ul>
</div>
What do I do to show a content only on thankyou page?
As mentioned in an other response here, the function woocommerce_get_page_id() is deprecated and removed in WooCommerce 2.0. This is because the pages in previous versions of WooCommerce are replaced by endpoints(parses the URL to find out what page should be displayed). The function woocommerce_get_page_id() is therefore replaced by is_wc_endpoint_url() and you should use it like this:
if( is_wc_endpoint_url( "order-received" ) )
The function "woocommerce_get_page_id" is deprecated. You can use a WordPress conditional tag to check if the thank you page is being displayed.
Please check documentation about the "is_single" function: http://codex.wordpress.org/Function_Reference/is_single
Cheers, Damien