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, 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

Magento Forum

Custom Javascript addition
Jr. Member
Total Posts:  1
Joined:  2013-04-16

The company I support is switching to Magento and is wanting to create a new Custom Ordering form for our customers to purchase from.

The issue that comes with this though is that we have multiple drop-down menu’s that increase/decrease the price.  What happens however is that the customer is not allowed to send the order to the cart until the total order is above a certain a nutshell it’s a minimum price checker....

I spent a fair bit of time and finally found a way to get part of the way but the issue I’m running into now is that I don’t know what “id” to call to check the current total price (after the user has changed some of the drop-downs) so that my javascript can say yes or no to proceeding to the cart.

I did something similar to this in a different setting so I am just wondering if I’ll be able to call it or if I’m going down the wrong track?

Below is the chunk of code that takes the productAddToCartForm.submit call from the submit button and validates it, and my if/else statements work, but again without knowing what to check against it’s just poking around in the dark.  Many Thanks in advance

var productAddToCartForm = new VarienForm('product_addtocart_form');
productAddToCartForm.submit = function(buttonurl{
var check1 document.getElementById('product-price').value;
check1 <=100)
            if (
var form this.form;
oldUrl form.action;

                if (
.action url;
var null;
catch (e{
.form.action oldUrl;
                if (
throw e;

if (button && button != 'undefined'{
.disabled true;
Magento Community Magento Community
Magento Community
Magento Community
Indies Inc
Sr. Member
Total Posts:  193
Joined:  2013-09-18

You can get the data of the span using the class. For that you have to use the J-query or JavaScript which is easy for getting the data using class.


var check1 documentgetElementsByClassName('product-price').value;
var newprice = $(‘.price’).html();

Hope this will help you.

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