Programatically create product not showing in catalog product grid
I created a product using below script :
$product = Mage::getModel('catalog/product');
$product->setStoreId(1);
$product->setWebsiteIds(array(1));
$product->setTypeId('simple');
$product->addData(array(
'name' => 'Custom Name',
'attribute_set_id' => $product->getDefaultAttributeSetId(),
'status' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED,
'visibility' => Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE, // because I don't want to show on frontend
'weight' => 1,
'sku' => 'custom123',
'tax_class_id' => 0,
'description' => 'desciption',
'short_description' => 'short desciption',
'stock_data' => array(
'manage_stock' => 1,
'qty' => 999,
'is_in_stock' => 1
),
));
$product->save();
Above script create a row in database tablecatalog_product_entity
but this product not showing in magento catalog product grid.
What do I do for showing product only in magento backend?
magento-1.9 product
bumped to the homepage by Community♦ 10 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
|
show 2 more comments
I created a product using below script :
$product = Mage::getModel('catalog/product');
$product->setStoreId(1);
$product->setWebsiteIds(array(1));
$product->setTypeId('simple');
$product->addData(array(
'name' => 'Custom Name',
'attribute_set_id' => $product->getDefaultAttributeSetId(),
'status' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED,
'visibility' => Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE, // because I don't want to show on frontend
'weight' => 1,
'sku' => 'custom123',
'tax_class_id' => 0,
'description' => 'desciption',
'short_description' => 'short desciption',
'stock_data' => array(
'manage_stock' => 1,
'qty' => 999,
'is_in_stock' => 1
),
));
$product->save();
Above script create a row in database tablecatalog_product_entity
but this product not showing in magento catalog product grid.
What do I do for showing product only in magento backend?
magento-1.9 product
bumped to the homepage by Community♦ 10 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Try after reindexing
– Manikandan
May 6 '16 at 6:30
I am having same problem and its not working even after Reindexing.
– Shashank Kumrawat
May 6 '16 at 6:33
use this sample product creation code and try whether it's displaying or not Refer this link - inchoo.net/magento/programming-magento/…
– Manikandan
May 6 '16 at 6:35
I have tried that also still it does not shown any product in GRID , although an product has been created in database.
– Shashank Kumrawat
May 6 '16 at 6:39
i think the tax class or some thing not added correctly. i will update an answer try that. it may help you
– Manikandan
May 6 '16 at 6:46
|
show 2 more comments
I created a product using below script :
$product = Mage::getModel('catalog/product');
$product->setStoreId(1);
$product->setWebsiteIds(array(1));
$product->setTypeId('simple');
$product->addData(array(
'name' => 'Custom Name',
'attribute_set_id' => $product->getDefaultAttributeSetId(),
'status' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED,
'visibility' => Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE, // because I don't want to show on frontend
'weight' => 1,
'sku' => 'custom123',
'tax_class_id' => 0,
'description' => 'desciption',
'short_description' => 'short desciption',
'stock_data' => array(
'manage_stock' => 1,
'qty' => 999,
'is_in_stock' => 1
),
));
$product->save();
Above script create a row in database tablecatalog_product_entity
but this product not showing in magento catalog product grid.
What do I do for showing product only in magento backend?
magento-1.9 product
I created a product using below script :
$product = Mage::getModel('catalog/product');
$product->setStoreId(1);
$product->setWebsiteIds(array(1));
$product->setTypeId('simple');
$product->addData(array(
'name' => 'Custom Name',
'attribute_set_id' => $product->getDefaultAttributeSetId(),
'status' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED,
'visibility' => Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE, // because I don't want to show on frontend
'weight' => 1,
'sku' => 'custom123',
'tax_class_id' => 0,
'description' => 'desciption',
'short_description' => 'short desciption',
'stock_data' => array(
'manage_stock' => 1,
'qty' => 999,
'is_in_stock' => 1
),
));
$product->save();
Above script create a row in database tablecatalog_product_entity
but this product not showing in magento catalog product grid.
What do I do for showing product only in magento backend?
magento-1.9 product
magento-1.9 product
asked May 6 '16 at 6:07
Vinaya MaheshwariVinaya Maheshwari
1,16211846
1,16211846
bumped to the homepage by Community♦ 10 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 10 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Try after reindexing
– Manikandan
May 6 '16 at 6:30
I am having same problem and its not working even after Reindexing.
– Shashank Kumrawat
May 6 '16 at 6:33
use this sample product creation code and try whether it's displaying or not Refer this link - inchoo.net/magento/programming-magento/…
– Manikandan
May 6 '16 at 6:35
I have tried that also still it does not shown any product in GRID , although an product has been created in database.
– Shashank Kumrawat
May 6 '16 at 6:39
i think the tax class or some thing not added correctly. i will update an answer try that. it may help you
– Manikandan
May 6 '16 at 6:46
|
show 2 more comments
Try after reindexing
– Manikandan
May 6 '16 at 6:30
I am having same problem and its not working even after Reindexing.
– Shashank Kumrawat
May 6 '16 at 6:33
use this sample product creation code and try whether it's displaying or not Refer this link - inchoo.net/magento/programming-magento/…
– Manikandan
May 6 '16 at 6:35
I have tried that also still it does not shown any product in GRID , although an product has been created in database.
– Shashank Kumrawat
May 6 '16 at 6:39
i think the tax class or some thing not added correctly. i will update an answer try that. it may help you
– Manikandan
May 6 '16 at 6:46
Try after reindexing
– Manikandan
May 6 '16 at 6:30
Try after reindexing
– Manikandan
May 6 '16 at 6:30
I am having same problem and its not working even after Reindexing.
– Shashank Kumrawat
May 6 '16 at 6:33
I am having same problem and its not working even after Reindexing.
– Shashank Kumrawat
May 6 '16 at 6:33
use this sample product creation code and try whether it's displaying or not Refer this link - inchoo.net/magento/programming-magento/…
– Manikandan
May 6 '16 at 6:35
use this sample product creation code and try whether it's displaying or not Refer this link - inchoo.net/magento/programming-magento/…
– Manikandan
May 6 '16 at 6:35
I have tried that also still it does not shown any product in GRID , although an product has been created in database.
– Shashank Kumrawat
May 6 '16 at 6:39
I have tried that also still it does not shown any product in GRID , although an product has been created in database.
– Shashank Kumrawat
May 6 '16 at 6:39
i think the tax class or some thing not added correctly. i will update an answer try that. it may help you
– Manikandan
May 6 '16 at 6:46
i think the tax class or some thing not added correctly. i will update an answer try that. it may help you
– Manikandan
May 6 '16 at 6:46
|
show 2 more comments
1 Answer
1
active
oldest
votes
By missing of some required field, product doesn't show up in the backend.
Your products are showing in the database, so try to do the following:
Go to catalog -> manage products. Your current url will look like:
[yoursite.com]/index.php/admin/catalog_product/index/key/[your_key]/
Change this url to [yoursite.com]/index.php/admin/catalog_product/edit/id/[product_id]/key/[your_key]/
You can find the product ids in the database. When you enter this url, you can edit the product and check/edit product attributes, like tax class, status, etc and make sure alle required attributes are set.
I have refer to this answer
I tried it before, but not working for me.
– Vinaya Maheshwari
May 6 '16 at 6:49
do you have the product id?
– Manikandan
May 6 '16 at 6:50
In database tablecatalog_product_entity
I found a new row, when run above script.
– Vinaya Maheshwari
May 6 '16 at 6:52
did you get the product id from the database?
– Manikandan
May 6 '16 at 6:53
when I set this product visibilty ascatalog, search
then it showing in frontend search page, but not showing in backend grid.
– Vinaya Maheshwari
May 6 '16 at 6:53
|
show 3 more comments
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f114188%2fprogramatically-create-product-not-showing-in-catalog-product-grid%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
By missing of some required field, product doesn't show up in the backend.
Your products are showing in the database, so try to do the following:
Go to catalog -> manage products. Your current url will look like:
[yoursite.com]/index.php/admin/catalog_product/index/key/[your_key]/
Change this url to [yoursite.com]/index.php/admin/catalog_product/edit/id/[product_id]/key/[your_key]/
You can find the product ids in the database. When you enter this url, you can edit the product and check/edit product attributes, like tax class, status, etc and make sure alle required attributes are set.
I have refer to this answer
I tried it before, but not working for me.
– Vinaya Maheshwari
May 6 '16 at 6:49
do you have the product id?
– Manikandan
May 6 '16 at 6:50
In database tablecatalog_product_entity
I found a new row, when run above script.
– Vinaya Maheshwari
May 6 '16 at 6:52
did you get the product id from the database?
– Manikandan
May 6 '16 at 6:53
when I set this product visibilty ascatalog, search
then it showing in frontend search page, but not showing in backend grid.
– Vinaya Maheshwari
May 6 '16 at 6:53
|
show 3 more comments
By missing of some required field, product doesn't show up in the backend.
Your products are showing in the database, so try to do the following:
Go to catalog -> manage products. Your current url will look like:
[yoursite.com]/index.php/admin/catalog_product/index/key/[your_key]/
Change this url to [yoursite.com]/index.php/admin/catalog_product/edit/id/[product_id]/key/[your_key]/
You can find the product ids in the database. When you enter this url, you can edit the product and check/edit product attributes, like tax class, status, etc and make sure alle required attributes are set.
I have refer to this answer
I tried it before, but not working for me.
– Vinaya Maheshwari
May 6 '16 at 6:49
do you have the product id?
– Manikandan
May 6 '16 at 6:50
In database tablecatalog_product_entity
I found a new row, when run above script.
– Vinaya Maheshwari
May 6 '16 at 6:52
did you get the product id from the database?
– Manikandan
May 6 '16 at 6:53
when I set this product visibilty ascatalog, search
then it showing in frontend search page, but not showing in backend grid.
– Vinaya Maheshwari
May 6 '16 at 6:53
|
show 3 more comments
By missing of some required field, product doesn't show up in the backend.
Your products are showing in the database, so try to do the following:
Go to catalog -> manage products. Your current url will look like:
[yoursite.com]/index.php/admin/catalog_product/index/key/[your_key]/
Change this url to [yoursite.com]/index.php/admin/catalog_product/edit/id/[product_id]/key/[your_key]/
You can find the product ids in the database. When you enter this url, you can edit the product and check/edit product attributes, like tax class, status, etc and make sure alle required attributes are set.
I have refer to this answer
By missing of some required field, product doesn't show up in the backend.
Your products are showing in the database, so try to do the following:
Go to catalog -> manage products. Your current url will look like:
[yoursite.com]/index.php/admin/catalog_product/index/key/[your_key]/
Change this url to [yoursite.com]/index.php/admin/catalog_product/edit/id/[product_id]/key/[your_key]/
You can find the product ids in the database. When you enter this url, you can edit the product and check/edit product attributes, like tax class, status, etc and make sure alle required attributes are set.
I have refer to this answer
edited May 23 '17 at 12:37
Community♦
1
1
answered May 6 '16 at 6:48
ManikandanManikandan
750721
750721
I tried it before, but not working for me.
– Vinaya Maheshwari
May 6 '16 at 6:49
do you have the product id?
– Manikandan
May 6 '16 at 6:50
In database tablecatalog_product_entity
I found a new row, when run above script.
– Vinaya Maheshwari
May 6 '16 at 6:52
did you get the product id from the database?
– Manikandan
May 6 '16 at 6:53
when I set this product visibilty ascatalog, search
then it showing in frontend search page, but not showing in backend grid.
– Vinaya Maheshwari
May 6 '16 at 6:53
|
show 3 more comments
I tried it before, but not working for me.
– Vinaya Maheshwari
May 6 '16 at 6:49
do you have the product id?
– Manikandan
May 6 '16 at 6:50
In database tablecatalog_product_entity
I found a new row, when run above script.
– Vinaya Maheshwari
May 6 '16 at 6:52
did you get the product id from the database?
– Manikandan
May 6 '16 at 6:53
when I set this product visibilty ascatalog, search
then it showing in frontend search page, but not showing in backend grid.
– Vinaya Maheshwari
May 6 '16 at 6:53
I tried it before, but not working for me.
– Vinaya Maheshwari
May 6 '16 at 6:49
I tried it before, but not working for me.
– Vinaya Maheshwari
May 6 '16 at 6:49
do you have the product id?
– Manikandan
May 6 '16 at 6:50
do you have the product id?
– Manikandan
May 6 '16 at 6:50
In database table
catalog_product_entity
I found a new row, when run above script.– Vinaya Maheshwari
May 6 '16 at 6:52
In database table
catalog_product_entity
I found a new row, when run above script.– Vinaya Maheshwari
May 6 '16 at 6:52
did you get the product id from the database?
– Manikandan
May 6 '16 at 6:53
did you get the product id from the database?
– Manikandan
May 6 '16 at 6:53
when I set this product visibilty as
catalog, search
then it showing in frontend search page, but not showing in backend grid.– Vinaya Maheshwari
May 6 '16 at 6:53
when I set this product visibilty as
catalog, search
then it showing in frontend search page, but not showing in backend grid.– Vinaya Maheshwari
May 6 '16 at 6:53
|
show 3 more comments
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f114188%2fprogramatically-create-product-not-showing-in-catalog-product-grid%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Try after reindexing
– Manikandan
May 6 '16 at 6:30
I am having same problem and its not working even after Reindexing.
– Shashank Kumrawat
May 6 '16 at 6:33
use this sample product creation code and try whether it's displaying or not Refer this link - inchoo.net/magento/programming-magento/…
– Manikandan
May 6 '16 at 6:35
I have tried that also still it does not shown any product in GRID , although an product has been created in database.
– Shashank Kumrawat
May 6 '16 at 6:39
i think the tax class or some thing not added correctly. i will update an answer try that. it may help you
– Manikandan
May 6 '16 at 6:46