A very common magento facebook login extension:
Belvg_FacebookFree
http://www.magentocommerce.com/magento-connect/facebook-connect-and-like-free.html?
However it is not supporting multi site, so i did some changes to extension its function.
The check existing fb id function only check the fb id if it is unique, without the current store id "where" clause
(1) Add a store_id column to database table 'belvg_facebook_customer'
(2) Add the check existence function in
/app/code/community/Belvg/FacebookFree/controllers/CustomerController.php
in around line 52
$sql = 'SELECT `customer_id`
FROM `' . $tablePrefix .
'belvg_facebook_customer`
WHERE `fb_id` = ' . $me['id'] .
'
AND `store_id` = '.$store_id.'
LIMIT 1';
Add AND `store_id` = '.$store_id.'
(3) Insert the customer id/fb id pair with store id
At around line 71,
$store_id = Mage::app()->getStore()->getStoreId(); // a new variable to save the current store_id
$sql = 'INSERT INTO `' . $tablePrefix . 'belvg_facebook_customer`
VALUES (' . $r['entity_id'] . ', ' . $me['id'] .', '.$store_id. ')';
Add one more column, the store id should be included in the insert clause.
(4) Finished!
then the same fb_id can related to differrent magneto customer Id in different store
Programming language e.g. PHP, JAVASCRIPT, coding, web developing hints and skills applying on mobile device e.g. iphone
2014/04/26
2014/04/09
CSV multi line import for multi site is missing some value in some scope
Magento's importer uses bunches to import values in all the different tables. It processes 100 rows each bunch. The split in bunches some does not make sense, for example
The following file sucks when 100rows stops before the next scope(shopnz), then this product will be in missing of shopnz scope!!
There are two options:
1) The complete Mage_ImportExport_Model_Import_Entity_Product::_saveProducts methods has to be rewritten for all to work properly.
2) The data should only be cut when it can be cut, so the Mage_ImportExport_Model_Import_Entity_Abstract::_saveValidatedBunches method should be rewritten.
At last i found a patch for 2) https://gist.github.com/paales/7934644 THe problem is described in here https://github.com/avstudnitz/AvS_FastSimpleImport/issues/69

There are two options:
1) The complete Mage_ImportExport_Model_Import_Entity_Product::_saveProducts methods has to be rewritten for all to work properly.
2) The data should only be cut when it can be cut, so the Mage_ImportExport_Model_Import_Entity_Abstract::_saveValidatedBunches method should be rewritten.
At last i found a patch for 2) https://gist.github.com/paales/7934644 THe problem is described in here https://github.com/avstudnitz/AvS_FastSimpleImport/issues/69
Mage_ImportExport_Model_Import_Entity_Abstract
protected function _saveValidatedBunches()
2014/04/04
Pop out file download message in admin grid massaction
Inside the massaction controller, e.g. Mage_Adminhtml_Sales_OrderController
By default, those print invoice options do this:
return $this->_prepareDownloadResponse(
//edit by leo - change file name
$filename.Mage::getSingleton('core/date')->date('Y-m-d_H-i-s').'.pdf', $pdf->render(),
'application/pdf'
);
But you can not just output pdf/file, csv is also ok
$data = 'your csv data';
$this->_prepareDownloadResponse('file.csv', $data, 'text/csv');
In my situation, I generate shipping label in HTML format.
As massaction action does not allow opening the action in the blank page, so i assign those html content into a html file.
$html = $block->toHtml();
$filename = 'form_'. Mage::getSingleton('core/date')->date('Y-m-d_H-i-s').'.html';
return $this->_prepareDownloadResponse($filename, $html, 'text/html');
訂閱:
文章 (Atom)