Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

The quantity is not working


Guest

Recommended Posts

Posted

hi,

 

i have setup a new e shop and i am traing to order mor then 1 product , it doesnt consider the quantity that i whant, it alwas take 1 product eath order.

 

can any body tell me what can be rong here.

 

http://eshop.mvdiving.nl/

 

there is one product you can ply with it .

 

thanks for the help.

 

ori

Posted

Yes there is a way you need to use the contribution that allows for the Qty.

Take a look at these see wh ich one would work for you if you need help PM me. :P

 

Add qty box

Posted

i have installed the Quantity Box in Product Listing v1.0 and there are problems with it.

 

what is the defernce bitwin the all 3 of them, i will tray to install the Quantity Box in New Products v1.0 as well ans see how it will work.

there are some problem with it, i can do only one product evry order, and i think itsa abit limit the costumers.

 

ori

Posted

i am traying to install the Quantity Box in New Products v1.0

 

 

 

find:

<a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $new_products['products_id'], 'NONSSL') . '">' . tep_image_button('button_in_cart.gif') . '</a>

 

it doesnt exist ,

 

ori

Posted

I couldn't get it to work either

 

I have the quantity box in place but no matter what # you typ ein the box and click buy now it always shows only 1 item added. :angry:

Posted

hi,

 

in the shopping_cart.php there is a description off all the products that the costumer whant to buy, there i can see the qty. box for more then one product each bay.

you can see the pic http://www.mvdiving.nl/shopping_cart.jpg

 

i would like to make a change in this page so the qty. will work, if somone new where i need to change and what i will very happy

 

thanks

 

ori

Posted

Hi,

 

I've installed and tried all of contribution module for "Quantity box in product listing".. but none work...

(by Acheron, agiftco.com and Aaron Hiatt)

 

The error is: no quantity added to the cart...

 

Anybody had the same problem and got rid of them? Pls share ur experience...

Posted
Hi,

 

I've installed and tried all of contribution module for "Quantity box in product listing".. but none work...

(by Acheron, agiftco.com and Aaron Hiatt)

 

The error is: no quantity added to the cart...

 

Anybody had the same problem and got rid of them? Pls share ur experience...

Now I know for sure my mod for the product listing works. Seems your problem lies elsewhere. :/ Unfortunately, b/c of all the changes made to that file, I wasn't able to include install instructions for the 2nd half of the mod but rather only a replacement file.

 

