Magento ürün ekleme yöntemi

0 Cevap php

Thanks in advance for helping solve my issue.
in product save in magento this code not save the products. please find the solution of this problem:

<?php 
define('MAGENTO_MAGE_LOCATION','/home/admin/domains/public_html/importcsv1/app/Mage.php');
error_reporting(E_ALL);
require_once MAGENTO_MAGE_LOCATION;
$client = new Zend_XmlRpc_Client('http:www.examole.com/importcsv1/index.php/api/xmlrpc/');
$session = $client->call('login', array('aazi', 'asdfjsdf'));

Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

$product = Mage::getModel('catalog/product'); 

$product->setSku("12");
$product->setName("test name of the product");
$product->setWebsiteIDs(array('1'));
$product->setTypeId('simple');
$product->setPrice("111");
$product->setInprice("222");
$product->setDescription("test description of the product");
$product->setShort_description("test short description of the product");
$product->setQty("11");
$product->setWeight("1.1"); 
$product->setCategoryIds(array(4));

try {
    $product->save();
    echo "<br>yes save new product insert into magento";
} catch (Exception $e) { 
    var_dump("NO new insert product save");
}

Herhangi biri bana bu sorunu çözmek için yardımcı olabilir misiniz?

0 Cevap