• Welcome to KonaKart Community Forum. Please login or sign up.
 

Quantity Parameter On Product Page

Started by ugwhite, July 12, 2007, 03:23:29 pm

Previous topic - Next topic

ugwhite

Hello,

First, I want to thank for your hard work on putting together Konakart.  It is great.

I am wanting to add a qty field on the product page, so customers can put in the qty they want on the product page.  Is there a parameter that I can pass which will add the qty to the shopping cart.  Currently it only adds 1 to the shopping cart.  I have tried using the parameter "quantity", but it would not work.  I know you can adjust the qty on the shopping cart page, but I also need it on the product page.

Thank You,
Marcus

paolo

Thanks Marcus,

A few words of praise always guarantees a quick reply :)

If I understand correctly, your user is looking at the product details and wants to add the product to the cart, but to set the quantity in the product details page.

The Struts action that gets called is the is the AddToCartSubmitAction . If you take a look at the source code of that action class, you'll see that the quantity is hard coded to 1. When a user clicks the AddToCart button in the product details window, a form is submitted (the AddToCartForm.java) which is used by AddToCartSubmitAction to pick out the attributes that were submitted.

What we need to do is to add a quantity attribute to the AddToCartForm. Set the quantity from the ProductDetailsBody.jsp and pick it up in the struts action. This is a relatively minor customization that we could do for you and just ship you the 3 modified files OR if you are comfortable with the explantion and compiling Java etc. you could try yourself. I think you just have one missing bit (the source code of the AddToCartForm which I can send to you).

Let me know how you would like to proceed.

Thanks,

Paolo

ugwhite

Thank you for the quick response.

If you could just send me the source code of the AddToCartForm.  I believe I can do the rest.

Thank You,
Marcus

paolo

Hi Marcus,

I've attached the code. Please let me know if you have any problems.

Actually the fact that we haven't put the source code of the forms in the download package is an oversight on our part. We'll fix it for the next release.

-Paolo