Jump to content
Latest News: (loading..)

Recommended Posts

This addon adds a quantity box to the product page. It is only compatible with the latest Community Version that uses Action files for handling the buy now button.

Share this post


Link to post
Share on other sites

Dear Jack. Wonderful and really handy. I wondered if you can tell me how to place a text like "Quantity:" before the quantity box. I think it is a bit confusing without it. Would be very grateful. Regards, Martin

Share this post


Link to post
Share on other sites

In the includes/modules/content/product_info/templates/quantity.php file, find this line

echo  tep_draw_input_field('buyqty', '1', 'size="3" maxlength="3" style="width:60px;margin-right:10px;"')   ;

and add this above it

echo MODULE_CONTENT_PI_QUANTITY_BOX_TEXT;

And in the includes/languages/English/modules/content/product_info/cm_pi_quantity.php file, add this as the last line:

const MODULE_CONTENT_PI_QUANTITY_BOX_TEXT = 'Quantity';

 

Share this post


Link to post
Share on other sites

Hello Jack, this is working great on the website... on a PC. On my android, however neither the qty box nor the buy button work although they show correctly. If I take it off and just use the stock buy now button that works on android. I am on Frozen BS3, the website for testing is https://www.artful-webdesign.com/osc234/  

Thanks for your help

Share this post


Link to post
Share on other sites

It is most likely due to some other item on the page being overlaying the button(s). Please try this (not texted). At the top of the includes/modules/content/product_info/templates/quantity.php file, add the following:

<style>
div.cm-pi-quantity-box {z-index:100;}
</style>

 

Share this post


Link to post
Share on other sites

Perfect ! Thank you ever so much, Jack. Thought I was going crazy. Could this also be adapted to the product listing pages ?

Share this post


Link to post
Share on other sites

Glad it worked. Thanks for letting me know. I'll add it to the next version.

Yes, it can be added to the product listing page but that is only useful if the products don't have attributes or if only one item is being ordered. For example, if you have 10 products showing on the page and you set the quantity for each and then click add to cart, if one of the products has an attribute then the code redirects to that page and all of the selections are lost. It will work fine if attributes don't exist for any of them. Since, I think, most sites use attributes that code change wouldn't be very useful. But maybe adding it as an option in the settings to let the shop owner decide would be a good way to do it.

Share this post


Link to post
Share on other sites

Thanks Jack, was just thinking as many products do not have options. It could behave so that if there are options it goes to the product page where there would be a qty button and for those without options just directly add the qty on the product listing page (or all-products page) and add to cart. Just an idea...

Share this post


Link to post
Share on other sites

That would be the way one would want it to work. But when the add to cart on the product listing page is clicked. it handles all of the selected items as a whole, not one at a time. So if none of them have attributes, then the whole list is passed to the shopping cart. But if one has attributes, the list is dropped and the code redirects to that one product. This is how oscommerce has worked from the beginning.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×