/*
jQuery(document).ready
(
  function($)
  {
    function ew_add_to_cart(product_id, attributes, ammount)
    {
      $.post
      (
        EWAjax.ajaxurl,
        {
          action: "ew_add_to_cart",
          ammount: ammount,
          attributes: attributes,
          product: product_id
        },
        function(response)
        {
          console.log(response);
          if($("aside.primary section.cart").length>0)
            $("aside.primary section.cart").replaceWith(response.aside);
          else
            $("aside.primary").prepend(response.aside);
            
          if($("footer section.cart").length>0)
            $("footer section.cart").replaceWith(response.footer);
          else
            $("footer").prepend(response.footer);
        }
      );
    }
    
    $("form.add").submit
    (
      function(event)
      {
        event.preventDefault();
        $form=$(this);
        
        $ammount=$form.find("input[name=ammount]");
        var ammount=$ammount.val();
        
        $product_id=$form.find("input[name=product]");
        var product_id=$product_id.val();
        
        var attributes=[];
        $form.find("input[name=attributes]").each
        (
          function()
          {
            attributes.push($(this).val());
          }
        );
        
        ew_add_to_cart(product_id, attributes, ammount);
      }
    );
  }
);
*/
