php - Getting product weight in magento -
php - Getting product weight in magento -
i'm trying create csv export script, partener cost aggregation sistem. i'm having problem extracting weight of products magento.
$show_prodweight = (@$_get['weight'] == "on") ? "on" : "off"; .... $product = mage::getmodel('catalog/product'); $product->setstoreid($storeid); $product->load($product_id); $prod_model = $product->getsku(); $prod_id = $product->getid(); $prod_name = $product->getname(); if ( $show_prodweight =="on") { $prod_weight = $product->getweight (); } else { $prod_weight == "2"; } .... print $product['prod_weight'] . $datafeed_separator . can please tell me doing wrong ?
resolved simplyfing code
$product = mage::getmodel('catalog/product'); $product->setstoreid($storeid); $product->load($product_id); $prod_model = $product->getsku(); $prod_id = $product->getid(); $prod_name = $product->getname(); $prod_weight = $product->getweight(); php magento csv
Comments
Post a Comment