How to remove the items word in cart woocommerce?









up vote
0
down vote

favorite
1












How to remove the items word in cart woocommerce?



See screenshot: WooCommerce Mini Cart header.php



in fuctions.php



Cart Fragments:



if ( ! function_exists( 'agricola_woocommerce_cart_link_fragment' ) ) 
function agricola_woocommerce_cart_link_fragment( $fragments )
ob_start();
agricola_woocommerce_cart_link();
$fragments['a.cart-contents'] = ob_get_clean();

return $fragments;


add_filter( 'woocommerce_add_to_cart_fragments',
'agricola_woocommerce_cart_link_fragment' );


Cart Link



if ( ! function_exists( 'agricola_woocommerce_cart_link' ) ) 
function agricola_woocommerce_cart_link()
?>
<a class="cart-contents" href="<?php echo esc_url( wc_get_cart_url() ); ?>" title="<?php esc_attr_e( 'View your shopping cart', 'agricola' ); ?>">
<?php
$item_count_text = sprintf(
/* translators: number of items in the mini cart. */
_n( '%d item', '%d items', WC()->cart->get_cart_contents_count(), 'agricola' ),
WC()->cart->get_cart_contents_count()
);
?>
<span class="amount"><?php echo wp_kses_data( WC()->cart->get_cart_subtotal() ); ?></span> <span class="count"><?php echo esc_html( $item_count_text ); ?></span>
</a>
<?php




Display Header Cart.



if ( ! function_exists( 'agricola_woocommerce_header_cart' ) ) 
function agricola_woocommerce_header_cart()
if ( is_cart() )
$class = 'current-menu-item';
else
$class = '';

?>
<ul id="site-header-cart" class="site-header-cart">
<li class="<?php echo esc_attr( $class ); ?>">
<?php agricola_woocommerce_cart_link(); ?>
</li>
<li>
<?php
$instance = array(
'title' => '',
);

the_widget( 'WC_Widget_Cart', $instance );
?>
</li>
</ul>
<?php




I already remove <?php $item_count_text = sprintf( /* translators: number of items in the mini cart. */ _n( '%d item', '%d items', WC()->cart->get_cart_contents_count(), 'agricola' ), WC()->cart->get_cart_contents_count()); ?> but keep come back with title like '9 items' I want to hide it.



I only want basket icon with price cost.










