Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › Mini-cart shows price excl. Tax
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › Mini-cart shows price excl. Tax
- This topic has 34 replies, 3 voices, and was last updated 8 years by David Martin – Support.
-
Posted in: Neighborhood
-
May 26, 2016 at 10:15 am #270339
Looks like you have removed the currency symbol edit, the tax would not work if it’s overridden by another tax setting within the product.
This is what I see:
I have added the code back now.
Thanks.
May 28, 2016 at 12:35 pm #270915Hi David, thanks for the help again. Unfortunately I don’t see the change. I see the prices without tax again. See attached image.
Attachments:
You must be logged in to view attached files.May 28, 2016 at 1:56 pm #270921It’s show correct for me. Please clear your cache and then trigger the ajax refresh by adding a new product.
– Also looks like you have removed the code to add the correct decimal place?
May 30, 2016 at 9:06 pm #271232It looks like it works now. Yes I’ve deleted all code by accident. Can you add the code again for the decimals? Thanks in advance.
May 31, 2016 at 6:47 pm #271510Ok, just updated. Please do the usual remove item from cart, add item to cart to trigger ajax refresh.
Updated to this for your safekeeping:
/* ADD TO CART HEADER RELOAD ================================================== */ if (!function_exists('sf_woo_header_add_to_cart_fragment')) { function sf_woo_header_add_to_cart_fragment( $fragments ) { global $woocommerce; ob_start(); $cart_total = $woocommerce->cart->get_cart_total(); $cart_tax = round( $woocommerce->cart->tax_total, 2 ); $cart_total = number_format($woocommerce->cart->cart_contents_total + $cart_tax, 2, '.', ''); $cart_count = $woocommerce->cart->cart_contents_count; $cart_count_text = sf_product_items_text($cart_count); $price_display_suffix = get_option( 'woocommerce_price_display_suffix' ); $options = get_option('sf_neighborhood_options'); $show_cart_count = false; if (isset($options['show_cart_count'])) { $show_cart_count = $options['show_cart_count']; } ?> <li class="parent shopping-bag-item"> <?php if ($show_cart_count) { ?> <a class="cart-contents" href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php _e('View your shopping bag', 'swiftframework'); ?>"><i class="sf-cart"></i> <?php echo get_woocommerce_currency_symbol(); ?> <?php echo $cart_total; ?> (<?php echo $cart_count; ?>)</a> <?php } else { ?> <a class="cart-contents" href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php _e('View your shopping bag', 'swiftframework'); ?>"><i class="sf-cart"></i> <?php echo get_woocommerce_currency_symbol(); ?> <?php echo $cart_total; ?></a> <?php } ?> <ul class="sub-menu"> <li> <div class="shopping-bag"> <?php if ( sizeof($woocommerce->cart->cart_contents)>0 ) { ?> <div class="bag-header"><?php echo $cart_count_text; ?> <?php _e('in the shopping bag', 'swiftframework'); ?></div> <div class="bag-contents"> <?php foreach ($woocommerce->cart->cart_contents as $cart_item_key => $cart_item) { ?> <?php $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key ); $price = apply_filters( 'woocommerce_cart_item_price', $woocommerce->cart->get_product_price( $_product ), $cart_item, $cart_item_key ); $product_title = $_product->get_title(); $product_short_title = ( strlen( $product_title ) > 25 ) ? substr( $product_title, 0, 22 ) . '...' : $product_title; ?> <?php if ($_product->exists() && $cart_item['quantity']>0) { ?> <div class="bag-product clearfix"> <figure><a class="bag-product-img" href="<?php echo get_permalink($cart_item['product_id']); ?>"><?php echo $_product->get_image(); ?></a></figure> <div class="bag-product-details"> <div class="bag-product-title"> <a href="<?php echo get_permalink($cart_item['product_id']); ?>"> <?php echo apply_filters( 'woocommerce_cart_widget_product_title', $product_short_title, $_product ); ?></a> </div> <div class="bag-product-price"><?php _e("Unit Price:", "swiftframework"); ?> <?php echo $price; ?></div> <div class="bag-product-quantity"><?php _e('Quantity:', 'swiftframework'); ?> <?php echo $cart_item['quantity']; ?></div> <?php if ( $price_display_suffix ) { ?> <small class="woocommerce-price-suffix"><?php echo $price_display_suffix; ?></small> <?php } ?> </div> <?php echo apply_filters( 'woocommerce_cart_item_remove_link', sprintf('<a href="%s" class="remove" title="%s">×</a>', esc_url( $woocommerce->cart->get_remove_url( $cart_item_key ) ), __('Remove this item', 'swiftframework') ), $cart_item_key ); ?> </div> <?php } ?> <?php } ?> </div> <div class="bag-buttons"> <a class="sf-roll-button bag-button" href="<?php echo esc_url( $woocommerce->cart->get_cart_url() ); ?>"><span><?php _e('View shopping bag', 'swiftframework'); ?></span><span><?php _e('View shopping bag', 'swiftframework'); ?></span></a> <a class="sf-roll-button checkout-button" href="<?php echo esc_url( $woocommerce->cart->get_checkout_url() ); ?>"><span><?php _e('Proceed to checkout', 'swiftframework'); ?></span><span><?php _e('Proceed to checkout', 'swiftframework'); ?></span></a> </div> <?php } else { ?> <div class="bag-header"><?php _e("0 items in the shopping bag", "swiftframework"); ?></div> <div class="bag-empty"><?php _e('Unfortunately, your shopping bag is empty.','swiftframework'); ?></div> <div class="bag-buttons"> <?php $shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) ); ?> <a class="sf-roll-button shop-button" href="<?php echo esc_url( $shop_page_url ); ?>"><span><?php _e('Go to the shop', 'swiftframework'); ?></span><span><?php _e('Go to the shop', 'swiftframework'); ?></span></a> </div> <?php } ?> </div> </li> </ul> </li> <?php $fragments['.shopping-bag-item'] = ob_get_clean(); return $fragments; } add_filter('add_to_cart_fragments', 'sf_woo_header_add_to_cart_fragment'); }
-
Posted in: Neighborhood
You must be logged in and have valid license to reply to this topic.