GithubHelp home page GithubHelp logo

adm_warehouse's Introduction

Multi Stock Warehouse Module for Magento1

Extends Mage_Cataloginventory to allow Magento to manage several stocks. Stocks can be assigned to one or several websites.

TODO

  • Assign qtys to stock on order placement

Facts

Compatibility

  • Magento CE 1.8 (may also work in other versions and EE, not tested)

Requirements

  • Mage_Cataloginventory

Installation

  1. Install the extension using modman or copy all the files to the according Magento directories manually.

Uninstallation

  1. Remove the files.

Usage

Install the extension and navigate to the backend menu System > Monitoring.

Support

If you have any issues with this extension, open an issue in the GitHub repository. Please provide error messages, debug information like output from the Magento error logs and the exact steps / code to reproduce the issue.

Contribution

Any contribution is highly appreciated. The best way to contribute code is to open a pull request on GitHub.

Developers

Licence

OSL - Open Software Licence 3.0

adm_warehouse's People

Contributors

vpietri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

adm_warehouse's Issues

Layout XML

It looks like you forgot to commit the adm/warehouse.xml layout file?

Bugs

I'm currently evaluating your extension, the idea seems great but the extension seems rushed and slapped together. When I first installed the extension, I tried adding a new Warehouse to test multiple inventory/stock, but got redirected to a 404 page. See below for the fixes.

Is this extension still in development? Are you using it on any Magento installation or testing it locally?


https://github.com/vpietri/ADM_Warehouse/blob/master/app/code/community/ADM/Warehouse/controllers/Adminhtml/WarehouseController.php

Add this controller action which redirects to the edit action.

public function newAction()
{
    $this->_forward('edit');
}

When you register the model in the registry, it needs to be outside the if statement. Reason being the form references this object whether it has data or not.

if ($id) {
    // Load record
    $model->load($id);

    // Check if record is loaded
    if (!$model->getId()) {
        Mage::getSingleton('adminhtml/session')->addError($this->__('This stock no longer exists.'));
        $this->_redirect('*/*/');
        return;
    }
}

Mage::register('current_stock', $model);

Bug Inventory Tab

Because you have chosen to inject (override) the product inventory tab using an observer (using XML layout updates would be better) for both new and edit actions, an error is thrown when creating a new product

A quick fix to this problem is shown below.

https://github.com/vpietri/ADM_Warehouse/blob/master/app/code/community/ADM/Warehouse/Block/Adminhtml/Catalog/Product/Edit/Tab/Inventory.php#L28

You can simply replace the getQtysByWarehouse() function with what I've written below.

public function getQtysByWarehouse()
{
    if (!$this->_item_by_warehouses instanceof ADM_Warehouse_Model_CatalogInventory_Resource_Stock_Collection)
    {
        $warehouses = Mage::getModel('cataloginventory/stock')->getCollection();

        if ($stockItem = $this->getStockItem())
        {
            foreach ($warehouses as $warehouse)
            {
                foreach ($stockItem->getStockDetails() as $stockDetail)
                {
                    if ($stockDetail['stock_id'] == $warehouse->getId())
                    {
                        $warehouse->setQty($stockDetail['qty']);
                        $warehouse->setItemId($stockDetail['item_id']);
                    }
                }
            }
        }

        $this->_item_by_warehouses = $warehouses;
    }

    return $this->_item_by_warehouses;
}

All I've done is check that a stock item can be retrieved, and skip trying to set stock details for each warehouse if it cannot. The reason for the error was due to trying to retrieve the stock item from the product, when the product hadn't even been created yet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.