share|improve this question

























    up vote
    0
    down vote

    favorite
    1












    How to remove the items word in cart woocommerce?



    See screenshot: WooCommerce Mini Cart header.php



    in fuctions.php



    Cart Fragments:



    if ( ! function_exists( 'agricola_woocommerce_cart_link_fragment' ) ) 
    function agricola_woocommerce_cart_link_fragment( $fragments )
    ob_start();
    agricola_woocommerce_cart_link();
    $fragments['a.cart-contents'] = ob_get_clean();

    return $fragments;


    add_filter( 'woocommerce_add_to_cart_fragments',
    'agricola_woocommerce_cart_link_fragment' );


    Cart Link



    if ( ! function_exists( 'agricola_woocommerce_cart_link' ) ) 
    function agricola_woocommerce_cart_link()
    ?>
    <a class="cart-contents" href="<?php echo esc_url( wc_get_cart_url() ); ?>" title="<?php esc_attr_e( 'View your shopping cart', 'agricola' ); ?>">
    <?php
    $item_count_text = sprintf(
    /* translators: number of items in the mini cart. */
    _n( '%d item', '%d items', WC()->cart->get_cart_contents_count(), 'agricola' ),
    WC()->cart->get_cart_contents_count()
    );
    ?>
    <span class="amount"><?php echo wp_kses_data( WC()->cart->get_cart_subtotal() ); ?></span> <span class="count"><?php echo esc_html( $item_count_text ); ?></span>
    </a>
    <?php




    Display Header Cart.



    if ( ! function_exists( 'agricola_woocommerce_header_cart' ) ) 
    function agricola_woocommerce_header_cart()
    if ( is_cart() )
    $class = 'current-menu-item';
    else
    $class = '';

    ?>
    <ul id="site-header-cart" class="site-header-cart">
    <li class="<?php echo esc_attr( $class ); ?>">
    <?php agricola_woocommerce_cart_link(); ?>
    </li>
    <li>
    <?php
    $instance = array(
    'title' => '',
    );

    the_widget( 'WC_Widget_Cart', $instance );
    ?>
    </li>
    </ul>
    <?php




    I already remove <?php $item_count_text = sprintf( /* translators: number of items in the mini cart. */ _n( '%d item', '%d items', WC()->cart->get_cart_contents_count(), 'agricola' ), WC()->cart->get_cart_contents_count()); ?> but keep come back with title like '9 items' I want to hide it.



    I only want basket icon with price cost.










    share|improve this question























      up vote
      0
      down vote

      favorite
      1









      up vote
      0
      down vote

      favorite
      1






      1





      How to remove the items word in cart woocommerce?



      See screenshot: WooCommerce Mini Cart header.php



      in fuctions.php



      Cart Fragments:



      if ( ! function_exists( 'agricola_woocommerce_cart_link_fragment' ) ) 
      function agricola_woocommerce_cart_link_fragment( $fragments )
      ob_start();
      agricola_woocommerce_cart_link();
      $fragments['a.cart-contents'] = ob_get_clean();

      return $fragments;


      add_filter( 'woocommerce_add_to_cart_fragments',
      'agricola_woocommerce_cart_link_fragment' );


      Cart Link



      if ( ! function_exists( 'agricola_woocommerce_cart_link' ) ) 
      function agricola_woocommerce_cart_link()
      ?>
      <a class="cart-contents" href="<?php echo esc_url( wc_get_cart_url() ); ?>" title="<?php esc_attr_e( 'View your shopping cart', 'agricola' ); ?>">
      <?php
      $item_count_text = sprintf(
      /* translators: number of items in the mini cart. */
      _n( '%d item', '%d items', WC()->cart->get_cart_contents_count(), 'agricola' ),
      WC()->cart->get_cart_contents_count()
      );
      ?>
      <span class="amount"><?php echo wp_kses_data( WC()->cart->get_cart_subtotal() ); ?></span> <span class="count"><?php echo esc_html( $item_count_text ); ?></span>
      </a>
      <?php




      Display Header Cart.



      if ( ! function_exists( 'agricola_woocommerce_header_cart' ) ) 
      function agricola_woocommerce_header_cart()
      if ( is_cart() )
      $class = 'current-menu-item';
      else
      $class = '';

      ?>
      <ul id="site-header-cart" class="site-header-cart">
      <li class="<?php echo esc_attr( $class ); ?>">
      <?php agricola_woocommerce_cart_link(); ?>
      </li>
      <li>
      <?php
      $instance = array(
      'title' => '',
      );

      the_widget( 'WC_Widget_Cart', $instance );
      ?>
      </li>
      </ul>
      <?php




      I already remove <?php $item_count_text = sprintf( /* translators: number of items in the mini cart. */ _n( '%d item', '%d items', WC()->cart->get_cart_contents_count(), 'agricola' ), WC()->cart->get_cart_contents_count()); ?> but keep come back with title like '9 items' I want to hide it.



      I only want basket icon with price cost.










      share|improve this question













      How to remove the items word in cart woocommerce?



      See screenshot: WooCommerce Mini Cart header.php



      in fuctions.php



      Cart Fragments:



      if ( ! function_exists( 'agricola_woocommerce_cart_link_fragment' ) ) 
      function agricola_woocommerce_cart_link_fragment( $fragments )
      ob_start();
      agricola_woocommerce_cart_link();
      $fragments['a.cart-contents'] = ob_get_clean();

      return $fragments;


      add_filter( 'woocommerce_add_to_cart_fragments',
      'agricola_woocommerce_cart_link_fragment' );


      Cart Link



      if ( ! function_exists( 'agricola_woocommerce_cart_link' ) ) 
      function agricola_woocommerce_cart_link()
      ?>
      <a class="cart-contents" href="<?php echo esc_url( wc_get_cart_url() ); ?>" title="<?php esc_attr_e( 'View your shopping cart', 'agricola' ); ?>">
      <?php
      $item_count_text = sprintf(
      /* translators: number of items in the mini cart. */
      _n( '%d item', '%d items', WC()->cart->get_cart_contents_count(), 'agricola' ),
      WC()->cart->get_cart_contents_count()
      );
      ?>
      <span class="amount"><?php echo wp_kses_data( WC()->cart->get_cart_subtotal() ); ?></span> <span class="count"><?php echo esc_html( $item_count_text ); ?></span>
      </a>
      <?php




      Display Header Cart.



      if ( ! function_exists( 'agricola_woocommerce_header_cart' ) ) 
      function agricola_woocommerce_header_cart()
      if ( is_cart() )
      $class = 'current-menu-item';
      else
      $class = '';

      ?>
      <ul id="site-header-cart" class="site-header-cart">
      <li class="<?php echo esc_attr( $class ); ?>">
      <?php agricola_woocommerce_cart_link(); ?>
      </li>
      <li>
      <?php
      $instance = array(
      'title' => '',
      );

      the_widget( 'WC_Widget_Cart', $instance );
      ?>
      </li>
      </ul>
      <?php




      I already remove <?php $item_count_text = sprintf( /* translators: number of items in the mini cart. */ _n( '%d item', '%d items', WC()->cart->get_cart_contents_count(), 'agricola' ), WC()->cart->get_cart_contents_count()); ?> but keep come back with title like '9 items' I want to hide it.



      I only want basket icon with price cost.







      wordpress function woocommerce






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Sep 24 at 13:29









      Bubble

      36




      36






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          You can use CSS to hide that particular part. If you can provide the website link, we can help you with the CSS.
          OR you can use String Locator plugin to locate the code where it is written inside the files and then you can comment it or remove it from the file itself.
          Thanks






          share|improve this answer




















          • thanks, the site in localhost not live yet, I added span.count display: none; however in the future I might have like Basket icon with number of items without the word of items how do I do that?
            – Bubble
            Sep 24 at 13:57











          • One way which I can think of is to make changes in the files itself. which I have already mentioned how to find that code. you can create a woocommerce folder in your theme and copy paste the file in which you have to make the change so you wont have to edit the plugin files.
            – Anup Gupta
            Sep 25 at 7:56










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52480546%2fhow-to-remove-the-items-word-in-cart-woocommerce%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote













          You can use CSS to hide that particular part. If you can provide the website link, we can help you with the CSS.
          OR you can use String Locator plugin to locate the code where it is written inside the files and then you can comment it or remove it from the file itself.
          Thanks






          share|improve this answer




















          • thanks, the site in localhost not live yet, I added span.count display: none; however in the future I might have like Basket icon with number of items without the word of items how do I do that?
            – Bubble
            Sep 24 at 13:57











          • One way which I can think of is to make changes in the files itself. which I have already mentioned how to find that code. you can create a woocommerce folder in your theme and copy paste the file in which you have to make the change so you wont have to edit the plugin files.
            – Anup Gupta
            Sep 25 at 7:56














          up vote
          0
          down vote













          You can use CSS to hide that particular part. If you can provide the website link, we can help you with the CSS.
          OR you can use String Locator plugin to locate the code where it is written inside the files and then you can comment it or remove it from the file itself.
          Thanks






          share|improve this answer




















          • thanks, the site in localhost not live yet, I added span.count display: none; however in the future I might have like Basket icon with number of items without the word of items how do I do that?
            – Bubble
            Sep 24 at 13:57











          • One way which I can think of is to make changes in the files itself. which I have already mentioned how to find that code. you can create a woocommerce folder in your theme and copy paste the file in which you have to make the change so you wont have to edit the plugin files.
            – Anup Gupta
            Sep 25 at 7:56












          up vote
          0
          down vote










          up vote
          0
          down vote









          You can use CSS to hide that particular part. If you can provide the website link, we can help you with the CSS.
          OR you can use String Locator plugin to locate the code where it is written inside the files and then you can comment it or remove it from the file itself.
          Thanks






          share|improve this answer












          You can use CSS to hide that particular part. If you can provide the website link, we can help you with the CSS.
          OR you can use String Locator plugin to locate the code where it is written inside the files and then you can comment it or remove it from the file itself.
          Thanks







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Sep 24 at 13:49









          Anup Gupta

          123




          123











          • thanks, the site in localhost not live yet, I added span.count display: none; however in the future I might have like Basket icon with number of items without the word of items how do I do that?
            – Bubble
            Sep 24 at 13:57











          • One way which I can think of is to make changes in the files itself. which I have already mentioned how to find that code. you can create a woocommerce folder in your theme and copy paste the file in which you have to make the change so you wont have to edit the plugin files.
            – Anup Gupta
            Sep 25 at 7:56
















          • thanks, the site in localhost not live yet, I added span.count display: none; however in the future I might have like Basket icon with number of items without the word of items how do I do that?
            – Bubble
            Sep 24 at 13:57











          • One way which I can think of is to make changes in the files itself. which I have already mentioned how to find that code. you can create a woocommerce folder in your theme and copy paste the file in which you have to make the change so you wont have to edit the plugin files.
            – Anup Gupta
            Sep 25 at 7:56















          thanks, the site in localhost not live yet, I added span.count display: none; however in the future I might have like Basket icon with number of items without the word of items how do I do that?
          – Bubble
          Sep 24 at 13:57





          thanks, the site in localhost not live yet, I added span.count display: none; however in the future I might have like Basket icon with number of items without the word of items how do I do that?
          – Bubble
          Sep 24 at 13:57













          One way which I can think of is to make changes in the files itself. which I have already mentioned how to find that code. you can create a woocommerce folder in your theme and copy paste the file in which you have to make the change so you wont have to edit the plugin files.
          – Anup Gupta
          Sep 25 at 7:56




          One way which I can think of is to make changes in the files itself. which I have already mentioned how to find that code. you can create a woocommerce folder in your theme and copy paste the file in which you have to make the change so you wont have to edit the plugin files.
          – Anup Gupta
          Sep 25 at 7:56

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52480546%2fhow-to-remove-the-items-word-in-cart-woocommerce%23new-answer', 'question_page');

          );

          Post as a guest














































































          Popular posts from this blog

          27

          Top Tejano songwriter Luis Silva dead of heart attack at 64

          2013 DreamHack Counter-Strike: Global Offensive Championship