wordpress woocommerce show breadcrumbs in checkout page?

痞子三分冷 提交于 2019-12-11 19:25:15

问题


I am using woocommerce plugin for one of my store with wordpress. Here its working fine. Now for the breadcrumbs it has already in built breadcrumb feature in it. Its working fine. Now I want the breadcrumb feature in my checkout page. But woocommerce shows breadcrumb in all pages except checkout page. So can someone kindly tell me how to solve this issue. Any suggestions will be really appreciable. Thanks.


回答1:


May be helpfull for you There are two files you need to change your breadcrumb's in WooCommerce. You'll find those files in your WooCommerce plugin directory

First Template file:

if ( ! function_exists( 'woocommerce_breadcrumb' ) ) {

/**
 * Output the WooCommerce Breadcrumb
 *
 * @access public
 * @return void
 */
function woocommerce_breadcrumb( $args = array() ) {

$defaults = array(
    'delimiter'  => ' › ',
    'wrap_before'  => '<div id="breadcrumb" itemprop="breadcrumb">',
    'wrap_after' => '</div>',
    'before'   => '',
    'after'   => '',
    'home'    => null
);

$args = wp_parse_args( $args, $defaults  );

woocommerce_get_template( 'shop/breadcrumb.php', $args );
}
}

The second file: /woocommerce/templates/shop/breadcrumb.php, it's the template file for breadcrumb component in WooCommerce. This is the template file that will be called by the woocommerce_breadcrumb() function.



来源:https://stackoverflow.com/questions/17564512/wordpress-woocommerce-show-breadcrumbs-in-checkout-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!