Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How to set up ordering limit in product view page? 
 
epvicky
Member
 
Total Posts:  59
Joined:  2011-07-28
 

Hi,

I would like to do for some of the most widely used products, setup an ordering limit(max level). I want to indicate this level in product view page. Can anyone guide me how to do this for the mostly used products? Thanks in advance...!!

Thanks & Regards,
epvicky

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bright Ideas
Sr. Member
 
Total Posts:  140
Joined:  2011-04-17
Mumbai
 

Make an attribute with the following options on/true.

1)Used in Product Listing :True

2)Used for Sorting in Product Listing: True

 
Magento Community Magento Community
Magento Community
Magento Community
 
Siggi_Schmitz
Enthusiast
 
Avatar
Total Posts:  811
Joined:  2011-07-03
 

Don`t know the option “Maximum Qty Allowed in Shopping Cart” in the stock management in the product view (backend) ?
Or is this not the correct feature that you want?

 
Magento Community Magento Community
Magento Community
Magento Community
 
epvicky
Member
 
Total Posts:  59
Joined:  2011-07-28
 
Siggi_Schmitz - 10 December 2012 08:40 AM

Don`t know the option “Maximum Qty Allowed in Shopping Cart” in the stock management in the product view (backend) ?
Or is this not the correct feature that you want?

I know that feature that one is to control the whole amount of products in shopping cart but my point is to set up the maximum limit on entering quantity of each product.

 
Magento Community Magento Community
Magento Community
Magento Community
 
epvicky
Member
 
Total Posts:  59
Joined:  2011-07-28
 
Bright Ideas - 10 December 2012 02:47 AM

Make an attribute with the following options on/true.


1)Used in Product Listing :True

2)Used for Sorting in Product Listing: True

Thanks for your reply, i added the attribute like what you said above, it’s displaying in product view page. But i want to setup a ordering limit on quantity of each product. (eg: max limit 4 quantity ) means we shouldn’t allow the user to enter more than 4 quantity on particular product.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bright Ideas
Sr. Member
 
Total Posts:  140
Joined:  2011-04-17
Mumbai
 

for that you need to customize

Look for the class

Mage_Checkout_OnepageController

Method

public function indexAction()

here you can add logic, like the function

$quote->validateMinimumAmount()

Do not change the core, extend the function instead

Better way is to do is with Magento Events
check http://www.magebuzz.com/blog/2012/08/24/magento-event

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bright Ideas
Sr. Member
 
Total Posts:  140
Joined:  2011-04-17
Mumbai
 

You can write an event as follows,
add the following code into ur custom module config.xml file under <global></global>

<events>
            <
checkout_cart_save_before>
                <
observers>
                    <
yourFunction>
                        <class>
checkout/observer</class>
                        <
method>loadSomething</method>
                    </
yourFunction>
                </
observers>
            </
checkout_cart_save_before>
        </
events>

Add the following function in ur Observer.php file

public function yourFunction()
    
{
      
//your code here
    
}
 
Magento Community Magento Community
Magento Community
Magento Community
 
epvicky
Member
 
Total Posts:  59
Joined:  2011-07-28
 
Bright Ideas - 12 December 2012 02:18 AM

You can write an event as follows,
add the following code into ur custom module config.xml file under <global></global>

<events>
            <
checkout_cart_save_before>
                <
observers>
                    <
yourFunction>
                        <class>
checkout/observer</class>
                        <
method>loadSomething</method>
                    </
yourFunction>
                </
observers>
            </
checkout_cart_save_before>
        </
events>

Add the following function in ur Observer.php file
public function yourFunction()
    
{
      
//your code here
    
}

Thank you very much that works great… whether is it possible to made a option in inventory tab of admin? because it will be easy for non developers to manage it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bright Ideas
Sr. Member
 
Total Posts:  140
Joined:  2011-04-17
Mumbai
 

Means defining an attribute for Maximum Limit?

 
Magento Community Magento Community
Magento Community
Magento Community
 
epvicky
Member
 
Total Posts:  59
Joined:  2011-07-28
 
Bright Ideas - 13 December 2012 08:59 AM

Means defining an attribute for Maximum Limit?

yes, we have Maximum Qty Allowed in Shopping Cart option of Inventory Tab know.. like that…

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bright Ideas
Sr. Member
 
Total Posts:  140
Joined:  2011-04-17
Mumbai
 

Yes u can make an attribute for that

 
Magento Community Magento Community
Magento Community
Magento Community
 
epvicky
Member
 
Total Posts:  59
Joined:  2011-07-28
 
Bright Ideas - 16 December 2012 08:41 PM

Yes u can make an attribute for that

Oh.!  ok..  thanks

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top