private static function getItems($langs, $shoppergroups) { require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'mini.php'; require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'image.php'; require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'com_virtuemart_helper.php'; $from = JRequest::getInt('from', 0); $to = JRequest::getInt('to', (int) OPCXmlExport::$config->product_count); $db = JFactory::getDBO(); $lang = 'en_gb'; //$q = 'select * from #__virtuemart_products as p inner join #__virtuemart_products_'.$lang.' as l on p.virtuemart_product_id = l.virtuemart_product_id and p.published = 1'; $iter = 400; $rounds = 0; $rounds++; $q = 'select virtuemart_product_id from #__virtuemart_products as p'; // order by virtuemart_product_id asc '; if (!((empty($from) || $from == 1) && $to == OPCXmlExport::$config->product_count)) { $q .= ' limit ' . $from . ', ' . $to; } //$ito =$is+$iter; //$q .= ' limit '.$is.', '.$ito; //echo $q.'<br />'; /* SELECT * FROM `rg6ma_virtuemart_product_prices` WHERE `virtuemart_product_id` = "68" AND ( `virtuemart_shoppergroup_id` ="1" OR `virtuemart_shoppergroup_id` IS NULL OR `virtuemart_shoppergroup_id`="0") AND ( (`product_price_publish_up` IS NULL OR `product_price_publish_up` = "0000-00-00 00:00:00" OR `product_price_publish_up` <= "2014-03-24 15:09:57" ) AND (`product_price_publish_down` IS NULL OR `product_price_publish_down` = "0000-00-00 00:00:00" OR product_price_publish_down >= "2014-03-24 15:09:57" ) ) AND( (`price_quantity_start` IS NULL OR `price_quantity_start`="0" OR `price_quantity_start` <= 1) AND (`price_quantity_end` IS NULL OR `price_quantity_end`="0" OR `price_quantity_end` >= 1) ) */ $db->setQuery($q); //echo '3:'.round(memory_get_usage(FALSE)/1024/1024).'Mb<br />'; //$products = $db->loadObjectList(); //$products = $db->loadResultArray(); $products = $db->loadAssocList(); //echo '4:'.round(memory_get_usage(FALSE)/1024/1024).'Mb<br />'; if (empty($products)) { return true; } foreach ($products as $n => $row) { $product_id = $row['virtuemart_product_id']; //$product_id = $row->virtuemart_product_id; //echo '3:'.round(memory_get_usage(FALSE)/1024/1024).'Mb<br />'; $productModel = OPCmini::getModel('product'); $product = self::getProduct($productModel, $shoppergroups, $langs, $product_id, true, true, false); //echo '4:'.round(memory_get_usage(FALSE)/1024).'Kb<br />'; if (empty($product)) { echo 'x '; continue; } $vm1 = array(); OPCXmlExport::addItem($product, $vm1); } if ($to >= OPCXmlExport::$config->product_count) { return true; } return false; }