Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

using: $product->getinfo()
 
Kerry Hatcher
Sr. Member
 
Avatar
Total Posts:  96
Joined:  2008-07-15
Macon, GA
 

What is the correct function to get the product meta data, weight, and tiered prices?

Thanks,
Kerry

some of the code of the file I’m working on:

//---------------------- GET THE PRODUCTS    
        $products Mage::getModel('catalog/product')->getCollection();
        
$products->addAttributeToFilter('sku', array('like' => 'C SB SC%')); //show only skus starting with... 
        
$products->addAttributeToFilter('status'1);//enabled
        
$products->addAttributeToFilter('visibility'4);//catalog, search
        
$products->addAttributeToSelect('*');
        
$prodIds=$products->getAllIds();
        
        
//echo 'Product filter: '.memory_get_usage(false).'<br>';
        //flush();
        
        
$product Mage::getModel('catalog/product');
        
        foreach(
$prodIds as $productId{
            
//echo '. ';
            //flush();
            //echo 'Loop start: '.memory_get_usage(false).'<br>';
            //flush();
    
            //$product = Mage::getModel('catalog/product');
            
$product->load($productId); 
            
            
$product_data = array();

            
$product_data['sku']=$product->getSku();
            
$product_data['ActivationMark']="true";
            
$product_data['Amoountinventory']="1000";
            
$product_data['WarehouseNumber']="";
            
$product_data['CategoryDescription']="Protective Gear";
            
$product_data['UPC']="";
            
$product_data['Keywords']=$product->getMetaKeywords(); //Doesn't work for KEY WORDS
            
$product_data['ParentSKUNumber']="";
            
$product_data['ColorMapping']="";
            
$product_data['DetailPageURL']="";
            
$product_data['ManfacturerPartsNumber']="";
            
$product_data['ManfacturerName']="ShuBee";
            
$product_data['ManfacturerURL']="";
            
$product_data['BrandName']="ShuBee";
            
$product_data['BrandURL']="";
            
$product_data['BrandLogoURL']="";
            
$product_data['ManfacturerWarrentyMark']="";
            
$product_data['Prop65Mark']="";
            
$product_data['CleranceMark']="";
            
$product_data['LegalDisclaimer']="";
            
$product_data['MerchantWarrenty']="";
            
$product_data['Weight']="";                           //NEED THE Weight! 
            
$product_data['SizeWidth']="";
            
$product_data['SizeLength']="";
            
$product_data['SizeHeight']="";
            
$product_data['Price']=$product->getPrice();
            
$product_data['NonTaxable']="";
            
$product_data['EWRA']="";
            
$product_data['DiscountType']="";
            
$product_data['Discount']="";
            
$product_data['DiscountDescription']="";
            
$product_data['MailinRebateURL']="";
            
$product_data['StartDate']="";
            
$product_data['EndDate']="";
            
$product_data['ShippingCharge']="";
            
$product_data['VolumeQt1']="";                            //POSSABLE? 
            
$product_data['VolumePrice1']="";
            
$product_data['VolumeShippingCharge1']="";
            
$product_data['VolumeQt2']="";
            
$product_data['VolumePrice2']="";
            
$product_data['VolumeShippingCharge2']="";            
            
$product_data['VolumeQt3']="";
            
$product_data['VolumePrice3']="";
            
$product_data['VolumeShippingCharge3']="";
            
$product_data['LimitQuantity']="";    
            
$product_data['TitleDescription']="";    
            
$product_data['LineDescription']="";    
            
$product_data['DetailDescription']="";
            
$product_data['ItemImages']=Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'catalog/product'.$product->getImage();
            
$product_data['Size-Dime']="";
            
$product_data['Type']="";
            
$product_data['Color']="";
            
$product_data['Material']="";
            
$product_data['Giftable']="";

          
            
//echo 'Product load: '.memory_get_usage(false).'<br>';
            //flush();        
          
            //get the product categories                    
            //        foreach($product->getCategoryIds() as $_categoryId){
            //$category = Mage::getModel('catalog/category')->load($_categoryId);
            //$product_data['product_type'].=$category->getName().', ';
           // }
           // $product_data['product_type']=rtrim($product_data['product_type'],', ');        

            //echo 'Category load: '.(memory_get_usage(false)).'<br>';            
            
            //sanitize data    
            
foreach($product_data as $k=>$val){
            $bad
=array('"',"\r\n","\n","\r","\t");
            
$good=array(""," "," "," ","");
            
#$product_data[$k] = '"'.str_replace($bad,$good,$val).'"';
            
$product_data[$k] str_replace($bad,$good,$val);
            
}
            

            $feed_line 
implode("\t"$product_data)."\r\n";
            
fwrite($handle$feed_line);
            
fflush($handle);
File Attachments
neweggmall.php  (File Size: 6KB - Downloads: 36)
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top