Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Breadcrumbs on shop/home page when the shop is also set to the front page

$
0
0

Replies: 0

1. My store is set in a subdomain, with it’s own wordpress installation
Main site: foundationnkh.org
Shop: us-shop.foundationnkh.org

I’ve set the shop page to be the same as the front page of us-shop.foundationnkh.org

2. In functions.php I reset the home page url as the main site and inserted the shop url, so the breadcrumbs would go Home > Shop > Category > Product (for example) where:
– Home: foundationnkh.org
– Shop: us-shop.foundationnkh.org
– Category: Category


add_filter( 'woocommerce_breadcrumb_home_url', 'woo_custom_breadrumb_home_url' );
 function woo_custom_breadrumb_home_url() {
    return 'http://foundationnkh.org'; //Set the Home URL
}

add_filter( 'woocommerce_get_breadcrumb', function($crumbs, $Breadcrumb){
        $shop_page_id = wc_get_page_id('shop'); //Get the shop page ID
        if($shop_page_id > 0 ) { //Check we got an ID (shop page is set).
            $new_breadcrumb = [
                _x( 'Shop', 'breadcrumb', 'woocommerce' ), //Title
                get_permalink(wc_get_page_id('shop')) // URL
            ];
            array_splice($crumbs, 1, 0, [$new_breadcrumb]); //Insert a new breadcrumb after the 'Home' crumb
        }
        return $crumbs;
    }, 10, 2 );

3. The breadcrumbs show on the product page, the category page and the tags page, but don’t show on the front page/shop page.

Category Page:
https://www.dropbox.com/s/0vand0dz0d19i31/categorybreadcrumbs.png

Front Page:
https://www.dropbox.com/s/0zfqbjpgrpv9jhd/frontpage-nobreadcrumbs.png

I’m pretty sure it’s because in Settings > Reading the Home page is set to ‘shop’ (the same page the shop is set to). When I set the home page to anything else, the breadcrumbs show.

I did try setting the home page to a dummy page with an automatic refresh to the shop, but it took forever to load.

So. There is nothing in the logs, there’s no error in the chrome error console… is this a plugin bug? How do I get breadcrumbs to show when the shop and the home page are set the same page? (Remembering that I’ve used the functions.php code to reset the home URL to a different url?)

Status Report:


### WordPress Environment ###

WordPress address (URL): http://us-shop.foundationnkh.org
Site address (URL): http://us-shop.foundationnkh.org
WC Version: 4.2.2
REST API Version: ✔ 1.0.8
WC Blocks Version: ✔ 2.5.16
Action Scheduler Version: ✔ 3.1.6
WC Admin Version: ✔ 1.2.4
Log Directory Writable: ✔
WP Version: 5.4.2
WP Multisite: –
WP Memory Limit: 256 MB
WP Debug Mode: –
WP Cron: ✔
Language: en_US
External object cache: –

### Server Environment ###

Server Info: Apache
PHP Version: 7.3.3
PHP Post Max Size: 100 MB
PHP Time Limit: 60
PHP Max Input Vars: 1000
cURL Version: 7.61.0
OpenSSL/1.0.2p

SUHOSIN Installed: –
MySQL Version: 5.5.5-10.2.22-MariaDB-log
Max Upload Size: 100 MB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔

### Database ###

WC Database Version: 4.2.2
WC Database Prefix: wp_
Total Database Size: 12.96MB
Database Data Size: 7.49MB
Database Index Size: 5.47MB
wp_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_actionscheduler_actions: Data: 0.47MB + Index: 0.59MB + Engine InnoDB
wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_actionscheduler_logs: Data: 0.28MB + Index: 0.23MB + Engine InnoDB
wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_comments: Data: 0.02MB + Index: 0.08MB + Engine InnoDB
wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_options: Data: 2.03MB + Index: 0.09MB + Engine InnoDB
wp_postmeta: Data: 3.38MB + Index: 3.03MB + Engine InnoDB
wp_posts: Data: 0.47MB + Index: 0.34MB + Engine InnoDB
wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_usermeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_wc_admin_notes: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_product_meta_lookup: Data: 0.14MB + Index: 0.17MB + Engine InnoDB
wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB

### Post Type Counts ###

attachment: 453
customize_changeset: 2
nav_menu_item: 3
page: 6
post: 2
product: 38
product_variation: 949
revision: 4

### Security ###

Secure connection (HTTPS): ❌
					Your store is not using HTTPS. Learn more about HTTPS and SSL Certificates.
Hide errors from visitors: ✔

### Active Plugins (15) ###

Jetpack by WordPress.com: by Automattic – 8.6.1
Salient WPBakery Page Builder: by Michael M - WPBakery.com | Modified by ThemeNectar – 6.2.0
Printful Integration for WooCommerce: by Printful – 2.1.12
Salient Core: by ThemeNectar – 1.6
Salient Demo Importer: by ThemeNectar – 1.2
Salient Home Slider: by ThemeNectar – 1.3
Salient Nectar Slider: by ThemeNectar – 1.6
Salient Portfolio: by ThemeNectar – 1.6
Salient Shortcodes: by ThemeNectar – 1.3
Salient Social: by ThemeNectar – 1.1
Salient Widgets: by ThemeNectar – 1.1
WooCommerce PayPal Checkout Gateway: by WooCommerce – 2.0.3
WooCommerce Services: by Automattic – 1.23.2
WooCommerce: by Automattic – 4.2.2
YITH WooCommerce Badge Management: by YITH – 1.4.2

### Inactive Plugins (0) ###

### Settings ###

API Enabled: ✔
Force SSL: ✔
Currency: USD ($)
Currency Position: left
Thousand Separator: ,
Decimal Separator: .
Number of Decimals: 2
Taxonomies: Product Types: external (external)
grouped (grouped)
simple (simple)
variable (variable)

Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
exclude-from-search (exclude-from-search)
featured (featured)
outofstock (outofstock)
rated-1 (rated-1)
rated-2 (rated-2)
rated-3 (rated-3)
rated-4 (rated-4)
rated-5 (rated-5)

Connected to WooCommerce.com: –

### WC Pages ###

Shop base: #6 - /
Cart: #7 - /cart/
Checkout: #8 - /checkout/
My account: #9 - /my-account/
Terms and conditions: ❌ Page not set

### Theme ###

Name: Salient
Version: 12.1.0
Author URL: https://themeforest.net/user/themenectar
Child Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme
WooCommerce Support: ✔

### Templates ###

Overrides: salient/woocommerce/checkout/form-checkout.php
salient/woocommerce/checkout/review-order.php
salient/woocommerce/checkout/terms.php
salient/woocommerce/content-product.php
salient/woocommerce/content-single-product.php
salient/woocommerce/loop/add-to-cart.php
salient/woocommerce/loop/loop-start.php
salient/woocommerce/myaccount/form-login.php
salient/woocommerce/single-product/product-image.php
salient/woocommerce/single-product/tabs/description.php
salient/woocommerce/single-product/tabs/tabs.php

### Action Scheduler ###

Complete: 1,543
Oldest: 2020-07-01 09:12:48 +0000
Newest: 2020-07-04 09:45:34 +0000


Viewing all articles
Browse latest Browse all 59525

Trending Articles