|
Hi…
Today I found this extensions (I cant believe I never saw it before and I am trying to make a membership module).
I downloaded it and changed the public statement in grid.php. Renamed the community folder to local folder and also in xml of the module (dont know if this is needed but I like to have it clean - so local means to me that I am doing my changes there).
Uploaded all to server, had an error about updating mysql table (already existed) but on the next load everything is doing ok. I even create the order and shipment without a problem.
But after creating an invoice I get an errors. I need to say this module is really old code and there need to be lots of changes. However, I succesfuly made a changes to be able to change customer group after certain number of orders.
- in admin - customer - customer group - add rule to change group after 3 orders - I check order state as Complete only
- in Model/Rule/Type/NumOrders.php change the function code:
protected function _getCustomerOrderCount(Mage_Customer_Model_Customer $customer, Mage_Sales_Model_Order $order) { if (isset($this->_customerId) && $this->_customerId == $customer->getId()) { return $this->_orderCount; } $orders = Mage::getModel(\'sales/order\')->getCollection() ->addFieldToFilter(\'status\', \'complete\') ->addFieldToFilter(\'customer_id\', $customer->getId()); $this->_orderCount = $orders->count(); return $this->_orderCount; }
and it worked. I had error in admin:
a:5:{i:0;s:160:\"Cannot send headers; headers already sent in /app/code/local/Netzarbeiter/GroupSwitcher/Model/Rule/Type/NumOrders.php, line 75\";i:1;s:1467:\"#0 lib/Zend/Controller/Response/Abstract.php(148):
but customer group is changed!!!
There is a quite a lot of work to change all of this but I think it is doable for anything you need. Lets do it here together
|