<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Adding a quantity input field to the product information page</title>
	<atom:link href="http://multimixer.gr/17/11/2010/add-a-quantity-input-field-to-your-product-info-page/feed/" rel="self" type="application/rss+xml" />
	<link>http://multimixer.gr/17/11/2010/add-a-quantity-input-field-to-your-product-info-page/</link>
	<description>lets talk about osCommerce</description>
	<lastBuildDate>Tue, 07 Apr 2020 11:18:44 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Jody</title>
		<link>http://multimixer.gr/17/11/2010/add-a-quantity-input-field-to-your-product-info-page/#comment-1826</link>
		<dc:creator>Jody</dc:creator>
		<pubDate>Tue, 17 Oct 2017 12:41:46 +0000</pubDate>
		<guid isPermaLink="false">http://multimixer.gr/?p=98#comment-1826</guid>
		<description>Hello again! is there a version of this that will work on v2.3.4 with MTS installed? Thanks.</description>
		<content:encoded><![CDATA[<p>Hello again! is there a version of this that will work on v2.3.4 with MTS installed? Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: multimixer</title>
		<link>http://multimixer.gr/17/11/2010/add-a-quantity-input-field-to-your-product-info-page/#comment-1538</link>
		<dc:creator>multimixer</dc:creator>
		<pubDate>Thu, 15 Jan 2015 09:49:37 +0000</pubDate>
		<guid isPermaLink="false">http://multimixer.gr/?p=98#comment-1538</guid>
		<description>This is not connected to the current post

You can search the osCommerce add ons ( http://addons.oscommerce.com ) for &quot;modular frontpage&quot; or take a look at Mini Template system ( http://minitemplatesystem.com ) that does what you want and much more of course</description>
		<content:encoded><![CDATA[<p>This is not connected to the current post</p>
<p>You can search the osCommerce add ons ( <a href="http://addons.oscommerce.com" rel="nofollow">http://addons.oscommerce.com</a> ) for &#8220;modular frontpage&#8221; or take a look at Mini Template system ( <a href="http://minitemplatesystem.com" rel="nofollow">http://minitemplatesystem.com</a> ) that does what you want and much more of course</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Newbye</title>
		<link>http://multimixer.gr/17/11/2010/add-a-quantity-input-field-to-your-product-info-page/#comment-1537</link>
		<dc:creator>Newbye</dc:creator>
		<pubDate>Fri, 09 Jan 2015 19:19:06 +0000</pubDate>
		<guid isPermaLink="false">http://multimixer.gr/?p=98#comment-1537</guid>
		<description>Now there is something else that I cannot figure out. How can I have the categories displayed in the middle of the page also. I mean instead of the new products, and the new products to be displayed below these categories?</description>
		<content:encoded><![CDATA[<p>Now there is something else that I cannot figure out. How can I have the categories displayed in the middle of the page also. I mean instead of the new products, and the new products to be displayed below these categories?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Newbye</title>
		<link>http://multimixer.gr/17/11/2010/add-a-quantity-input-field-to-your-product-info-page/#comment-1533</link>
		<dc:creator>Newbye</dc:creator>
		<pubDate>Fri, 09 Jan 2015 18:52:56 +0000</pubDate>
		<guid isPermaLink="false">http://multimixer.gr/?p=98#comment-1533</guid>
		<description>I managed to create the drop down list half an hour after I posted :) . I had an input field before.
But I could not be able to set the limit to the available quantity in stock without your help. I spent few hours on that with no result.
Really thank you for your help!

If anyone else needs to do the same, the code is located in the product_info.php just before this line:  

So the code is:

&lt;pre class=&quot;brush:php;&quot;&gt;
&lt;tr&gt;
&lt;?php
for ($i=0; $i&lt;$product_info[&#039;products_quantity&#039;]; $i++) {
$qty_array[] = array(&#039;id&#039; =&gt; $i+1, &#039;text&#039; =&gt; $i+1);
}
?&gt;
&lt;td align=&quot;right&quot; class=&quot;main&quot;&gt;&lt;br&gt;&lt;?php echo QUANTITY_WISH . &#039; : &#039; . tep_draw_pull_down_menu(&#039;quantity&#039;, $qty_array, 1); ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/pre&gt;



You can put it anywhere else in the product_info.php, making the drop down list to be positioned in a different location in the product page.</description>
		<content:encoded><![CDATA[<p>I managed to create the drop down list half an hour after I posted :) . I had an input field before.<br />
But I could not be able to set the limit to the available quantity in stock without your help. I spent few hours on that with no result.<br />
Really thank you for your help!</p>
<p>If anyone else needs to do the same, the code is located in the product_info.php just before this line:  </p>
<p>So the code is:</p>
<pre class="brush:php;">
<tr>
< ?php
for ($i=0; $i<$product_info['products_quantity']; $i++) {
$qty_array[] = array('id' => $i+1, 'text' => $i+1);
}
?>
<td align="right" class="main">< ?php echo QUANTITY_WISH . ' : ' . tep_draw_pull_down_menu('quantity', $qty_array, 1); ?></td>
</tr>
</pre>
<p>You can put it anywhere else in the product_info.php, making the drop down list to be positioned in a different location in the product page.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: multimixer</title>
		<link>http://multimixer.gr/17/11/2010/add-a-quantity-input-field-to-your-product-info-page/#comment-1532</link>
		<dc:creator>multimixer</dc:creator>
		<pubDate>Thu, 08 Jan 2015 09:51:35 +0000</pubDate>
		<guid isPermaLink="false">http://multimixer.gr/?p=98#comment-1532</guid>
		<description>Hello

I can see that you have already a drop down, listing quantities 1 by 1 from 1 up to some thousand - doesn&#039;t look very nice in my opinion

However, the products quantity is known in product_info.php, so you could use $product_info[&#039;products_quantity&#039;] to limit the length of the values array for the drop down, I&#039;m not sure in what way you create it exactly</description>
		<content:encoded><![CDATA[<p>Hello</p>
<p>I can see that you have already a drop down, listing quantities 1 by 1 from 1 up to some thousand &#8211; doesn&#8217;t look very nice in my opinion</p>
<p>However, the products quantity is known in product_info.php, so you could use $product_info['products_quantity'] to limit the length of the values array for the drop down, I&#8217;m not sure in what way you create it exactly</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Newbye</title>
		<link>http://multimixer.gr/17/11/2010/add-a-quantity-input-field-to-your-product-info-page/#comment-1531</link>
		<dc:creator>Newbye</dc:creator>
		<pubDate>Wed, 07 Jan 2015 21:00:15 +0000</pubDate>
		<guid isPermaLink="false">http://multimixer.gr/?p=98#comment-1531</guid>
		<description>Thank you so much for all the effort you are investing in this!
I have placed the quantity box in the product info page, but I need to have a dropdown list instead, with the maximum quantity available for selection equal to the quantity available in stock. And I give you an example why.
Let&#039;s say I have 245 items in stock and the customer wants to buy 1000 items. Since I don&#039;t want to have a box with the available quantity in stock to show to the customers, when he will checkout he will receive a message that there is not enough quantity in stock. And then we will try with 900 and will receive the same message. Then he will try with 800 and again the same message and so on, until he will insert below 245 in the shopping cart.
If you can help me with this it would be awesome!
Thank you again!</description>
		<content:encoded><![CDATA[<p>Thank you so much for all the effort you are investing in this!<br />
I have placed the quantity box in the product info page, but I need to have a dropdown list instead, with the maximum quantity available for selection equal to the quantity available in stock. And I give you an example why.<br />
Let&#8217;s say I have 245 items in stock and the customer wants to buy 1000 items. Since I don&#8217;t want to have a box with the available quantity in stock to show to the customers, when he will checkout he will receive a message that there is not enough quantity in stock. And then we will try with 900 and will receive the same message. Then he will try with 800 and again the same message and so on, until he will insert below 245 in the shopping cart.<br />
If you can help me with this it would be awesome!<br />
Thank you again!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bunhin</title>
		<link>http://multimixer.gr/17/11/2010/add-a-quantity-input-field-to-your-product-info-page/#comment-1152</link>
		<dc:creator>bunhin</dc:creator>
		<pubDate>Sat, 01 Jun 2013 01:54:26 +0000</pubDate>
		<guid isPermaLink="false">http://multimixer.gr/?p=98#comment-1152</guid>
		<description>in case customer input a number less than 1 for example 0 into the field, how do we prevent this? is there any ready function to use to validate input value in osc 2.3.3? how to implement in this added input field to prevent number less than 1 keyed into the field</description>
		<content:encoded><![CDATA[<p>in case customer input a number less than 1 for example 0 into the field, how do we prevent this? is there any ready function to use to validate input value in osc 2.3.3? how to implement in this added input field to prevent number less than 1 keyed into the field</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shelli</title>
		<link>http://multimixer.gr/17/11/2010/add-a-quantity-input-field-to-your-product-info-page/#comment-956</link>
		<dc:creator>Shelli</dc:creator>
		<pubDate>Wed, 24 Oct 2012 20:31:11 +0000</pubDate>
		<guid isPermaLink="false">http://multimixer.gr/?p=98#comment-956</guid>
		<description>Hi,

We are selling different products that have different quantities.  
Product A is easy it will work with what is already in place 1 for 1.
Product B (bottles) Will be sold in quantities of 6, 12 and 24.
I put the total single bottle quantity and the price of 1 bottle ($1) in the product page in the oscommerce online merchant and then added a quantity attribute in the products/attributes page of 6 ($6) , 12 ($12) and 24 ($24).  But when I go to my site, it says that the price of the product is (the price of a single bottle) and it gives a dropdown for 6 ($6), 12 ($12), 24 ($24).  Then if I add say one 6 pack and add to cart, it puts the price at $7.00 - so it adds the price of the attribute plus the price of the product.  Please help.

Thank you

Shelli</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>We are selling different products that have different quantities.<br />
Product A is easy it will work with what is already in place 1 for 1.<br />
Product B (bottles) Will be sold in quantities of 6, 12 and 24.<br />
I put the total single bottle quantity and the price of 1 bottle ($1) in the product page in the oscommerce online merchant and then added a quantity attribute in the products/attributes page of 6 ($6) , 12 ($12) and 24 ($24).  But when I go to my site, it says that the price of the product is (the price of a single bottle) and it gives a dropdown for 6 ($6), 12 ($12), 24 ($24).  Then if I add say one 6 pack and add to cart, it puts the price at $7.00 &#8211; so it adds the price of the attribute plus the price of the product.  Please help.</p>
<p>Thank you</p>
<p>Shelli</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: davidedp</title>
		<link>http://multimixer.gr/17/11/2010/add-a-quantity-input-field-to-your-product-info-page/#comment-938</link>
		<dc:creator>davidedp</dc:creator>
		<pubDate>Thu, 06 Sep 2012 21:02:01 +0000</pubDate>
		<guid isPermaLink="false">http://multimixer.gr/?p=98#comment-938</guid>
		<description>You are great!
I read this and immediately implemented it in combination with option type V2.3.1.
In this case the code should be something like:
                           $cart-&gt;add_cart($HTTP_POST_VARS[&#039;products_id&#039;], $cart-&gt;get_quantity(tep_get_uprid($HTTP_POST_VARS[&#039;products_id&#039;], $real_ids)) + $HTTP_POST_VARS[&#039;cart_quantity&#039;], $real_ids);

Now the question: I can I check that the field is NON empty by clicking on &quot;Add to cart&quot; button?</description>
		<content:encoded><![CDATA[<p>You are great!<br />
I read this and immediately implemented it in combination with option type V2.3.1.<br />
In this case the code should be something like:<br />
                           $cart-&gt;add_cart($HTTP_POST_VARS['products_id'], $cart-&gt;get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $real_ids)) + $HTTP_POST_VARS['cart_quantity'], $real_ids);</p>
<p>Now the question: I can I check that the field is NON empty by clicking on &#8220;Add to cart&#8221; button?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: panagiotis</title>
		<link>http://multimixer.gr/17/11/2010/add-a-quantity-input-field-to-your-product-info-page/#comment-840</link>
		<dc:creator>panagiotis</dc:creator>
		<pubDate>Fri, 09 Mar 2012 01:12:58 +0000</pubDate>
		<guid isPermaLink="false">http://multimixer.gr/?p=98#comment-840</guid>
		<description>Thanks!! Great tutorial!! I already implemented it to my site

may i add something extra to your suggestion....

insert this 
onfocus=&quot;this.value==this.defaultValue?this.value=\&#039;\&#039;:null&quot; onblur=&quot;this.value==\&#039;\&#039;?this.value=this.defaultValue:null;&quot;

so when the input field is selected number one will disappear... 

final code looks something like this:


&lt;?php echo &#039;&#039; . TEXT_ENTER_QUANTITY . &#039; &#039; . tep_draw_input_field(&#039;cart_quantity&#039;, &#039;1&#039;, &#039;onfocus=&quot;this.value==this.defaultValue?this.value=\&#039;\&#039;:null&quot; onblur=&quot;this.value==\&#039;\&#039;?this.value=this.defaultValue:null;&quot; size=&quot;5&quot; style=&quot;vertical-align:middle;&quot;&#039;) . &#039; &#039; . tep_draw_hidden_field(&#039;products_id&#039;, $product_info[&#039;products_id&#039;]) . tep_draw_button(IMAGE_BUTTON_IN_CART, &#039;cart&#039;, null, &#039;primary&#039;); ?&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks!! Great tutorial!! I already implemented it to my site</p>
<p>may i add something extra to your suggestion&#8230;.</p>
<p>insert this<br />
onfocus=&#8221;this.value==this.defaultValue?this.value=\&#8217;\':null&#8221; onblur=&#8221;this.value==\&#8217;\'?this.value=this.defaultValue:null;&#8221;</p>
<p>so when the input field is selected number one will disappear&#8230; </p>
<p>final code looks something like this:</p>
<p>&lt;?php echo &#039;&#8217; . TEXT_ENTER_QUANTITY . &#8216; &#8216; . tep_draw_input_field(&#8216;cart_quantity&#8217;, &#8217;1&#8242;, &#8216;onfocus=&#8221;this.value==this.defaultValue?this.value=\&#8217;\':null&#8221; onblur=&#8221;this.value==\&#8217;\'?this.value=this.defaultValue:null;&#8221; size=&#8221;5&#8243; style=&#8221;vertical-align:middle;&#8221;&#8216;) . &#8216; &#8216; . tep_draw_hidden_field(&#8216;products_id&#8217;, $product_info['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, &#8216;cart&#8217;, null, &#8216;primary&#8217;); ?&gt;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
