This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
All breakout session presentations: | |
http://www.imagineecommerce.com/2013breakouts/ | |
Magento: Best practices for hosting | |
http://www.nexcess.net/magento-best-practices-whitepaper | |
http://info.magento.com/rs/magentocommerce/images/HostandBoastBestPracticesForMagentoHosting.pdf | |
Data Isolation and Merchandizing in a Single Magento Instance | |
http://info.magento.com/rs/magentocommerce/images/DataIsolationandMerchandizinginaSingleMagentoInstance.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
protected function _prepareCollection() | |
{ | |
$filters = $this->getRequest()->getParams(); | |
$start_date = (isset($filters['date_from'])) ? date("'Y-m-d'", strtotime($filters['date_from'])) : "'0000-00-00'"; | |
$end_date = (isset($filters['date_to'])) ? date("'Y-m-d'", strtotime($filters['date_to'])) : 'NOW()'; | |
$collection = Mage::getModel("sales/order")->getCollection(); | |
$resource = Mage::getSingleton('core/resource'); | |
$distributorTable = $resource->getTableName('PurinaPro_Groups/Distributor'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
`main_table`.`customer_id`, | |
`main_table`.`customer_firstname` AS `firstname`, | |
`main_table`.`customer_lastname` AS `lastname`, | |
`distributor`.`name` AS `distributor_name`, | |
(select COUNT(distinct MONTH(created_at)) from sales_flat_order where customer_id=main_table.customer_id and created_at between '0000-00-00' and NOW()) AS `order_months_count`, | |
(select sum(total_qty_ordered) from sales_flat_order where customer_id=main_table.customer_id and created_at between '0000-00-00' and NOW()) AS `total_qty_ordered`, | |
(select sum(base_grand_total) from sales_flat_order where customer_id=main_table.customer_id and created_at between '0000-00-00' and NOW()) AS `total_grand_total`, | |
sum(MONTH(main_table.created_at) = 1) AS `Jan_count`, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dealing With Large Collections in Magento | |
- Collections are a good thing | |
- make deailing with multiple data structure types easy: Standard and EAV | |
- Lazy loading keep database traffic to a minimum | |
- Collections have some shortcomings | |
- When dealing with a large number of customers, getting EAV data can be difficult | |
The situation: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getCsv() | |
{ | |
$csv = ''; | |
$this->_isExport = true; | |
$this->_prepareGrid(); | |
$sql = (string)$this->getCollection()->getSelect()->__toString(); | |
$db = Mage::getResourceSingleton('core/resource')->getReadConnection(); | |
$result = $db->query($sql); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get Ready for Magento Certified Developer Exam. Magento Codepool | |
http://blog.belvg.com/magento-certification-magento-codepool.html | |
Get Ready for Magento Certified Developer Exam. Magento Module Structure. | |
http://blog.belvg.com/magento-certification-module-structure.html | |
Get Ready for Magento Certified Developer Exam. The Main Magento Design Areas and More… | |
http://blog.belvg.com/get-ready-for-magento-certified-developer-exam-the-main-magento-design-areas-and-more.html | |
Get Ready for Magento Certified Developer Exam. Class Naming Conventions and Their Relationship with the Autoloader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/marketplace/affiliations/admin.py b/marketplace/affiliations/admin.py | |
index 87f3e01..f5ad40e 100644 | |
--- a/marketplace/affiliations/admin.py | |
+++ b/marketplace/affiliations/admin.py | |
@@ -10,6 +10,7 @@ class AffiliationAdmin(BaseModelAdmin): | |
search_fields = ('name',) | |
prepopulated_fields = {'slug': ('name',)} | |
list_filter = ('type', 'featured',) | |
+ raw_id_fields = ('created_by',) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from marketplace.test.settings import * | |
DEBUG=True | |
DATABASES['default']['HOST'] = 'localhost' | |
DATABASES['default']['NAME'] = 'marketplacedemo' | |
DATABASES['default']['USER'] = 'postgres' | |
code_path = os.path.expanduser('~/code') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@hosts(["mckenzie.servers.ljworld.com"]) | |
def pull_db(db_name, user_db_name=None): | |
if db_name is None: | |
exit("You must provide a database name") | |
# add username to db_name | |
if user_db_name is None: | |
user_db_name = '%s_%s' % (env.user, db_name) |