Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Can I add a quantity field in product listings


Guest

Recommended Posts

Hi Please Help

 

I am trying to add a quantity field (same as you find in the shopping cart.php)in the product listing part of the index.php file.

 

Can any tell me if this is possable or how??

 

Thanks

Tony

Link to comment
Share on other sites

Hi Please Help

 

I am trying to add a quantity field (same as you find in the shopping cart.php)in the product listing part of the index.php file.

 

Can any tell me if this is possable or how??

 

Thanks

Tony

 

Pretty simple add p.products_quantity to the product queries in index.php then edit product_listing.php in includes/modules to display.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Thanks Sam.

but I am not to good at php and I`am not where in the index.php I should add the coding?

also does p.products_quantity refer to the stock quantity. ( I need the quantity someone wants to buy)

 

In the product_listing.php file do I simply add..

 

 

case 'PRODUCT_LIST_BUYQUANTITY':

$lc_text = TABLE_HEADING_BUYQUAMTITY;

$lc_align = 'center';

break;

 

 

sorry to be a pain!!

Tony

 

Pretty simple add p.products_quantity to the product queries in index.php then edit product_listing.php in includes/modules to display.
Link to comment
Share on other sites

Try this contribution

 

5553_Qty_Product_Page

 

or do you mean stock?

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

Hi Geoffrey

 

Thanks for your help.

I have searched for 5553_Qty_Product_Page but can not find anything.

No I don`t mean stock quantity, It is the quantity to buy that I need.

 

Tony

 

 

 

 

Try this contribution

 

5553_Qty_Product_Page

 

or do you mean stock?

Link to comment
Share on other sites

Hi Just found it (5553) I will try it out later.

Thanks

 

 

Hi Geoffrey

 

Thanks for your help.

I have searched for 5553_Qty_Product_Page but can not find anything.

No I don`t mean stock quantity, It is the quantity to buy that I need.

 

Tony

Link to comment
Share on other sites

I tried that process from the Tips and Tricks, but I am getting an error when clicking to see the product info detail page. Any other thoughts on this? I'm also in need of this feature.

Link to comment
Share on other sites

Hi

 

I got an error just the same at first, but it was because I had placed the input text in the wrong place.

 

TONY

 

I tried that process from the Tips and Tricks, but I am getting an error when clicking to see the product info detail page. Any other thoughts on this? I'm also in need of this feature.
Link to comment
Share on other sites

Hi

 

I got an error just the same at first, but it was because I had placed the input text in the wrong place.

 

TONY

 

Where did you put it to make it work? I put it right where it was directed to go....within the <td> tag. Didn't look right in Homesite when I did it (not the right color).

Link to comment
Share on other sites

Hi

 

I added the code within the <td>Tags but before the code already there to try and get the box on the left of the button,

When I moved it to the end just before the </td> and after the ?> tags all worked fine.

 

Tony

Where did you put it to make it work? I put it right where it was directed to go....within the <td> tag. Didn't look right in Homesite when I did it (not the right color).
Link to comment
Share on other sites

Hi All,

 

Adding the box is no problem, but when it comes to application_top - my code looks different.

 

my code

 {$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);

 

What to look for:

$cart->add_cart($_POST['products_id'], $cart->get_quantity(tep_get_uprid($_POST['products_id'], $_POST['id']))+1, $_POST['id']);

What to replace with:

$cart->add_cart($_POST['products_id'], $cart->get_quantity(tep_get_uprid($_POST['products_id'], $_POST['id']))+$_POST['products_id'], $_POST['id']);

 

Anyone who can help with this.

I am running OSC 2.2MS2

 

Thanks

Kenneth

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...