Results 1 to 6 of 6

Quantity to order shown on Product detail

This is a discussion on Quantity to order shown on Product detail within the osCommerce 2.2 Modification Help forums, part of the osCommerce 2.2 Forums category; I am sure that I have seen a contribution that does this in the last few weeks but cannot find ...

      
  1. #1
    Member
    Join Date
    Dec 2002
    Posts
    92
    Rep Power
    0


    Default Quantity to order shown on Product detail

    I am sure that I have seen a contribution that does this in the last few weeks but cannot find it again.

    I want so that people can set the quantity to order at this time rather than later at checkout or from the view cart screen.

    Does anybody have any idea where it is and what it is called, please?

  2. #2
    New Member
    Join Date
    Feb 2003
    Posts
    6
    Rep Power
    0


    Default

    Hi,

    I am also looking to include a quantity on the product listing page,
    does anyone know how to add a quantity field? Or is there a contribution that does already do this?

    Help!!!

    Cheers,
    Finn

  3. #3
    Lurker
    Join Date
    Feb 2003
    Posts
    4
    Rep Power
    0


    Default

    Here you go...enjoy!!!

    Insert the following in product_info.php:

    <input type="text" name="cart_quantity" value="1" maxlength="2" size="2">

    just before:

    <input type="hidden" name="products_id" value="<?php echo $product_info_values['products_id']; ?>"><?php echo tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?>

    Then go to application_top.php and change:

    $cart->get_quantity($HTTP_POST_VARS['products_id'])+1

    To:

    $cart->get_quantity($HTTP_POST_VARS['products_id'])+($HTTP_POST_VARS['cart_quantity'])

  4. #4
    Member
    Join Date
    Dec 2002
    Posts
    92
    Rep Power
    0


    Default

    Thanks, I too found this eventually but the question that Finn asks is MUCH more complicated and has cost me more than a month, he wants to have the order quantity on the product listing page NOT just the Product Info page. I have found a way to do what he wants (listed on this site in another topic, but don't have the link handy, try your luck at search not the advanced search)) that uses "other sometimes unused" database fields but this is NOT acceptable for my situation either. My situation now on the product listing page is that whatever is entered is NOT passed and the default value of 1 is used instead and on the New Products the number entered against the last product in the list is used and the last product is added rather than the one clicked by the user. This of course is NOT acceptable, but I cannot seem to get the value passed since it is done with an href not a post.

    So any ideas??? Anyone???

  5. #5
    New Member
    Join Date
    Feb 2003
    Posts
    6
    Rep Power
    0


    Default

    Hi,

    Thanks johnnyosc and doug, your posts have really helped me!!

    I have been successful in adding the quantity to the product listing section, here is what I did:

    In application_top.php:
    Line johnny showed above, changing the line

    $cart->get_quantity($HTTP_POST_VARS['products_id'])+1

    to

    $cart->get_quantity($HTTP_POST_VARS['products_id'])+($HTTP_POST_VARS['cart_quantity'])

    do the same but in the case 'buy_now' not case 'add_product'. The line snippet should now read:

    $cart->get_quantity($HTTP_GET_VARS['products_id'])+($HTTP_POST_VARS['quantity']=='' ? 1 : $HTTP_POST_VARS['quantity'])

    I added the ? : check to make the quantity default to 1 if for some reason the quantity field was blank or not a number.

    Also in includes/modules/product_lisating.php:
    in the section case 'PRODUCT_LIST_BUY_NOW':
    this is where the html is for the buy now button, the standard a href link needs to be changed to a form. Here is the code i have used

    $lc_text = '&<form action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing_values['products_id'], 'NONSSL') . '" method="post">'. tep_image_submit('button_buy_now.gif', 'Buy Now!') . '
    <input type="text" size="2" maxlength="2" name="quantity" value="1"></input></form>&';

    Thanks again for pointing me in the right direction!! It would have taken me much longer otherwise

    Happy Coding
    Finn

  6. #6
    Member
    Join Date
    Dec 2002
    Posts
    92
    Rep Power
    0


    Default

    Nope. That still doesn't work. All I get is the default value being used, nothing is passed for the quantity. I am sure we are close, I can smell success (then again success smells sweet - I think and what I smell it like my shoes...)

Similar Threads

  1. Order detail problem
    By goaskmom in forum osCmax v1.7 Discussion
    Replies: 4
    Last Post: 02-26-2005, 07:18 AM
  2. Product Quantity on Product Listing Page
    By vinces in forum osCmax v1.7 Discussion
    Replies: 2
    Last Post: 12-10-2004, 06:32 PM
  3. Product detail in product listing
    By isummitweb in forum osCommerce 2.2 Modification Help
    Replies: 1
    Last Post: 06-05-2004, 07:50 PM
  4. Transfer order # into Paypal payment detail
    By peter in forum osCommerce 2.2 Modification Help
    Replies: 0
    Last Post: 11-21-2003, 11:48 AM
  5. Quantity to order on Special, New Products, Category ...
    By doug in forum osCommerce 2.2 Modification Help
    Replies: 0
    Last Post: 01-02-2003, 05:58 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •