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
-
April 25, 2016 at 10:45 am #263503
Is there any scope to set the admin language to English?
Thanks.
April 26, 2016 at 10:45 am #263798I’ve added a plugin that allows you to change the language. After you login you can change de language in the top left wordpress admin bar (default nl_NL).
April 26, 2016 at 11:20 am #263801Thanks, can you please add your FTP details so I can verify this on your site?
– David.
May 2, 2016 at 6:11 pm #264916This reply has been marked as private.May 4, 2016 at 11:06 am #265359Thanks, that’s great.
If you open your child theme functions.php file, please add this:
– Once added and saved, you will need to clear your cart and then add a new product to the cart to update WooCommerce mini cart price output.
/* 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_total = round($woocommerce->cart->cart_contents_total + $woocommerce->cart->tax_total, 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 $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 $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'); }
May 4, 2016 at 9:24 pm #265464I am sorry, but I am really starting to lose my patience…I’ve bought an extra support license and still the new code does not solve the problem. The price next to the shopping basket still shows the price without tax (229,75) but now even without the € icon (see attached image). It should display €278,00 (price including tax) just like in the dropdown. Did you login on my ste with the login details and ftp details that I had to provide? Did you check the code yourself to see if it works?
Attachments:
You must be logged in to view attached files.May 5, 2016 at 10:00 am #265546Hi,
This is what I see: http://d.pr/i/12PIm.
Are you wanting the 89,25 to be added to the 514,25?
That total is shown anywhere on your site, not even on the cart/cehckout?
Thanks.
May 10, 2016 at 7:01 pm #266565Hi David, it seems to work now. However, the € sign/icon is not showing anymore next to the price in the topbar (next to the shopping basket icon). How can I get it back? Furthermore, my website now puts a . instead of a , before the decimals. How can I change this?
May 11, 2016 at 3:01 pm #266847Hi,
1)
I updated the code to add the currency symbol, see screenshot: http://d.pr/i/18qze
– I should note, you experience a delay seeing the output as the cart is using AJAX. This is only updated for you, when you you add/remove a product from you cart, it refreshes the AJAX output.
2) The decimals are set here:
WooCommerce => Settings => General Options => Thousand Separator
and…
WooCommerce => Settings => General Options => Decimal Separator
Thanks.
May 13, 2016 at 2:44 pm #267337Thanks a lot! However, it does not seem to work for variable products like https://www.transferpersshop.nl/winkel/flexfolie/cad-cut-premium-plus-white-001. Please advice.
May 13, 2016 at 4:04 pm #267391No problem, can you confirm that you see differently to this:
Thanks,
David.May 20, 2016 at 2:08 pm #269054Works perfect now!
May 21, 2016 at 1:31 pm #269165It seems that still some products have this problem. How come the the code above does not solve the tax problem for all products?
https://www.transferpersshop.nl/winkel/accessoires/secabo-tc5-beam-adapter
When I add this product to my bag it still shows the price without tax……
May 21, 2016 at 1:44 pm #269166I think I have over written the functions.php file in my child theme with a local version (without your changes). Do you still have it?
May 23, 2016 at 6:50 pm #269548 -
Posted in: Neighborhood
You must be logged in and have valid license to reply to this topic.