Now I do know that one of the previous versions (can't recall which) by another author doesn't work at all. The author didn't make any modifications to application_top for the quantity so it would never change. If you make the changes in application_top, his version should work as well.

Posted

Finally, I can figure out the problem...Just a little bit change and adapt the code with my snapshot... :P

 

Now, I am looking for additional feature for quantity box, ie. up-down button, so that my customer doesn't need to write down number of the product but only click up or down to increase/decrease the quantity...

 

Anybody has an idea for this feature?

Posted
Finally, I can figure out the problem...Just a little bit change and adapt the code with my snapshot... :P

 

Now, I am looking for additional feature for quantity box, ie. up-down button, so that my customer doesn't need to write down number of the product but only click up or down to increase/decrease the quantity...

 

Anybody has an idea for this feature?

Sure. Either replace the text box with a pulldown menu or use JS to create some incrementing buttons. The quantity box is just a standard HTML form element so it can be replaced with anything you could normally use within a form.

Posted

Hi Acheron,

 

Thx for ur advice...

 

I have javascript code for up-down button below:

 

<form>
<input type=text name=amount value=1>
<input type=button value="up" onClick="javascript:this.form.amount.value++;">
<input type=button value="down" onClick="javascript:this.form.amount.value--;">
</form>

 

I suppose to modify the code above so that it can work properly on product_listing.php, at this part:

 

          case 'PRODUCT_LIST_BUY_NOW':
           $lc_align = 'right';
           $lc_text = tep_draw_form('buy_now', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id='. $listing['products_id']), 'POST') . '<table cellSpacing="0" cellPadding="0" width="100%"><tr><td align="right" width="25%">' . tep_draw_input_field('buyqty', '1', 'size=2 maxlength=2') . '</td><td align="center" width="75%" valign="absmiddle">' . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART, 'align=absmiddle') . '</td></tr></table></form>';
           break;

 

Sorry if this sounds to be stupid question for u, what function should i write to make the button? :(

 

I have tried tep_draw_input_button ... not work.. Is there any reference where I can get all information related to osCommerce coding?

 

Dudi

Posted

No such thing as a stupid question IMHO as long as people are willing to learn. :)

 

Here you go (under the assumption you are using mine, otherwise you may have to change field names)

 

In /catalog/includes/modules/product_listing.php ...

 

FIND:

 

tep_draw_input_field('buyqty', '1', 'size=2 maxlength=2') .

 

CHANGE TO:

 

tep_draw_input_field('buyqty', '1', 'size=2 maxlength=2') . '<input type=button value="up" onClick="javascript:this.form.buyqty.value++;"><input type=button value="down" onClick="javascript:this.form.buyqty.value--;">' .

Posted

or the simple copy/paste replacement solution. hehe

 

         case 'PRODUCT_LIST_BUY_NOW':
          $lc_align = 'right';
          $lc_text = tep_draw_form('buy_now', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id='. $listing['products_id']), 'POST') . '<table cellSpacing="0" cellPadding="0" width="100%"><tr><td align="right" width="25%">' . tep_draw_input_field('buyqty', '1', 'size=2 maxlength=2') . '<input type=button value="up" onClick="javascript:this.form.buyqty.value++;"><input type=button value="down" onClick="javascript:this.form.buyqty.value--;"></td><td align="center" width="75%" valign="absmiddle">' . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART, 'align=absmiddle') . '</td></tr></table></form>';
          break;

Posted

Thanks Acheron ....

 

It works perfectly like I wanted !!! U are so great ...

 

Just a small question (again) :P , what if I want to use up-down arrow image instead of button?...

 

can I write like this:

 

'<input type=image value="arrowup" onClick="javascript:this.form.buyqty.value++;"><input type=image value="arrowdown" onClick="javascript:this.form.buyqty.value--;">' .

 

:rolleyes:

Posted

Hi Acheron,

 

I got it work out with the code below:

 

case 'PRODUCT_LIST_BUY_NOW':
         $lc_align = 'right';
         $lc_text = tep_draw_form('buy_now', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id='. $listing['products_id']), 'POST') . '<table cellSpacing="0" cellPadding="0" width="100%"><tr><td align="right" width="25%">' . tep_draw_input_field('buyqty', '1', 'size=2 maxlength=2') .  '<td align="right" width="5">'.tep_image_submit('arrow_up.gif', IMAGE_ARROW_UP, 'onClick="javascript:this.form.buyqty.value++;"') .tep_image_submit('arrow_down.gif', IMAGE_ARROW_DOWN, 'onClick="javascript:this.form.buyqty.value--;"') .'</td></td><td align="center" width="75%" valign="absmiddle">' . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART, 'align=absmiddle') . '</td></tr></table></form>';
         break;

 

But it doesn't work exactly like I want. Using tep_image_submit will always bring customer to the shopping_cart directly before they click buy_now button.

 

Can u suggest me better method?

 

Thx

Posted

Images will always act as submit buttons when used as inputs on forms. Instead, you need to use this:

 

<a href="#" onClick="javascript:document.buy_now.buyqty.value++;"><img border="0" src="images/arrow_up.gif" alt="Add"></a><a href="#" onClick="javascript:document.buy_now.buyqty.value--;"><img border="0" src="images/arrow_down.gif" alt="Subtract"></a>

 

So it would look like this:

 

case 'PRODUCT_LIST_BUY_NOW':
? ? ? ? $lc_align = 'right';
? ? ? ? $lc_text = tep_draw_form('buy_now', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id='. $listing['products_id']), 'POST') . '<table cellSpacing="0" cellPadding="0" width="100%"><tr><td align="right" width="25%">' . tep_draw_input_field('buyqty', '1', 'size=2 maxlength=2') . ?'<td align="right" width="5"><a href="#" onClick="javascript:document.buy_now.buyqty.value++;"><img border="0" src="images/arrow_up.gif" alt="Add"></a><a href="#" onClick="javascript:document.buy_now.buyqty.value--;"><img border="0" src="images/arrow_down.gif" alt="Subtract"></a></td></td><td align="center" width="75%" valign="absmiddle">' . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART, 'align=absmiddle') . '</td></tr></table></form>';
? ? ? ? break;

 

(pretty sure I didn't make any typos with the quotes but if you get an error, that'll be it)

 

Should all be good now. :)

Posted

Hi Acheron,

 

The code doesn't work with me :(

 

It doesn't increase/decrease the quantity ...

 

Seems to me this code>

 

onClick="javascript:document.buy_now.buyqty.value--;"

 

Doesn't connect with 'buy now' form....

 

:unsure:

Posted
Hi Acheron,

 

The code doesn't work with me :(

 

It doesn't increase/decrease the quantity ...

 

Seems to me this code>

 

onClick="javascript:document.buy_now.buyqty.value--;"

 

Doesn't connect with 'buy now' form....

 

:unsure:

Yeah I realized that when I tested it. For the time being, you can use styles for the buttons though. ;) At least that way you can set button size, bg color, text color, etc. I'll take a look at the img tags tomorrow when I get time.

Posted

Hi again Acheron..

 

Is there any reference for 'tep_image' usage?

 

I see in some part of osC code, there are: tep_image(....)

 

I try to use it (instead of tep_image_submit) but still doesnt work with this up-down arrow...

 

Do u have better idea?

 

:unsure:

Posted
Hi again Acheron..

 

Is there any reference for 'tep_image' usage?

 

I see in some part of osC code, there are: tep_image(....)

 

I try to use it (instead of tep_image_submit) but still doesnt work with this up-down arrow...

 

Do u have better idea?

 

:unsure:

tep_image_button($image, $alt = '', $parameters = '')

 

is what I typically use for buttons but I haven't had a chance to play around with it this evening.

Posted

Hi Acheron..

 

Hopefully u still willing to share ur knowledge here..

 

I am still stuck with this up-down button. I tried to modify the javascript part, but always ended with browser js error message "document.buy_now.buyqty.value++ is nul or no object"...

 

Is there any possibility to make image link with other tag instead of using this <a href...> ??

 

Does anybody else can help me on this issue ?? pleasee... :unsure:

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...