Author Topic: Product stock and dropdown box issues  (Read 10547 times)

Offline jetman

  • Newbie
  • *
  • Posts: 17
  • Karma: +3/-0
    • View Profile
Product stock and dropdown box issues
« on: September 25, 2017, 03:30:25 PM »
php 7.0.23
litespeed
AbanteCart v.1.2.11

Error Log:
2017-09-25 12:04:07 - warning: AbanteCart core v.1.2.11 current() expects parameter 1 to be array, integer given in <b>/home/xx/public_html/extensions/countrytheme/storefront/view/countrytheme/template/form/selectbox.tpl</b> on line <b>6</b>

The selectbox.tpl here is the same as the latest default.

Message Manager:

Form Field #option18 Issue
Message status:
warning
Date:
09/25/2017 12:04:07 PM
Number of repetitions:
26
Abnormal situation. All options of required field "option[18]" are disabled.


Issue #1

When a product has options and these options become out of stock, the storefront continues to show the dropdown box and add to cart button, causing the above messages. Both Stock Checkout in the product and checkout options are set to no. See attachment admin.png for the settings and storefront_1.png for the storefront. The availability shows the correct "No Longer Available" which leads to issue #2.

Issue #2

If I disable the options, oddly the availability changes to "Out of Stock" from "No Longer Available" and the Cart button changes to "Out of Stock." Both the store default and product Out Of Stock Status are set to "No Longer Available." See attachment issue_2.png


Thank you for all the fixes in 1.2.11 and all your hard work,

Jason
« Last Edit: September 26, 2017, 06:12:53 AM by jetman »

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 6144
  • Karma: +284/-2
    • View Profile
Re: Product stock and dropdown box issues
« Reply #1 on: September 26, 2017, 02:10:16 AM »
Hello, Jason.

Is this fresh install of 1.2.11 or upgrade from 1.2.10 to 1.2.11?

Offline jetman

  • Newbie
  • *
  • Posts: 17
  • Karma: +3/-0
    • View Profile
Re: Product stock and dropdown box issues
« Reply #2 on: September 26, 2017, 02:12:42 AM »
Hello Basara,

Yes, it is an upgrade from 1.2.10, no errors from the upgrade process
« Last Edit: September 26, 2017, 02:16:04 AM by jetman »

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 6144
  • Karma: +284/-2
    • View Profile
Re: Product stock and dropdown box issues
« Reply #3 on: September 26, 2017, 02:15:41 AM »
First you need to make sure all files upgraded.
This is very easy to do with any compare files software some even support ftp.
Here you can download 1.2.11 source https://github.com/abantecart/abantecart-src/releases

Offline jetman

  • Newbie
  • *
  • Posts: 17
  • Karma: +3/-0
    • View Profile
Re: Product stock and dropdown box issues
« Reply #4 on: September 26, 2017, 02:59:28 AM »
Hello Basara,

I ran diff and it doesn't show anything of real interest (config.php, .htaccess, .js files, photos, and extensions). I also cleared the cache on AbanteCart without luck.

Any other ideas?

Jason

Offline jetman

  • Newbie
  • *
  • Posts: 17
  • Karma: +3/-0
    • View Profile
Re: Product stock and dropdown box issues
« Reply #5 on: September 26, 2017, 03:38:35 AM »
I removed my theme from the equation, by switching to the default and I got the same problem.

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 6144
  • Karma: +284/-2
    • View Profile
Re: Product stock and dropdown box issues
« Reply #6 on: September 26, 2017, 04:35:39 AM »
Do you have any third party extensions which do something with options or product page?

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2174
  • Karma: +345/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Product stock and dropdown box issues
« Reply #7 on: September 26, 2017, 04:38:21 AM »
Hello.
We foresaw issues related to changes in the stock statuses of the product and made a diagram that clarifies the logic.
https://drive.google.com/file/d/0B8BvfNyXjUpdWi0yNEVaMVc4cWc/view?usp=sharing
Please check you product stock status with it.

Problem is in stock tracking and product quantity for option values.

You can regulate it via admin product page (stock checkout,track stock and quantity fields) and the same in product options.
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline jetman

  • Newbie
  • *
  • Posts: 17
  • Karma: +3/-0
    • View Profile
Re: Product stock and dropdown box issues
« Reply #8 on: September 26, 2017, 05:21:47 AM »
Basara: nope, I tried disable all the third party extensions to make sure, with no change.

Hello abolabo,

Thank you for the diagram.

On line 147 in storefront/model/catalog/product.php
-$query = $this->db->query("SELECT pov.quantity AS quantity
+$query = $this->db->query("SELECT pov.quantity AS quantity, pov.subtract AS subtract

$notrack_qnt was always set to 0. This fixes the "add to cart" button, but it still shows the wrong label of "Out of Stock." Also, I am still getting the two messages in the original post. I have to do some more poking around the code.

Jason


Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2174
  • Karma: +345/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Product stock and dropdown box issues
« Reply #9 on: September 26, 2017, 05:34:44 AM »
Can you post your settings here?
i mean checkout_stock, stock tracking(subtract) and qnty for each product option values
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline jetman

  • Newbie
  • *
  • Posts: 17
  • Karma: +3/-0
    • View Profile
Re: Product stock and dropdown box issues
« Reply #10 on: September 26, 2017, 05:47:37 AM »
Main settings:
config_stock_checkout = 0
config_nostock_autodisable = 0

Product settings:
Track Stock = 1
Quantity = 0
Minimum Quantity = 0
Maximum Quantity = 0
Stock Checkout = 0

Options:
Option Type: selectbox
Status=1
Required=1
-> Option Values:
Default=1
Quantity=0
Track Stock=1
Price Modifier=0.00
Modify Price By=$

I did have these settings in the above admin.png attachment.

Please let me know if you need anything else.

Thank you,

Jason



« Last Edit: September 26, 2017, 06:19:40 AM by jetman »

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2174
  • Karma: +345/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Product stock and dropdown box issues
« Reply #11 on: September 26, 2017, 06:57:50 AM »
well.. all correctly.

-> Option Values:
Quantity=0
Track Stock=1
and
Stock Checkout = 0

that's means you have no product on stock and you do now allow purchase when qnty <= 0
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

 

Powered by SMFPacks Social Login Mod