• Resolved jakobneander

    (@jakobneander)


    I have recently helped friends upgrade from Jigoshop 1 to Jigoshop e-Commerce, and have had a lot of problems with the migration. I’m slowly working through the issuses, but one I can’t seem to fix is product list in admin not showing stock. I see this if statement:

    if ($this->options->get(‘products.manage_stock’, ‘yes’) !== ‘yes’) {
    unset($columns[‘stock’]);
    }

    But products.manage_stock doesn’t seem to be yes no matter what I change, but 1? Is this a bug, or some setting I can’t find or something that went wrong in the migration?

Viewing 6 replies - 1 through 6 (of 6 total)
  • You can change those to “1” – It will be fixed in the next update.
    Sorry for the inconvenience.

    Thread Starter jakobneander

    (@jakobneander)

    I tested the new version, and while it now says 1, it’s still not showing up.

    It seems
    $this->options->get(‘products.manage_stock’, ‘1’); returns a bool, but you’re comparing it to a string ‘1’?

    Well, PHP does not use strict types, so this is kinda true, and it should return true – I’ve contacted the Core Development Dept. and they will look into it – it should work, nonetheless.

    Thread Starter jakobneander

    (@jakobneander)

    Hmm, what? PHP sure has strict comparison, when using ===

    https://php.net/manual/en/types.comparisons.php

    Or am I misunderstanding something?

    Yes, there has been a misunderstanding. The fact something HAS strict type comparison does not mean it USES strict types – that’s, actually, not the same. Up until PHP7, there was no way to actually declare the type of a variable, so $variable = 1 would return true for any of the below:

    $variable == 1
    $variable == true
    $variable == '1'
    Thread Starter jakobneander

    (@jakobneander)

    Okay, but this is PHP7 I am using, and the fact is that gettype($this->options->get(‘products.manage_stock’, ‘1’)); returns “boolean” and the strict comparison to “1” fails. I have to change it to != for it to work.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Stock not visible in Products list’ is closed to new replies.