Osclass Support Forums

Osclass theme support => Alpha Osclass Theme => Topic started by: sezy2021 on September 09, 2021, 10:08:09 AM

Title: How to display the cart at the top
Post by: sezy2021 on September 09, 2021, 10:08:09 AM
How can I display the cart diagram at the top of the TOP page?
Title: Re: How to display the cart at the top
Post by: MB Themes on September 09, 2021, 01:01:54 PM
Use your design.
Cart URL can be generated using osp-cart route.
Title: Re: How to display the cart at the top
Post by: sezy2021 on September 09, 2021, 05:51:22 PM
I succeeded when I referred to the posts of other people.
Thank you! Everyone in the forum! :)
Title: Re: How to display the cart at the top
Post by: sezy2021 on September 09, 2021, 05:52:57 PM
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 } ?>
Title: Re: How to display the cart at the top
Post by: MB Themes on September 09, 2021, 08:06:02 PM
@sezy2021
That is solution as well.