Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8960363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:38:33+00:00 2026-06-15T15:38:33+00:00

I know we can easily limit the max quantity of a given product a

  • 0

I know we can easily limit the max quantity of a given product a customer can purchase per order, but is it possible (natively or even with a plugin) to limit max quantity of a given product per CUSTOMER ??

I don’t want to use a coupon nor modify the code: it needs to be a sale price with the help of native or extension functionality.

Magento 1.5.1

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T15:38:34+00:00Added an answer on June 15, 2026 at 3:38 pm

    It is not possible native, but you can make a module that will perform such restrictions.

    1. You need to create a resource model, that will retrieve not canceled and not refunded orders for product(s) with particular product id. Actually it just a simple select to sales/order and sales/order_item table. Method of resource model might look like the following:

      public function getPurchasedProductQty(array $productIds, $customerId)
      {
          $select = $this->_getReadAdapter()->select();
          $select
              ->from(array('order_item' => $this->getTable('sales/order_item')),
                        array(
                            'qty' => new Zend_Db_Expr('order_item.ordered_qty - order_item.canceled_qty - order_item.refunded_qty'),
                            'product_id'))
              // Joining order to retrieve info about item and filter out canceled or refunded orders
              ->join(array('order' => $this->getTable('sales/order')),
                     'order.entity_id = order_item.order_id',
                     array())
              // Limit it to the current customer
              ->where('order.customer_id = ?', $customerId)
              // Filter out refunded and canceled orders
              ->where('order.state NOT IN(?)', array(
                  Mage_Sales_Model_Order::STATE_CLOSED,
                  Mage_Sales_Model_Order::STATE_CANCELED
              ))
              // Add Product Id Condition
              ->where('order_item.product_id IN(?)', $productIds);
      
          return $this->_getReadAdapter()->fetchCol($select);
      }
      
    2. Then when you observe sales_quote_item_collection_products_after_load event you just can place your custom logic with checking the restrictions on products that are going to be used in the cart and remove that ones from loaded collection. This logic you should implement yourself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know you can easily add custom meta boxes per post type, but I'm
I know you can share control easily with master page. But what if I
I know in templates you can easily count comments with get_comment_count , but how
As far as I know, at the current moment, late 2011 the max-connections-per-server limit
I know I can easily do this with a few lines of PHP but
I know I can easily work around this, but I'm looking for the best
By using java reflection, we can easily know if an object is an array.
I know that this can be easily done by using if(i%5 == 0 OR
I have a query that I know can be done using a subselect, but
You can know if the event stack is empty calling the gtk.events_pending() method, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.