Viewing 15 posts - 1 through 15 (of 17 total)
  • #215255
    jamieandrade88
    Member
    Post count: 25

    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,
    Jamie

    Attachments:
    You must be logged in to view attached files.
    #215267
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    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
    Mohammad

    #215538
    jamieandrade88
    Member
    Post count: 25

    Hi Mohammad,

    Where do I add it Im new to WORDPRESS and clueless where to paste this code

    #215547
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    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=0

    Hope it helps.

    -Rui

    #215576
    jamieandrade88
    Member
    Post count: 25

    Ok 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.
    #215587
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    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
    Mohammad

    #215611
    jamieandrade88
    Member
    Post count: 25

    I still get nothing its doesn’t change.

    #215614
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Its because that you removed the code in editor. Now i resolved the issue.
    Thanks
    Mohammad

    #215625
    jamieandrade88
    Member
    Post count: 25

    Thanks 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.
    #215627
    jamieandrade88
    Member
    Post count: 25

    I 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.
    #215697
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    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">&times;</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
    Mohammad

    #215901
    jamieandrade88
    Member
    Post count: 25

    I’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?

    #215973
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    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
    Mohammad

    #217938
    jamieandrade88
    Member
    Post count: 25

    Do 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.

    #218032
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    You need to upload attached child theme directory after extract at /wordpress_installation_directory/wp-content/ directory.
    Thanks
    Mohammad

    Attachments:
    You must be logged in to view attached files.
Viewing 15 posts - 1 through 15 (of 17 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register