Jump to content

Recommended Posts

Hello Community,

i have a problem on my wordpress site. I basically don't want to have that the the "header-cart-amount" class shows how many items i have. Here is an example: MRoBaab.png

Here is the php code:

	<div class="site-header-top">
		
		<div class="site-container">
			
			<nav id="site-navigation" class="main-navigation avant-nav-style-plain" role="navigation">
				<span class="header-menu-button"><i class="fa fa-bars"></i><span><?php echo esc_attr( get_theme_mod( 'avant-header-menu-text', __( 'menu', 'avant' ) ) ); ?></span></span>
				<div id="main-menu" class="main-menu-container">
					<span class="main-menu-close"><i class="fa fa-angle-right"></i><i class="fa fa-angle-left"></i></span>
					<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_id' => 'primary-menu' ) ); ?>
				</div>

				<div class="header-cart">
			        <a class="header-cart-contents" href="<?php echo esc_url( $woocommerce->cart->get_cart_url() ); ?>" title="<?php esc_attr_e( 'Indkøbskurv', 'avant' ); ?>">
			        </a>
				</div>

				<div class="site-header-search">
			
					<?php if ( !get_theme_mod( 'avant-header-search' ) ) : ?>
						<div class="menu-search">
			    			<i class="fa fa-search search-btn"></i>
			    		</div>
					<?php endif; ?>
			
					<?php if ( avant_is_woocommerce_activated() ) : ?>
						<?php if ( !get_theme_mod( 'avant-header-remove-cart' ) ) : ?>
					<?php endif; ?>
				<?php endif; ?>
			
		</div>
			</nav><!-- #site-navigation -->
			
		</div>
		<div class="clearboth"></div>
		
	</div>

I want to have a text instead. It should look like this: 06yMfab.png

I have already deleted the function, but it still there.

 

Can someone help me?

 

King Regards,

Adham

Link to comment
https://forums.phpfreaks.com/topic/306213-wordpress-php-help/
Share on other sites

This code is modifcatet. Here is the before:

	<div class="site-header-top">
		
		<div class="site-container">
			<div class="site-header-top-left">
				
				<nav id="site-navigation" class="main-navigation avant-nav-style-plain" role="navigation">
					<span class="header-menu-button"><i class="fa fa-bars"></i><span><?php echo esc_attr( get_theme_mod( 'avant-header-menu-text', __( 'menu', 'avant' ) ) ); ?></span></span>
					<div id="main-menu" class="main-menu-container">
						<span class="main-menu-close"><i class="fa fa-angle-right"></i><i class="fa fa-angle-left"></i></span>
						<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_id' => 'primary-menu' ) ); ?>
					</div>
				</nav><!-- #site-navigation -->
				
			</div>
			
			<div class="site-header-top-right">
				
				<?php if ( avant_is_woocommerce_activated() ) : ?>
					<?php if ( !get_theme_mod( 'avant-header-remove-cart' ) ) : ?>
						<div class="header-cart">
							
				            <a class="header-cart-contents" href="<?php echo esc_url( $woocommerce->cart->get_cart_url() ); ?>" title="<?php esc_attr_e( 'View your shopping cart', 'avant' ); ?>">
				                <span class="header-cart-amount">
				                    <?php echo sprintf( _n( '%d item', '%d items', $woocommerce->cart->cart_contents_count, 'avant' ), $woocommerce->cart->cart_contents_count ); ?><span> - <?php echo $woocommerce->cart->get_cart_total(); ?></span>
				                </span>
				                <span class="header-cart-checkout <?php echo ( $woocommerce->cart->cart_contents_count > 0 ) ? sanitize_html_class( 'cart-has-items' ) : ''; ?>">
				                    <i class="fa fa-shopping-cart"></i>
				                </span>
				            </a>
							
						</div>
					<?php endif; ?>
				<?php endif; ?>
				
			</div>
			<div class="clearboth"></div>
			
		</div>
		
	</div>
Link to comment
https://forums.phpfreaks.com/topic/306213-wordpress-php-help/#findComment-1555402
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.