Title: Quantity Step Message
Last modified: February 5, 2025

---

# Quantity Step Message

 *  Resolved [kimruddock](https://wordpress.org/support/users/kimruddock/)
 * (@kimruddock)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/quantity-step-message/)
 * Is it possible to grab the set quantity step value from the product object in
   order to display the required step amount to the user on the product page? I 
   want to display this message next to the quantity field so the user knows what
   quantity step they must order in.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Kawsar Ahmed Rubel](https://wordpress.org/support/users/kawsarahmedr/)
 * (@kawsarahmedr)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/quantity-step-message/#post-18288273)
 * Hi there,
 * You can use the `wcmmq_get_product_limits()` function to retrieve product limit
   details. This function provides an array containing various values, such as the`
   step`, `min_qty`, `max_qty`, `min_total`, `max_total` and `rule`.
   **Example**:
   Retrieving Product Limits:`$limits = wcmmq_get_product_limits( $product_id );`
   Accessing Specific Data (e.g., step):
 *     ```wp-block-code
       if ( $limits && isset( $limits['step'] ) ) {$step = $limits['step'];}
       ```
   
 * Once you have the `step` value, you can use it to display relevant notices or
   take other actions as needed.
   **Code to Display Step Value After the Add to Cart
   Form:**
 * You can add the following code to your theme’s functions.php file or use a code
   insertion plugin like “[Insert Codes](https://wordpress.org/plugins/insert-codes/)“
 *     ```wp-block-code
       /** * Display the quantity step message after the add to cart form. */function uniqueprefix_display_quantity_step_message() {    global $product;    if ( ! $product ) {        return;    }    // Retrieve product limits, including the step value.    $limits = function_exists( 'wcmmq_get_product_limits' ) ? wcmmq_get_product_limits( $product->get_id() ) : [];    if ( isset( $limits['step'] ) && ! empty( $limits['step'] ) ) {        $step_value = intval( $limits['step'] );        // Display the message after the add to cart form.        echo '<p class="quantity-step-message">';        printf( /* translators: %d: step value */ esc_html__( 'Please order in multiples of %d.', 'your-text-domain' ), absint( $step_value ) );        echo '</p>';    }}add_action( 'woocommerce_after_add_to_cart_form', 'uniqueprefix_display_quantity_step_message' );
       ```
   
 * > Warning!
   >  The above PHP code may break your site. Please verify before using it.
 * This code will display a message after the product’s quantity field and add-to-
   cart button, informing customers about the required step value for quantity.
 * Let me know if you need further assistance!
 * Thanks!
   Regards,Kawsar Ahmed
 *  Thread Starter [kimruddock](https://wordpress.org/support/users/kimruddock/)
 * (@kimruddock)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/quantity-step-message/#post-18288605)
 * That’s incredibly helpful. Thank you so much for your detailed reply. Fantastic
   support response!
 *  Plugin Support [Maruf Hossain](https://wordpress.org/support/users/marufbyteever/)
 * (@marufbyteever)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/quantity-step-message/#post-18288652)
 * We’re happy to know that it works for your needs. Your feedback means a lot to
   us! 
   As we assume your needs are fulfilled, we are going to close this support
   ticket. However, you can always reopen it if you require any further assistance.
 * Thank you for using WC Min Max Quantities!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Quantity Step Message’ is closed to new replies.

 * ![](https://ps.w.org/wc-min-max-quantities/assets/icon-256x256.png?rev=3145695)
 * [Min Max Quantities - Set Minimum/Maximum Quantity & Price Limits with Step Control for WooCommerce](https://wordpress.org/plugins/wc-min-max-quantities/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wc-min-max-quantities/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wc-min-max-quantities/)
 * [Active Topics](https://wordpress.org/support/plugin/wc-min-max-quantities/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wc-min-max-quantities/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wc-min-max-quantities/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Maruf Hossain](https://wordpress.org/support/users/marufbyteever/)
 * Last activity: [1 year, 3 months ago](https://wordpress.org/support/topic/quantity-step-message/#post-18288652)
 * Status: resolved