• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Product quantity not displaying correctly in cart

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Product quantity not displaying correctly in cart

This topic is: not resolved
  • This topic has 7 replies, 3 voices, and was last updated 6 years ago by frobin.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • March 1, 2016 at 10:47 am #180338
    EmLY14
    Member

    I am working with Cafe Pro and Woocommerce on a retail site. I am experiencing an issue with the quantity of products displayed in the cart.

    There is no issue in selecting any number of products but when viewing in the cart the quantity will only display '1' in the box, however the price will reflect how many have been selected. This is confusing to the consumer. If any of you have experienced this before or are happy to share any tips with me I would be hugely grateful.

    Thanks in advance.

    http://www.onwardtrading.com
    March 2, 2016 at 7:45 am #180429
    Victor Font
    Moderator

    Do you have any filters set in functions.php to set default quantities. Look for code in your functions file that resembles the code below to work with the woocommerce_quantity_input_args filter. Code like this will always reset the quantity to 1. Other than this guess, this may be a question for WooCommerce support because this is not about a Studio Press theme.

    add_filter('woocommerce_quantity_input_args', 'default_quantity_values');
    function default_quantity_values( $default ){
        $default = array(
            'input_name'    => 'quantity',
            'input_value'   => '1',
            'max_value'     => '1000',
            'min_value'     => '1',
            'step'          => '1',
        );
        return $default;
    }

    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    March 2, 2016 at 9:01 am #180444
    EmLY14
    Member

    Hi Victor,

    Below is what I found in my Functions.php file. Looks similar to what you mentioned. Is there an easy fix to change the code to help with the quantity display?

    add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 40;' ), 20 );
    function woocommerce_quantity_input() {
    global $product;
    $defaults = array(
    'input_name' => 'quantity',
    'input_value' => '1',
    'max_value' => apply_filters( 'woocommerce_quantity_input_max', '', $product ),
    'min_value' => apply_filters( 'woocommerce_quantity_input_min', '', $product ),
    'step' => apply_filters( 'woocommerce_quantity_input_step', '', $product ),
    'style' => apply_filters( 'woocommerce_quantity_style', 'float:left; margin-right:10px;', $product )
    );
    if ( ! empty( $defaults['min_value'] ) )
    $min = $defaults['min_value'];
    else $min = 1;
    if ( ! empty( $defaults['max_value'] ) )
    $max = $defaults['max_value'];
    else $max = 20;
    if ( ! empty( $defaults['step'] ) )
    $step = $defaults['step'];
    else $step = 1;
    $options = '';
    for ( $count = $min; $count <= $max; $count = $count+$step ) {
    $options .= '<option value="' . $count . '">' . $count . '</option>';
    }

    March 3, 2016 at 12:40 pm #180550
    Victor Font
    Moderator

    Comment out the function and see if it fixes your issue.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    March 3, 2016 at 1:49 pm #180559
    EmLY14
    Member

    Thanks Victor but I dont know how to do this.

    March 3, 2016 at 3:58 pm #180573
    Victor Font
    Moderator

    Insert a blank line in front of the word function and type /*. Then put */ after the closing brace. This is a php comment /* */.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    March 4, 2016 at 5:23 am #180635
    Victor Font
    Moderator

    If it's any help, here's a link to a page that will help you learn about commenting code in php: http://php.net/manual/en/language.basic-syntax.comments.php


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    August 6, 2016 at 10:33 am #190833
    frobin
    Participant

    from you cpanel access your "file manager" follow these steps and you should be able to adjust the cart size to clearly see the "quantity" in the cart.
    1. Access you wp-content folder
    2. Next, open your plugins folder
    3. Then, open your woocommerce folder
    4. Open "assets" folder
    5. open "css" folder, scroll down a bit, then click on "woocommerce.css" file then at the top, click edit.
    6. when that screen opens, a lot of text will appear only single spaced. *somewhere around line 17, (you can count manually,) you will see this, .quantity .qty{width:5.631em;text-align:center} change the 3 to a 5 and hit save changes.
    7. Refresh your screen and the "number" in the quantity cart box will be visible.

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2022 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble