Post by jonagoldapple » Mon Mar 02, 2020 7:07 am

OC 3.0.3.2
PHP 7.2.10
Default theme


On any product page there is a field that allows users to enter a quantity in numbers (0-9) and then add this quantity of the viewed product to their shopping cart. Enter a number (0-9) and this works fine. Enter a letter (a-z) and the product does not show in shopping cart. So far so good, this is great and it works, BUT...

When you enter a number followed by a letter, for example "3w", the product does add to shopping cart with quantity 3 but the price is € 0.00 for that product! Yes, users can checkout for free. I discovered this when accidentally typing "3w", then tested this once again and I can actually checkout for free, only have to pay shipping.
Last edited by jonagoldapple on Tue Mar 03, 2020 12:59 am, edited 1 time in total.

Active Member

Posts

Joined
Sun Jan 26, 2020 9:46 pm

Post by sw!tch » Mon Mar 02, 2020 7:36 am

Already posted the fix in your other post - viewtopic.php?f=202&t=216384

Backup and [ learn how to recover ] before you make any changes.


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by IP_CAM » Mon Mar 02, 2020 8:59 am

Seems only to be related to OC3, as it looks. In my 'case' at
least, depending on adding letters before or/and after the Qty Value,
it either does not add anything to the cart, it only confirms adding
it on the Product Page 'confirmation line' itself, or then, it add's the
regular Qty + Price.
Ernie

Please don't send me OC Forum Personal Messages, just contact: jti@jacob.ch
---
OC 1.5.6.5 LIGHT Test Site: http://www.bigmax.ch/shop/
OC 1.5.6.5 V-PRO Test Site: http://www.openshop.li/shop/
My Github OC Site: https://github.com/IP-CAM
2'600+ FREE OC Extensions on the World's largest Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by Quino » Mon Mar 02, 2020 3:48 pm

You can also make the field a number instead of the current text:

Code: Select all

              <input type="text" name="quantity" value="{{ minimum }}" size="2" id="input-quantity" class="form-control" />

Code: Select all

             <input type="number" name="quantity" value="{{ minimum }}" size="2" id="input-quantity" class="form-control" />
and add the numbers to the ajax cart add call parameters:

Code: Select all

		data: $('#product input[type=\'text\'], #product input[type=\'hidden\'], #product input[type=\'radio\']:checked, #product input[type=\'checkbox\']:checked, #product select, #product textarea'),

Code: Select all

		data: $('#product input[type=\'number\'],#product input[type=\'text\'], #product input[type=\'hidden\'], #product input[type=\'radio\']:checked, #product input[type=\'checkbox\']:checked, #product select, #product textarea'),

New member

Posts

Joined
Fri Feb 28, 2020 1:19 am

Post by jonagoldapple » Thu Apr 09, 2020 5:01 pm

Quino wrote:
Mon Mar 02, 2020 3:48 pm
You can also make the field a number instead of the current text:

Code: Select all

              <input type="text" name="quantity" value="{{ minimum }}" size="2" id="input-quantity" class="form-control" />

Code: Select all

             <input type="number" name="quantity" value="{{ minimum }}" size="2" id="input-quantity" class="form-control" />
and add the numbers to the ajax cart add call parameters:

Code: Select all

		data: $('#product input[type=\'text\'], #product input[type=\'hidden\'], #product input[type=\'radio\']:checked, #product input[type=\'checkbox\']:checked, #product select, #product textarea'),

Code: Select all

		data: $('#product input[type=\'number\'],#product input[type=\'text\'], #product input[type=\'hidden\'], #product input[type=\'radio\']:checked, #product input[type=\'checkbox\']:checked, #product select, #product textarea'),
Can anyone please explain how this works and where to find the files to change this?
Because apparently the bug has not been fixed for me yet. Perhaps I did something wrong so I removed the changes.

Active Member

Posts

Joined
Sun Jan 26, 2020 9:46 pm
Who is online

Users browsing this forum: No registered users and 5 guests