title: {Magento} Product page and Add To Cart
body: <p>I am building a static page that contains several products. I took the static HTML that was generated by one of my product pages and added all the other products to this page. Each product has a radio button and the customer can only select one of them. The qty will always be 1.</p>
  
  <p>How do I submit the product_addtocart_form?</p>
  
  <p>I modified the form submit function like this:</p>
  
  <pre><code>var productAddToCartForm = new VarienForm("product_addtocart_form");
  productAddToCartForm.submit = function(){
    if(this.validator.validate()) {
      var product_id = jQuery("input[name='product']:checked").val();
      this.form.action = "/store/checkout/cart/add/product/"+product_id+"/qty/1";
      this.form.submit();
    }
  }.bind(productAddToCartForm);
  </code></pre>
  
  <p>But it doesn't always work. If I modify the action to this, which is the same as my product page but changing the product_id:</p>
  
  <pre><code>this.form.action = "/store/checkout/cart/add/uenc/aHR0cDovL3N0YWdpbmcuY2ljLnNjaWMuY29tL3N0b3JlL3B1YmxpY2F0aW9ucy8yNS1tb3N0LWlubm92YXRpdmUtYWdlbnRzLWluLWFtZXJpY2EuaHRtbD9fX19TSUQ9VQ,,/"+product_id+"/qty/1";
  </code></pre>
  
  <p>It also works inconsistenty.</p>
  
  <p>How do I do this??????</p>