Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › erased shopping bag
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › erased shopping bag
- This topic has 16 replies, 3 voices, and was last updated 8 years by Mohammad – SUPPORT.
-
Posted in: Neighborhood
-
September 22, 2015 at 8:09 am #215255
I was trying to follow what a support member wrote down to remove the total price of an item in a shopping cart but accidentally deleted my shopping bag icon.So I need help adding the icon back, removing the total price in the cart and leaving only the number of items. The last picture I attached is what I would like the shopping icon to look like.
Thanks,
JamieAttachments:
You must be logged in to view attached files.September 22, 2015 at 8:24 am #215267Hi,
Please use this custom css code:-.menu > li.shopping-bag-item a > i.sf-cart, .mobile-cart-link i.sf-cart{ display:block !important; }
Thanks
MohammadSeptember 22, 2015 at 8:40 pm #215538Hi Mohammad,
Where do I add it Im new to WORDPRESS and clueless where to paste this code
September 22, 2015 at 9:57 pm #215547Hi,
Go to our theme options-> General options and paste that code in the custom css field that you can see in this screenshot.
https://www.dropbox.com/s/z1m157phz2redky/Screenshot%202015-09-22%2021.57.24.png?dl=0Hope it helps.
-Rui
September 23, 2015 at 3:44 am #215576Ok I pasted it but it didn’t work. I don’t know if its because I deleted something in editor right under header cart view the first time I tried doing it myself?
Attachments:
You must be logged in to view attached files.September 23, 2015 at 7:08 am #215587Hi,
Please remove my last css code and use this new css code:-.menu > li.shopping-bag-item a > i.sf-cart, .mobile-cart-link i.sf-cart { display: inline-block !important; }
Thanks
MohammadSeptember 23, 2015 at 8:14 am #215611I still get nothing its doesn’t change.
September 23, 2015 at 8:31 am #215614Hi,
Its because that you removed the code in editor. Now i resolved the issue.
Thanks
MohammadSeptember 23, 2015 at 8:46 am #215625Thanks Mohammad for adding the shopping cart back, but I still get the shopping bag with the order total and now the shopping bag moved.
Attachments:
You must be logged in to view attached files.September 23, 2015 at 8:48 am #215627I just want it to sort of look like the picture I have attached. A shopping bag with the item count not total amount and number count.
Thanks
Jamie
Attachments:
You must be logged in to view attached files.September 23, 2015 at 11:25 am #215697Hi,
Please paste this code at functions.php of child theme and let me know.function sf_woo_header_add_to_cart_fragment( $fragments ) { global $woocommerce; ob_start(); $cart_total = WC()->cart->get_cart_total(); $cart_count = $woocommerce->cart->cart_contents_count; $cart_count_text = sf_product_items_text($cart_count); $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><span class="count" ><?php echo $cart_count; ?></span></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> </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; }
Thanks
MohammadSeptember 23, 2015 at 7:00 pm #215901I’m new to wordpress and I tried to google how to paste the code in functions.php of a child theme with no luck do you have a step by step guide or on how to do this or should I call my host GODaddy so they can help with this?
September 24, 2015 at 7:06 am #215973Hi,
Just open to edit functions.php through control panel editor of Godaddy and paste my code at end of file. Make sure that your child theme should be activated.
Thanks
MohammadOctober 1, 2015 at 8:18 pm #217938Do I create a child theme or is it already there? Im having trouble and godaddy doesn’t seem to know where or what is a child theme.
October 2, 2015 at 10:37 am #218032Hi,
You need to upload attached child theme directory after extract at /wordpress_installation_directory/wp-content/ directory.
Thanks
MohammadAttachments:
You must be logged in to view attached files. -
Posted in: Neighborhood
You must be logged in and have valid license to reply to this topic.