Osclass Support Forums
Osclass theme support => Alpha Osclass Theme => Topic started by: sezy2021 on September 09, 2021, 10:08:09 AM
-
How can I display the cart diagram at the top of the TOP page?
-
Use your design.
Cart URL can be generated using osp-cart route.
-
I succeeded when I referred to the posts of other people.
Thank you! Everyone in the forum! :)
-
header.php
<?php if(function_exists('osp_install')) { ?>
<?php
$cart_count = 0;
if(osc_is_web_user_logged_in()) {
$cart = ModelOSP::newInstance()->getCart(osc_logged_user_id());
$cart_count = count(array_filter(explode('|', $cart)));
}
?>
<a class="cart tr1" title="<?php _e('Cart', 'alpha'); ?>" href="<?php echo osc_route_url('osp-cart'); ?>"><i class="fa fa-shopping-basket"></i> <span class="counter"><?php echo $cart_count; ?></span></a>
<?php } ?>
-
@sezy2021
That is solution as well.