Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Bootstrap Quantity Box


Recommended Posts

for quantity box on product page only need to add this line in product_info.php

echo tep_draw_input_field('cart_quantity', '1', 'maxlength="2"');

...where you want to have qty box and make changes in application_top.php

 

find:

case 'add_product' :    if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
                          $attributes = isset($HTTP_POST_VARS['id']) ? $HTTP_POST_VARS['id'] : '';
                          $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $attributes))+1, $attributes);

replace with:

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $attributes)) + $HTTP_POST_VARS['cart_quantity'], $attributes);

that's all :thumbsup:

osC 2.3.4

Link to comment
Share on other sites

  • 9 months later...
  • Replies 62
  • Created
  • Last Reply

Hey all, I've been following this thread closely and I'm preparing my site to transition to SSL

 

However, I'm having an issue with this form.... showing an insecure form in Chrome...

          $prod_list_contents .= '        <div class="col-xs-6 text-right button-listing ">' . tep_draw_form('buy_now', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id='. $listing[$x]['products_id'], $request_type), 'POST') . tep_draw_input_field('buyqty', '1', 'style="width:44px;text-align:center;"', 'tel') . ' ' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'fa fa-shopping-cart', NULL, NULL, NULL, 'btn-success btn-md') . '</form></div>';

Is it possible $request_type is not global on product_listing????

Link to comment
Share on other sites

@@greasemonkey

 

Hi Scott

 

Are you trying to switch your shop to full SSL?

Have you tried to use 'SSL' instead of $request_type?

Hi Lambros, yes... I'm trying to switch to full ssl.

 

Yes, I have tried 'SSL' in place of $request_type.... I guess that answers my own question (duh) about request_type being global.... if it's not working with SSL.

 

Is in in the wrong possition maybe???

Link to comment
Share on other sites

@@greasemonkey  Scott unfortunately I don't have time to play with it right now but the two things that I would do is to echo out $request_type to see if it is defined and if so I would then take at look at the function "tep_href_link" to see how to pass the values to it correctly.  That should get you on the right path.

 

Dan

Link to comment
Share on other sites

Just doing some more testing... and although it is "failing" at whynopadlock..... suggesting a Chrome error...

 

Testing with Chrome (I didn't have Chrome installed in any machine close to me) it seems just fine.

 

And when I view source it looks good to me????

<form name="buy_now" action="https://www.mywebsite.com/sandbox/featured_products.php?sort=5d&action=buy_now&products_id=4902" method="POST"><input type="tel" name="buyqty" value="1" style="width:44px;text-align:center;" class="form-control" /> <button type="submit" class="btn btn-success btn-md"> <span class="fa fa-shopping-cart"></span> Buy It</button></form>

Maybe I should just go with it?

 

The specific "warning" is;

 

 

Insecure <form> call.
Found on line # 398 in file: www.mywebsite.com/sandbox/featured_products.php

(Note: Chrome will show a security error for any secure page with an insecure <form> call on the page)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...