Adding quanitity to add to cart button - paypal

I am using a Add to Cart button in paypal on my HTML website.
What I would like to do is add a quantity drop down menu that when someone puts in they want to buy say 5 of an item it changes the Shopping cart total to that 5 times the unit price. For example a I have a variable sized items at the a $10.00 price but they want to order 5 of them so instead of the Shopping cart only showing 1 item at $10.00 I want it to show 5 items totally $50.00. I don't want the customer to have to click the add to cart button 5 individual time.
I am also using HTML.

If you are looking for dynamic buttons which updates the add to cart buttons with javascript, you can
use minicartjs which is a third party plugin.
Demo

You can add the below line of code in your existing add to cart button to provide the drop down for the quantity selection :
Select Quantity
<select name="quantity">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
Vimal's suggestion is good as it will provide you the option for more customization

Related

Form in one page button on other page how to perform this action?

I need to submit form for updating cart in magento so as to do that I have a button Update cart but the button should be in other page as per the PSD document now is that possible if I click button on this page and the action should be done which is in other page.
Please help me in doing this.
Oops I got the answer for this.
just followed this process.
<input type="button" value="Click Me!" onclick="submitForms()" />
submitForms = function(){
document.forms["form1"].submit();
document.forms["form2"].submit();
}

Blur for submitting form AngularJS

Hi I have a following html markup
<h2>First Name Last Name</h2>
<form>
<div>
<input name="fname">
<input name="lname">
</div>
</form>
You click on a header to show the form fields and to edit them (blur hides the fields and shows the header again).
I have a problem because the first and last name are in the same header, so you click on one item to edit two fields.
I am submitting the form on a blur event for the input fields but when I click the last name, because blur is being called in the first name, I cannot edit the second field.
I am using AngularJS which is also presenting a problem because I cannot figure out which element is focused because document.activeElement returns the entire body.
Any help is much appreciated!
Assuming you're using ngBlur directive on the input element, you can mix it with ngFocus to keep elements visible as wanted: <input name="fname" ng-focus="showFields=true;" ng-blur="blurField($event);" >
Using a function for ngBlur, you will have access to the $event object which in turn will expose the elements you need (like target or related). Afterwards, you can trigger form submit depending on your needs.
A demo plunker is HERE.

How do I make disable-for-touch work in Zurb Foundation?

I'm working on a site that another designer built: http://bigbolts.qa.aztekhq.com/. The products in the New Products and Recently Viewed areas on that page have two buttons with tooltips on them, and when they are clicked, they are supposed to trigger other link events: "More Information" goes to the detail page, "Add To Cart" triggers a modal. This works fine on desktops, but not on touch devices. On my iPhone and iPad, touching the links only triggers the tooltips and nothing else. I added data-options="disabled-for-touch:true" to the links, but it does not seem to be working.
foundation makes it easy to disable or enable on touch-enabled devices, just add class= "show-for-touch" or "hide-for-touch" to the element you want to disable. code example below.
<p class="panel">
<strong class="show-for-touch">You are on a touch-enabled device.</strong>
<strong class="hide-for-touch">You are not on a touch-enabled device.</strong>
</p>
Ahem... according to the tooltips documentation, it is better to add data-options="disable_for_touch:true" to your link. Like this:
<span data-tooltip data-options="disable_for_touch:true" class="has-tip" title="Tooltips are awesome!">
Your Cart
</span>

Firefox 5 not using select="selected" value on page refresh, retaining old value

I've found a strange bug in Firefox 5 (I don't have access to 4 right now). But, I think it was probably working in Firefox 4 because I just got a new computer and I don't remember seeing this error before.
I have a couple of select boxes. The selected value is based on a session value that can change by some selects in a modal window. When I close the modal window and refresh the page, instead of updating the select boxes to the correctly selected value, it stays on the value originally chosen when the page first loaded. What's very strange is that when I look at the code in Firebug it shows the correctly selected value, but that is NOT the value the select box shows as selected! I've also run javascript and the selectedIndex is what I see in Firebug and correct, but it is NOT what I see selected.
If I do a hard refresh, I will see the correct value selected. I've tried to set the selectedIndex to the selectedIndex or some other value, but this will ONLY work on a hard refresh--even though I know the code is running because the alerts run. This code works fine in other browsers. Does anyone know of any workarounds?
<select id="sportid" name="sportid">
<option value="all">All</option>
<option selected="selected" value="8">3 on 3 Ice Hockey</option>
<option value="1">Basketball</option>
<option value="4">Billiards</option>
<option value="6">Broomball</option>
<option value="7">Dodgeball</option>
<option value="10">Field Hockey</option>
</select>
So, Even though 3 on 3 Ice Hockey should be selected, and the html says is selected, I see Basketball--which was the previous selection.
Thanks!
Ember
Try to add autocomplete="off"
<select id="sportid" name="sportid" autocomplete="off">

changes in the article display in joomla

I am trying to get all the articles that I have included to appear on the front page. I have published all of them and also enabled the Front Page column for each of them . But the problem is that one of the articles (say 'main article') occupy the entire width and the others appear side by side. I want of all them to appear taking up the entire width.
<table>
<tr><td>Main article</td></tr>
<tr><td>Sub Article1</td>
<td>Sub Article2</td>
</tr>
<tr><td>Sub Article3</td>
<td>Sub Article4</td>
</tr>
</table>
but i need them to appear as
<table>
<tr><td>Main article</td></tr>
<tr><td>Sub Article1</td></tr>
<tr><td>Sub Article2</td></tr>
<tr><td>Sub Article3</td></tr>
<tr><td>Sub Article4</td></tr>
</table>
is this question relevant and able to be understood...
Please help me out..
You need to setup this in the Menu section. Go to Menu → [Menu where your Front Page assigned]
Than choose menu thread, that response to your Front Page and in it's setup set number of columns to 1 or 0. Thats may help.