Replies: 1 comment 2 replies
-
Hi Hefin, I understand... For now, Removing those parts based on WC backend settings seems a bit tricky. But in v.6.1 there is planned to add a lot more filters #841. We can wrap account toggler and offcanvas in a filter, for example <?php
if (apply_filters('bootscore/enable_account', true)) {
if (!is_account_page() && !is_checkout()) { ?>
<button class="<?= apply_filters('bootscore/class/header/button', 'btn btn-outline-secondary', 'account-toggler'); ?> <?= apply_filters('bootscore/class/header/action/spacer', 'ms-1 ms-md-2', 'account-toggler'); ?> account-toggler" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvas-user" aria-controls="offcanvas-user">
<?= apply_filters('bootscore/icon/user', '<i class="fa-solid fa-user"></i>'); ?> <span class="visually-hidden-focusable">Account</span>
</button>
<?php }
}
?> <?php
if (apply_filters('bootscore/enable_account', true)) {
if (!is_account_page() && !is_checkout()) { ?>
<div class="offcanvas offcanvas-<?= apply_filters('bootscore/class/header/offcanvas/direction', 'end', 'account'); ?>" tabindex="-1" id="offcanvas-user">
<div class="offcanvas-header">
<span class="h5 offcanvas-title"><?= apply_filters('bootscore/offcanvas/user/title', __('Account', 'bootscore')); ?></span>
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<div class="my-offcanvas-account">
<?= do_shortcode('[woocommerce_my_account]'); ?>
</div>
</div>
</div>
<?php }
}
?> And then disable account in child's /**
* Disable WooCommerce account
*/
add_filter('bootscore/enable_account', '__return_false'); If you agree with that, it would be great if you just fork and submit a pull request to this https://github.com/bootscore/bootscore/tree/Add-more-filters branch. Would that be a solution? |
Beta Was this translation helpful? Give feedback.
-
Yo Basti,
I'm currently upgrading and migrating my WooCommerce site from Bootscore 5.3 to Bootscore 6.0.2. While reviewing the
header.php
file, I noticed that it includes a template part to load theactions-woocommerce
template part when woocommerce is installed.bootscore/header.php
Lines 79 to 85 in 4e37a62
This template part adds a "user toggler" button, which opens a flyout menu on the left-hand side for users to log in.
bootscore/template-parts/header/actions-woocommerce.php
Lines 26 to 34 in 4e37a62
However, my site is entirely anonymous — it does not allow login or account creation and only permits anonymous purchasing.
Given this, wouldn't it make sense to update the conditional logic controlling the visibility of this button? Specifically, if the site does not allow account sign-up or login (based on WooCommerce settings), this control shouldn't be shown on the template part page.
Thanks Hefin
Beta Was this translation helpful? Give feedback.
All reactions