Skip to main content

Questions tagged [save]

Questions related to save action, most commonly used in form submit

Filter by
Sorted by
Tagged with
0 votes
1 answer
2k views

Magento 2: Change the "URL Key" and save the category "The value specified in the URL Key field would generate a URL that already exists."

When change the "URL Key" and save the category then throw the below error. This store Migrate Magento 1.9 to Magento 2.3.5-p1 and used multi store view. Error: The value specified in the ...
2 votes
2 answers
2k views

Fastest way to load category and save programmatically in Magento 2

I want to load all collection in Magento 2 and save one by one programmatically. is there any faster way to do so. I tried below code for one category use Magento\Framework\App\Bootstrap; include('...
2 votes
1 answer
5k views

Magento 2 Add extra data to an order

I'm brand new to Magento 2 programming, although I have a number of years of PHP behind me. I need to store an id from an external system alongside an order that that system creates. I've got the ...
2 votes
1 answer
2k views

Magento 2: How to Set custom product attribute value on product save

i have created an observer, event on before product save to set custom product attribute value, here is my code. etc/adminhtml/events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www....
1 vote
1 answer
2k views

INSERT ON DUPLICATE KEY UPDATE Magento2 Error

When i tried to save the product from Admin i am getting below error SQLSTATE[42S02]: Base table or view not found: 1146 Table 'catalog_product_category_cl' doesn't exist, query was: INSERT INTO ...
3 votes
1 answer
2k views

Magento 2: How to save data in DB from admin through UI component?

I can not save the data in the database when editing the record, the data remains the same as it was before Ronis\Feedback\Api\Feedback\FeedbackInterface.php <?php namespace Ronis\Feedback\Api\...
3 votes
5 answers
7k views

How to update the attribute scope programmatically in Magento 2

I have 20 product attributes. I need to change those attributes' saving scope to "Global". How can I achieve this?
2 votes
1 answer
2k views

Magento:Save Product image from external url

I want to save a simple product programatically.I have used the following link http://inchoo.net/magento/programming-magento/programatically-manually-creating-simple-magento-product/ All fields are ...
0 votes
0 answers
12 views

Test class with collection and save

i'm trying to test if a class method is doing her job. Basically here it is. public function __construct(SaveCommand $saveCommand, SubscriptionData $entityDataFactory, ...
0 votes
1 answer
29 views

Why do some core repositories use a data model in the save function while others use a model?

I have a quick question and this could help me determine what is the good practice using the repositories. To provide an example to the question I ask in the title of this subject, I can take as ...
1 vote
2 answers
59 views

How to edit and save a Bundled Product "Bundle Items" link fields on Magento 2.4.6 PHP 8.1

I am writing a program that is checking product data and updating where required. My problem is that I can't save a Bundled Products Bundle Items linked product fields such as price, price_type, qty, ...
1 vote
2 answers
7k views

Magento 2 - Sales Orders afterSave plugin not working

I have created a plugin so that I can process the order and send to a 3rd party after it has been placed. I have hooked into the afterSave functionality and my plugin code looks like this di.xml <...
1 vote
1 answer
79 views

Admin grid form submit button not working

When I open my admin grid form and click the Save button, nothing happens, the button just displays as clicked (no network activity, no errors in console or logs, doesnt reach Index/Save.php). When I ...
0 votes
2 answers
110 views

Email already exist in db validation

I need help on to correct my implementation on validating the email if it's already exists. Anyone knows what's wrong with my code? It is not validating this part. It will save even if the email ...
0 votes
3 answers
2k views

Fatal error: Uncaught TypeError: Argument 3 passed to Mage_Catalog_Model_Resource_Abstract::_canUpdateAttribute()

I am getting an error while trying to pragmatically remove products from some categories. Error: Fatal error: Uncaught TypeError: Argument 3 passed to Mage_Catalog_Model_Resource_Abstract::...
1 vote
6 answers
16k views

"No alive nodes found in your cluster" error in magento 2.1.6 after elasticsearch

Every time I save a new product I get that error "No alive nodes found in your cluster" My version of magento is 2.1.6 and the problem appeared after installing the elasticsearch module What ...
4 votes
4 answers
963 views

How to call save method in collection instance

I was appeared Magento 2 Associate developer certification exam, in that I got the below tricky question, but I don't know the concept and answer of the question. can you have an idea regarding the ...
0 votes
1 answer
55 views

unable to save a rewrite

Im trying to save a new redirects into the urlrewrite model but it seems that save() doesn't exist in those factorys: Magento\UrlRewrite\Model\UrlRewriteFactory or Magento\UrlRewrite\Model\...
1 vote
1 answer
19 views

created bundle option into existing bundle wont save programatically

Magento 2.4.2-p1 Goal is to create a bundle option with a selection in it based on array of skus. The array has 4 skus of simples existing in the catalog, lets say: [50702640,50702240,90102870,...
1 vote
0 answers
27 views

Decoding failed: Syntax error in app/code/core/Mage/Core/Model/Config.php:1394 when saving a product

Magento 1.9 I am getting this error when I try saving a product. I checked line 1394 in Config.php and it looks like this: $obj = new $className($constructArguments); The full error is: ...
0 votes
1 answer
610 views

Magento 2 - cant enable template hints

I try to enable template hints in Stores -> Settings: Configuration -> Advanced -> Developer -> Debug But if I make my changes and save, then it reloads and the settings are reseted to the ...
0 votes
0 answers
97 views

Customer address not save programatically in magento 2

I tried to create and save customer address for a registered, logged user. My code in controller is like below. $addresss = $objectManager->get('\Magento\Customer\Model\AddressFactory'); $...
0 votes
1 answer
146 views

Incorrect integer value: '' for column `project-preprod_db`.`catalog_product_entity`.`has_options` at row 1

Running a custom import script, I'm facing this error for some products (some others are perfectly being created without this issue). Error occured on B2C product import : The product that was ...
0 votes
1 answer
535 views

Customer attributes not saving from admin

I've created custom customer attribues $attributeCodes = [ ['code' => 'customer_company' , 'label'=> 'Societe'], ['code' => 'customer_siret', 'label'=> '...
2 votes
0 answers
534 views

Magento 2 REST API Add validation for data interface payload

I have created a custom REST API to save data into my table. My table contains many fields so I am using the DataInterface structure for payload. Now I need to add a validation like as below { "...
0 votes
1 answer
284 views

Magento 2 Add additional fiels to sales_order and pass addData before save

I am doing a custom order placement based on the API data I receive, I have to introduce the new column on the sales_order table whet I have to add them before order save using addData or setNewfield, ...
2 votes
1 answer
5k views

Magento 2: How to get product old and new data on product save button in admin backend?

I am working on Admin Actions Log Extension. For the reference, I am using the link below https://amasty.com/admin-actions-log-for-magento-2.html I want to get old and new data of products while we ...
2 votes
2 answers
5k views

How to add save and continue button in ui-form in Magento 2?

I have created admin grid and form using ui component. Now I need to add save and continue button, How do I add it? Please provide me a solution
0 votes
1 answer
75 views

Getting Error on Add Item Page in Admin UI Component

I just created a Form with Ui_components, but When I go to this page, I'm getting the following error.
0 votes
1 answer
485 views

$this->productRepository->save($product) fail for bulk update with multiple attribute sets and tier pricing

I have a custom cron to update/import bulk products using a csv file. All the products have tier pricing and different attribute sets assigned. use Magento\Catalog\Api\ProductRepositoryInterface; use ...
2 votes
3 answers
661 views

How to save stock attribute value ('qty') for a product with Magento 2 objectmanager?

I've found out how to do this with other attributes. For example a custom 'location' attribute: $product = $this->objectManager->get('Magento\Catalog\Model\Product')- >load($post['id']); ...
1 vote
1 answer
221 views

An error occurred while saving the category on Magento2

when I try to save a category I get this error from the backoffice. Here is the error related to this action: Blockquote [2021-11-24 10:52:02] main.CRITICAL: DateTime::__construct(): Failed to parse ...
0 votes
2 answers
1k views

Save method is not working for products

I want to resave all products programmatically. So I am trying to use the below code to achieve it. But the save method is not working in it. I have placed the code in the root directory of my Magento ...
1 vote
2 answers
2k views

The table 'catalog_product_index_price_tmp' is full error

I faced one strange issue with product saving on Magento EE 1.14.2.4. This issue appears only when I save exactly one product, I'm able to save other products without any problems. Here is screenshot ...
2 votes
4 answers
9k views

New product attributes value cannot be saved in magento 2

I have created nearly 10 new attributes under product attributes. Its added to attribute set as well. But now, when I update the product information, the data is not getting saved. Instead, after the ...
1 vote
3 answers
5k views

Magento 2.2.5: How to get product id after product saved using plugin

I'm looking for how to get product id after product saved using plugin. I use the plugin to catch after execute() is fired. But I can't get product id no matter how I try. Here is what I've done: ...
0 votes
1 answer
874 views

Solved: Product saving issue - images - unique constraint violation found - 2.4.2-p1

We face a unique constraint violation found error when we try to save the product. When we check the attribute code '87' in the catalog_product_entity_varchar table, we see that it is the default ...
0 votes
1 answer
755 views

How can I insert multiple row at once without for loop using collection in Magento 2?

I want insert multiple record without for loop in Magento 2 my data is as follow, Array ( [0] => Array ( [path] => whatsapp_contact/whatsapp_contact_button_settings/...
0 votes
1 answer
26 views

URL key for specified store already exists while importing products through custom script

I have some of the products already added in magento admin. And now i am trying to create same name product with the use of script that time i am facing error "URL key for specified store already ...
4 votes
3 answers
2k views

Magento 2. Catalog product edit save button not working

admin/catalog/product/save button is not working anymore. I'm unable to edit/save product. No output whatsoever in var/log/* No output whatsoever in browser console No activity in browser network ...
0 votes
0 answers
187 views

Custom model save data processor DI/Reflection only working once?

I'm working on a simple FAQ widget module for a client and I seem to have run into something quite strange with the DI/Reflection cache. My problem is with the Save controller action which uses a ...
0 votes
1 answer
974 views

Magento 2 - can't save changes to product

I try to change some product info text and then save, but after it saves, the text in the backend/frontend still remains the same. There is no error showing. What can I do? Additional Information I ...
1 vote
0 answers
31 views

Unable to change or add categories

We're unable to change or add categories in the Magento 1 (1.9.2.2) backend. Upon clicking the 'Save category' button I get the following error in my console: I've traced it back to the follwing code ...
0 votes
3 answers
562 views

Problem with changing price in admin

As described in this question in Magento 2 if I insert a new product or update an existing one using only comma in price it uses it as a decimal separator. Example: if I set the price to 10,000 it ...
0 votes
2 answers
768 views

Unable to save value of customer attribute in magento2

I am trying to edit customer form data in which i have added one contact number as attribute in form. On removing the text from contact number and then saving it i am not able to save null or empty ...
2 votes
3 answers
12k views

magento 2 - How to create new object Product?

How to create new object Product ? Example: $product = new Product(); $product->sku = 'fdfds'; ... $product->save();
0 votes
2 answers
780 views

Magento Redirecting to Dashboard on Save in Back-End, Changes Lost

I have an intermittent issue that seems to happen across all of the Magento 2 sites I manage where if I'm working in the back-end and I save something (could be a content block, category, product, etc)...
2 votes
0 answers
266 views

how can I add my custom validation logic to product edit/create form?

I would like to add some custom logic when a product is saved to validate the data in the form before it is saved in the database. In order to achieve this I decided to create an after Plugin to hook ...
4 votes
2 answers
8k views

Magento 2 : Use aftersave and beforesave method

I want to add aftersave and beforesave method of Magento 2 in my model. How can I do this and which model I have to called ?
0 votes
2 answers
1k views

Magento 2 - Created new table and model - but model does not save!

I created a new table company_shipping_quote and new models by using https://mage2gen.com/. But how can I create a new object and save it so that it appears in the database? Models: Company/Shipping/...

1
2 3 4 5