Support » Plugin: Simple Cart & Buy Now » [Plugin: Simple Cart & Buy Now] Add to Cart without reloading page?

  • Resolved r1987



    Just a staight question to everyone, that is using this plugin.

    is there a way to ajaxify the Add to Cart button also? Like so, that when i click on the Add to Cart it wouldn’t redirect me to the single.php page of the product, but changes the number of items in the cart with out reloading the page?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author bluey80


    I don’t know how to do that, but it would nice. Code suggestions welcome.




    But can you say, what’s the action for adding an item? When I click on the add to cart button, it redirects me to the single page of the product.

    When im at the checkout page, and i click remove, then i can see that the request for removing an item is ?remove=product_name . I tried to use ?add_item=product_name and that doesn’t add anything to the cart.

    As much as i’ve been searching around the AJAX thing, then it needs an ?add_item request to add the product to the cart at the background.

    Plugin Author bluey80


    It is a form. Using my site ( as a reference, here’s the relevent form for adding a part:

    <form method='post' class='wired-receiver' action=''>
    <input type='hidden' value='add_item' name='action'/>
    <input type='hidden' class='item_url' value='' name='item_url'/>
    <input type='hidden' value='wired-receiver' name='item_id'/>
    <input type='hidden' class='item_name' value='Wired Receiver' name='item_name'/>
    <input type='hidden' class='item_price' value='7' name='item_price'/>
    <input type='hidden' class='item_shipping' value='' name='item_shipping'/>
    <input type='hidden' class='item_weight' value='' name='item_weight'/>
    <p id='cartname'>Wired Receiver</p><p id='cartcontent'>Unit Price: $7.00 each<br/>Qty: <input type='text' class='item_qty' value='1' size='2' name='item_qty'/>
    <input type='submit' id='wired-receiver' class="add" name='add' value='Add To Cart'/>

    The action points to the current page you are on. Then a bunch of hidden name/value pairs: action:add_item; item_url:http://blah;item_price:7;

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Simple Cart & Buy Now] Add to Cart without reloading page?’ is closed to new replies.