Site logo

Archived topic

breadcrumbs to the basket page

15 replies · Started by _blank on August 7, 2018

Viewing posts 1–15 of 16

Hi,

What’s the best way to add breadcrumbs to the basket page?
I’m looking at adding them above the page title “BASKET” but if not possible then before the cart begins.

Is it also possible to add HTML text after the cart, PROCEED TO CHECKOUT button.

Thanks
Scott

Hey Scott,

First you'd need to use a plugin that offers breadcrumbs. Yoast SEO provide the following code:

<?php if ( function_exists('yoast_breadcrumb') ) : ?>
    <div class="yoast-breadcrumb">
        <?php yoast_breadcrumb( '<p id="breadcrumbs">','</p>' ); ?>
    </div>
<?php endif; ?>

Then you can use GPP 1.7 (currently in testing): https://generatepress.com/gp-premium-1-7/

Go to "Elements > Add New > Hook".

Paste the above into the content area, and check the "Execute PHP" option.

For the hook, you can choose before_content.

Then in "Display Rules", choose your Cart page.

For the checkout, create a new Hook Element, and add your content to the content area.

For the Hook, you should see a woocommerce_proceed_to_checkout hook.

Then in your Display Rules, choose the Cart page again.

Hope this helps :)

Hi Tom

Sorry for late reply.
Thanks for this, will it work with the live version now?

Scott

It should :)

Hi Tom

Thanks for the link.

Is it possible to add a css class to the breadcrumb I've added to elements?

I'm currently using this on the other pages

/* BREADCRUMB Yoast Breadcrumb */
.breadcrumbs {
font-size: 14px;
font-family: 'Cormorant Infant', serif;
text-transform: uppercase;
}

Thanks
Scott

Hi Leo

I tried just now adding it to the customiser additional css

/* BREADCRUMB Yoast Breadcrumb */
.breadcrumbs body.woocommerce-checkout {
font-size: 14px;
font-family: 'Cormorant Infant', serif;
text-transform: uppercase;
}

But hasn't changed, Is the code correct?

Thanks
Scott

Hi Leo

I've tried this:

/* BREADCRUMB Yoast Breadcrumb Checkout */
body.woocommerce-checkout .breadcrumbs {
font-size: 14px;
font-family: 'Cormorant Infant', serif;
text-transform: uppercase;
}

Is that correct?
Thanks
Scott

Yup that looks good.

It's not working?

That's the cart page and not the checkout page, try this instead:
.woocommerce-cart .yoast-breadcrumb

Oh yeah you're right I'm getting confused.
It works now
Thanks
Scott

This archived topic is closed to new replies.