Question: When the user clicks the "**Create an Account**" button on the login page, instead of being directed to the account creation page they are taken to the home page.

> 
> I cannot see any reason for this, this feature used to work. I can
>  only guess that it has something to do with the **SSL
>  implementation**. Does anyone have any ideas?
> 
> 
>

Answer: 
Instead of using Object Manager, use dependency structure for good practise.

```
/**
 * @var \Magento\Framework\View\Result\PageFactory
*/
protected $productFactory;

public function __construct(
    .....
    \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productFactory
    .....
)
{
    .....
    $this->productFactory = $productFactory;
    .....
}
public function execute()
{
    $product = $this->productFactory->create();
    $product->addAttributeToSelect('*')->setFlag('has_stock_status_filter', true);
    $product = $product->joinField('qty',
            'cataloginventory_stock_item',
            'qty',
            'product_id=entity_id',
            '{{table}}.stock_id=1',
            'left'
        )->joinTable('cataloginventory_stock_item', 'product_id = entity_id', ['stock_status' => 'is_in_stock'])
        ->addAttributeToSelect('stock_status')
        ->addAttributeToSort('entity_id', 'DESC')
        ->addAttributeToFilter('status',\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
        ->load();
    return $product;
}

```
**Collection stock item from Resource Model**

```
$resource = $objectManager->create('Magento\CatalogInventory\Model\ResourceModel\Stock\Item');
$select = $resource->getConnection()->select()->from($resource->getMainTable());
$stockItems = $resource->getConnection()->fetchAll($select);
foreach($stockItems as $_item){
    var_dump($_item->getData());
}

```

**if you have product object then just use following:**

```
var_dump($_product->getExtensionAttributes()->getStockItem()->getData());

```

I hope this will help