Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [create-product]

Denotes questions related to creating a product in magento

0
votes
1answer
23 views

Auto-expand subcategories in product form

I have a category with subcategories, and I want to have the subcategory visible from the beginning, when the user opens the category selector. Currently, the user has to click the arrow next to the ...
0
votes
1answer
52 views

Magento 2 : When creating a product - Cannot add or update a child row: a foreign key constraint fails?

When creating a product, it throws this error SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`vbm`.`catalog_product_entity`, ...
0
votes
0answers
41 views

Cannot see products on homepage

I did the following: Logged into Admin Created a simple product Added a product list widget to the home page Reloaded cache ... And I cannot see my product displayed on the homepage.
2
votes
0answers
95 views

Magento REST API Cannot add products (Nonce and Invalid attribute SKU)

I'm new to Magento REST APIs. I've been trying to POST a product to my Magento store through Postman. OAuth 1.0 is authorized and I've checked it by updating a product and getting product details ...
0
votes
1answer
38 views

$product->save() taking 4 seconds to save one simple product in magento 2.1.3

I have below code with Image Upload which is working fine...but it takes 4 seconds to save one simple product....my store have more than 25000 products. It takes more than 4/5 hrs to create/update the ...
0
votes
1answer
235 views

Create virtual product programmatically

I'm using magento v2.5.5 to develop an extension, in this extension i have to generate virtual product with non manageble stock (infinite stock), how to do this programmatically, my virtual product ...
0
votes
0answers
192 views

How to update multiple tier price for product in magento2?

I have created custom Api to create product with tier price . Here i am adding json request for tier price "tier_prices": [ { "customer_group_id": 0, ...
2
votes
2answers
815 views

Update product visibility Magento2

I am creating a product programmatically, trying to set the visibility with below code $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $product = $objectManager->create('\...
0
votes
0answers
85 views

Create virtual product with custom options and dynamic price programmatically

How to create a virtual product programmatically and add custom option to it? And how to set the product price dynamic ?
0
votes
1answer
147 views

Magento 2 Programatically create a product on the checkout_cart_product_add_after event

I'm currently working on a module that adds specific products to the cart when the customer adds a normal product. I created an observer for the checkout_cart_product_add_after. The user will select a ...
1
vote
1answer
110 views

Add stock data on product programatically in Magento 2

I want to add stock data on a product but it doesn't work. In my function, I have a product created by : $product = $objectManager->create('Magento\Catalog\Model\Product'); Then, I set some data ...
1
vote
0answers
162 views

Magento2 create downloadable product into an iteration

i am trying to create downloadable products programmatically. The product data are saved into a xml file. The downloadable data are PDFs and not URLs. When only one xml file is into the data folder, ...
0
votes
1answer
127 views

add product programmatically magento 2: Undefined property: stdClass::$reference

I went to the backend of magento I added a reference attribute for product, then I executed the script Programmatically to add product I put: $_product->setName($product_data->_source->name);...
0
votes
1answer
3k views

Add product programmatically magento 2: Unique constraint violation found

I added this script to add several products, but it appears this error: Unique constraint violation found $countallproduct = count($allproduct); for ($item = 1; $item < $...
0
votes
2answers
889 views

Create Configurable Products in Magento 2 Programmatically

How to Create Configurable Products Programmatically in Magento 2? can anyone tell me about the solution to how to do this? Thanks
0
votes
3answers
2k views

Cannot add or update a child row: a foreign key constraint fails when creating product

I have the following code to create a product, but when I try to do it it throws me this exception: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint ...
1
vote
2answers
310 views

Magento 2 : Error while adding product programatically On Observer Event `catalog_product_save_after`

I am trying to add product programmatically on catalog_product_save_after observer. Basically what i try to achieve is create a Duplicate Sample product of current product if PRODUCT-SKU-sample does ...
1
vote
2answers
231 views

Magento 2.1.5 How to create Module which can use Eav functionalities (addAttribute in my case)

I want to make module that creates magento products from xml file. So I have module with command php bin/magento LCB:import path/to/xml. It loads xml file with custom attributes which need to be ...
3
votes
5answers
9k views

Magento 2 - Create product programmatically with different store view values

I have created this custom import module that will create products and set different values for each store view. The problem is, when I save a single attribute for the product on a store view, all the ...
1
vote
1answer
122 views

Magento2: Product created from front-end is not adding to cart,it results “We can't add this item to your shopping cart right now.”

However the sample products are adding in cart,this is problem with products that has been added programmatically. Below is the code I am using to create the product programmatically. $objectManager =...
3
votes
1answer
68 views

_save_after triggered before saving the product data in database

Intro: I'm a Python(Django) developer who is working at a company where we use Magento in the backend to sell products on our website. I'm not really experienced in Magento. We are using Magento ...
1
vote
1answer
2k views

Magento2 Create simple Product programmatically only works once

I have the following in our helper: public function __construct( \Magento\Framework\App\Helper\Context $context, \Magento\Catalog\Model\ResourceModel\Product\Collection $productCollection, ...
1
vote
1answer
1k views

Create product using SOAP API and JSON input

I need to create product with SOAP API and JSON, here is my JSON input: {"sku":"tsett","name":"TEST","weight":"3.0000","qty":"18.0000","brand":"sample","category_ids":["107","108","109"],"pirce":"...
0
votes
2answers
2k views

“Invalid value for 'attribute'” (of type Yes/No) when creating product programmatically

When creating a product programmatically using the method described here, what format does the value need to be in for a Yes/No attribute type? (note: my attribute is global) So far I have tried the ...
0
votes
1answer
193 views

How to add product picture, in order to create bundle product programmatically

I need to create function that is creating bundle product, I already created my function and it works great, I mean its creating the bundle product for me, my problem is how can I add product's image, ...
0
votes
1answer
3k views

Add custom field (checkbox) in Products Create/Edit page in General Tab in Admin

I want to add a new checkbox labeled as "Featured" in create/edit products page in Magento Admin. This determines if a product is a featured product or not. These are my requirements : Add "...
1
vote
1answer
609 views

admin create product, custom attribute validation limit to choose number between

I have custom product attribute called Donation, I created it by Catelog->Attribute->Manage-Attribute Add New Attribute. Their is no problem, Its working fine, But I need to add validation ...