Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Problem with price-break 1.11.3


ThAz

Recommended Posts

Hi there.

 

I need to modify price-break to work in product_listing.php.

 

I have moved the price/quantity table and the quantity input field, the only problem i have left is to get the buy now button to return the cart_quantity value to the shopping cart.

 

i have located the code that does this in application_top.php (~row 371).

 

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

 

how do you make it return +cart_quantity instead of +1 ?

 

Using :

OSCommerce 2.2 MS2

Apache 2.0.53

MySQL 4.1.9

PHP 5.0.3

Link to comment
Share on other sites

Im sorry for the delay in replying.

 

The guy that im modifying the webshop for don?t want the product_info.php page so the customer have to be able to select the ammount he/she would like to buy in the product_listing.php page.

 

I have got everything else working, the price box is there and the input field.

I still haven?t got the PRODUCT_LIST_BUY_NOW case in product_listing.php to buy more than 1 item.

 

If anyone have some ideas how this could be solved please reply.

Link to comment
Share on other sites

I got it working thanks to this contribution

 

If everyone else have this problem heres the solution :

 

In includes\modules\product_listing.php ~row 130.

 

case 'PRODUCT_LIST_BUY_NOW':
$lc_align = 'center';
$lc_text = tep_draw_form('buy_now' . $listing['products_id'], tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']), 'POST') . tep_draw_input_field('cart_quantity', '1', 'size=2') . tep_image_submit('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</form> ';
break;
}

 

In includes\application_top.php ~row 367.

 

      
case 'buy_now' :  if (isset($HTTP_GET_VARS['products_id'])) {
        if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {
                   tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
         } else {
        $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+(int)$HTTP_POST_VARS['cart_quantity']);
                    }
             }
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...