I would like to change the default display of shopping cart in Navbar from show the cart-count to show the cart-value with currency.
How can I do this?
Need to show Shopping Cart Total in Navbar
Need to show Shopping Cart Total in Navbar
You do not have the required permissions to view the files attached to this post.
-
- Lead Developer
- Posts: 2423
- Joined: Tue Oct 29, 2019 9:37 am
- : Buy Me A Beverage
- Has thanked: 49 times
- Been thanked: 137 times
Re: Need to show Shopping Cart Total in Navbar
Drop a copy of
/includes/modules/navbar/templates/tpl_nb_shopping_cart.php
into (assuming you are using "override" template);
/templates/override/includes/modules/navbar/tpl_nb_shopping_cart.php
You have now over-ridden the output of the module.
In that new file, change this line:
To
In the language file;
/includes/languages/english/modules/navbar/templates/nb_shopping_cart.php
change this line appropriately;
Eg to:
--
This type of indepth help is not usually available from the Core Coders, only within the Supporters VIP lounge. Please consider becoming a Supporter of this Project, to keep the project moving forwards we need as many users of Phoenix as possible to step up and support. Thank You.
/includes/modules/navbar/templates/tpl_nb_shopping_cart.php
into (assuming you are using "override" template);
/templates/override/includes/modules/navbar/tpl_nb_shopping_cart.php
You have now over-ridden the output of the module.
In that new file, change this line:
Code: Select all
<?php printf(MODULE_NAVBAR_SHOPPING_CART_CONTENTS, $_SESSION['cart']->count_contents()); ?>
Code: Select all
<?php printf(MODULE_NAVBAR_SHOPPING_CART_CONTENTS, $GLOBALS['currencies']->format($_SESSION['cart']->show_total())); ?>
/includes/languages/english/modules/navbar/templates/nb_shopping_cart.php
change this line appropriately;
Code: Select all
const MODULE_NAVBAR_SHOPPING_CART_CONTENTS = '<i title="Shopping Cart" class="fas fa-shopping-cart fa-fw"></i><span class="d-inline d-sm-none d-md-inline"> <span class="cart-count">%1$s</span> item(s)</span> <span class="caret"></span>';
Code: Select all
const MODULE_NAVBAR_SHOPPING_CART_CONTENTS = '<i title="Shopping Cart" class="fas fa-shopping-cart fa-fw"></i><span class="d-inline d-sm-none d-md-inline"> <span class="cart-count">%1$s</span> </span> <span class="caret"></span>';
This type of indepth help is not usually available from the Core Coders, only within the Supporters VIP lounge. Please consider becoming a Supporter of this Project, to keep the project moving forwards we need as many users of Phoenix as possible to step up and support. Thank You.
Gamechanger Addon: Queued Emails, try before you buy.