Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › Cart item count instead of total price
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › Cart item count instead of total price
- This topic has 62 replies, 8 voices, and was last updated 10 years by Rui Guerreiro – SUPPORT.
-
Posted in: Neighborhood
-
March 16, 2014 at 2:35 pm #57863
please do not update the theme or delete any plugins
March 16, 2014 at 2:47 pm #57865Hi,
I have fixed your issue so please check it now .Thanks
With Best Regards
Swift IdeasMarch 16, 2014 at 2:55 pm #57866hi,
May I ask what you did, because my custom css was deleted and my cache plugin doesn’t seem to work anymore?
Also do you have a personal email?
March 16, 2014 at 4:50 pm #57875HI,
Sorry ! I forgot to enable cache plugin . Please enable your cache plugin .Thanks
With Best Regards
Swift IdeasMarch 17, 2014 at 1:52 pm #58101Hi, I am working on the same thing. Have the same flashing problem. I would like to know what you did in the backend as well, so I know how to fix it, and don’t have to ask you to do it everytime i update the theme / move it, etc.
thanks
March 17, 2014 at 2:00 pm #58104Hi,
Please add this code at functions.php end of fileadd_filter('add_to_cart_fragments', 'woocommerce_header_add_to_cart_fragment'); function woocommerce_header_add_to_cart_fragment( $fragments ) { global $woocommerce; $cart_count = $woocommerce->cart->cart_contents_count; $cart_count = empty($cart_count) ? '0' : $cart_count ; ob_start(); $fragments['a.cart-contents'] = ''; echo '<a class="cart-contents" href="'.$woocommerce->cart->get_cart_url().'" title="'.__("View your shopping cart", "swiftframework").'"><i class="sf-cart"></i>'.$cart_count.' Items</a>'; $fragments['a.cart-contents'] = ob_get_clean(); return $fragments; }
Hope it will work sure .
ThanksMarch 17, 2014 at 2:46 pm #58135thanks for the quick reply.
I still have it flashing though… ๐
March 17, 2014 at 3:13 pm #58149Hi,
Have you made changes in sf-header.php as defined at previous reply ?Thanks
March 17, 2014 at 3:26 pm #58161In themes/neighborhood./… I have replaced the original code in sf-header with:
$cart_output .= '<li class="parent shopping-bag-item"><a class="cart-contents" href="'.$woocommerce->cart->get_cart_url().'" title="'.__("View your shopping cart", "swiftframework").'"><i class="sf-cart"></i>'.$cart_count_text.'</a>';
in neighborhood child there is no such file (only style.css and functions.php), so i dont exactlye understand what you mean by:
Please open to edit sf-header.php line 695 at /wp-content/themes/neighborhood/includes/swift-framework/sf-content-display/ and sf-header.php line 695 at /wp-content/themes/neighborhood-child/
in sf-woocommerce.php i replace the original code (line 27) with:
function sf_product_items_text($count) { $product_item_text = ""; if ( $count > 1 ) { $product_item_text = str_replace('%', number_format_i18n($count), __('(%)', 'swiftframework')); } elseif ( $count == 0 ) { $product_item_text = __('(0)', 'swiftframework'); } else { $product_item_text = __('(1)', 'swiftframework'); } return $product_item_text; }
anything i’m doing wrong here?
Regards
March 17, 2014 at 3:28 pm #58164also, it would be great if you could take a look at my question:
http://support.swiftideas.net/forums/topic/shopping-bag-and-wishlist-wrong-links/
thanks!
March 17, 2014 at 3:29 pm #58165Hi,
Please share website URL with wordpress admin login detail so i can check and fix the issue easily .
ThanksMarch 17, 2014 at 3:43 pm #58171Hi,
Please open to edit sf-woocommerce.php at /neighborhood/includes/swift-framewwork/Find this code at line 111 <a class="cart-contents" href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php _e('View your shopping cart', 'swiftframework'); ?>"><i class="sf-cart"></i><?php echo $woocommerce->cart->get_cart_total(); ?></a> Replace with <a class="cart-contents" href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php _e('View your shopping cart', 'swiftframework'); ?>"><i class="sf-cart"></i><?php echo $cart_count_text; ?></a>
Thanks
March 17, 2014 at 3:49 pm #58177That did the trick! Maybe an idea to add this information to the knowledgebase?
great job Mohammad
March 17, 2014 at 3:56 pm #58181Most welcome ! I will add this knowledgebase sure .
Thanks ๐
With Best Regards
Swift IdeasMarch 30, 2014 at 12:35 pm #62400hi, i made a slight change and it keeps flashing like normal. May I ask what you did to clear the cache?
-
Posted in: Neighborhood
You must be logged in and have valid license to reply to this topic.