Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php if (is_product() || is_cart() || is_checkout() || is_wc_endpoint_url('order-received')) {
if (is_product()) {
echo '<h1>Register</h1>';
} elseif (is_cart()) {
echo '<h1>Review Order</h1>';
} elseif (is_wc_endpoint_url('order-received')) {
echo '<h1>Confirmation</h1>';
} elseif (is_checkout()) {
echo '<h1>Checkout</h1>';
} else {
the_title('<h1>','</h1>');
} ?>
<ul class="breadcrumbs woocommerce">
<li>
<strong<?php if (is_product()) echo ' class="active"';?>><span>Step 1:</span> Register</strong>
</li>
<li>
<strong<?php if (is_cart()) echo ' class="active"';?>><span>Step 2:</span> Review Order</strong>
</li>
<li>
<strong<?php if (is_checkout()&&!is_wc_endpoint_url('order-received')) echo ' class="active"';?>><span>Step 3:</span> Checkout</strong>
</li>
<li>
<strong<?php if (is_wc_endpoint_url('order-received')) echo ' class="active"';?>><span>Step 4:</span> Confirmation</strong>
</li>
</ul>
<?php } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment