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 [programmatically]

Denotes questions related to making changes to the Magento platform programmatically, rather than via the admin interface.

2
votes
1answer
18 views

Magento 2 - Create or change customer to set customerID

Is there a way to create a customer programmatically and set the customer ID? Or is there a way to change it afterwards? We are getting customer data from a central system in csv format and would ...
2
votes
1answer
21 views

Magento programmatically refresh statistics. - Magento1

How to refresh statistics programmatically in Magento 1?
0
votes
2answers
35 views

Login by email without password

I would login by email only , without password. I have Read these two Posts but it not works for me. Programmatically login a user https://blog.ancud.de/home/-/blogs/magento-how-to-login-a I use ...
1
vote
0answers
21 views

Magento 2.2.6: Programatically updating product custom options

I am working on custom script to update product custom options. $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $_product = $objectManager->create('Magento\Catalog\Api\...
0
votes
0answers
11 views

How to edit category in Magento 1 using PHP using path (Not ID)

I need to be able to revise Magento 1 categories externally. When products are created using Magmi it creates the category, during the process, I store the path used to create the category. I want to ...
0
votes
0answers
22 views

How to add bundled product to cart programmatically in Magento 1.9?

I am trying to add the bundled product to cart programmatically, Still, I didn't get any solution. I have tried to add the configurable product to cart, That is working fine. this is the code I have ...
0
votes
1answer
53 views

setPrice() not working

I want to change the price of a particular product via a module but it is not working. I have searched and found a lot of solutions but none is working for me. I'm relatively new to Magento, I'm ...
1
vote
0answers
35 views

How to speed up creating orders programmatically in Magento 2?

I have a script that creates orders in Magento 2. <?php /** * ExtendedRma Helper */ namespace Company\Module\Helper; class CreateOrder extends \Magento\Framework\App\Helper\AbstractHelper { ...
0
votes
0answers
59 views

Magento 2: Create Customer Attribute in Custom Save Controller

I have a custom module with a custom form in admin. On this form save action, I want to create customer attribute programmatically with the data fetched from the custom form. How can I do it. ...
0
votes
1answer
68 views

Programmatically Add Products to Store View?

We have a multi-store with a bunch of products. For certain categories in specific store views, I'd like to set all products to be in a particular store. Advice on how to achieve this would be ...
0
votes
1answer
88 views

Magento 2: Login user programmatically showing wrong default header message “Default welcome msg!” instead of showing “Welcome, user!”

When you login to Magento 2.2.6 programmatically with code below, header show default message "Default welcome msg!" instead of "Welcome, user!" // Load customer session $customerSession = $...
0
votes
3answers
37 views

How to programmatically create multiple CMS pages at once?

I am working in Magento 2 and I am needing to create multiple CMS pages all at one time. I am trying to set up an Install script to do this all at once. Every tutorial and search that I look up shows ...
1
vote
0answers
79 views

Magento 2.2.5: Add, Update and Delete existing products Custom Options

I am working on updating custom options of an existing product programatically when admin click product save button - I have done below code to full fil my desire - app/code/Namespace/Module/etc/...
0
votes
1answer
182 views

How to create guest order programmatically for Guest User

I have followed Create order programmatically in Magento 2 But it is saving the customer. And When I skip customer set data and customer save then It got an error report like "Please enter ...
0
votes
1answer
58 views

Get Parent ID from SKU

<?php ini_set('display_errors', 1); error_reporting(E_ALL); $_SERVER['MAGE_IS_DEVELOPER_MODE'] = true; require_once "app/Mage.php"; Mage::app(); umask(0); try { echo('<h1>Completed ...
0
votes
0answers
39 views

Magento 2 category updated programmatically not working

from upload the CSV file trying to created&update the category, while I create the category from the below script it's working, but while I update the category with the same script does not work. ...
1
vote
2answers
440 views

How to get products name and sku and url key using sql query in magento 2?

How to get products name and sku and url key using sql query in magento 2 ?
0
votes
1answer
76 views

how to create order for guest in magento 1.9

I am trying to create an order for guest checkout programmatically. I have gone through a lot of articles. Finally, I got one stackExchange link for creating order. But In that code, they are not ...
0
votes
1answer
55 views

How to add multiple product to cart and get cart id in magento 1.9 for guest checkout?

I am trying to store multiple products to cart and getting cart id of the products list for generating order in Magento 1.9. I don't know how to create cart and order for guest checkout.
0
votes
0answers
46 views

Magento 2 : create multi-store product programatically

I'm trying to create programatically a product assign to a specific website with 2 store view, everything is working great the product is created but I have two small issues : The image set is only ...
0
votes
1answer
80 views

How to cancel Magento order programmatically

I want to change the order status to 'canceled' when payment failed. I've tried the code below but the order status gets saved as processing: $orderId = $number8; //order id $order = ...
0
votes
0answers
25 views

Actually i am facing one error while sending email programmatically magento2?

Here I am using default contact us email template from admin panel magento 2. app/code/Vendor/Module/Controller/Index/Contact.php <?php namespace Vendor\Module\Controller\Index; use ...
4
votes
2answers
265 views

How to add new item (product) into existing order programmatically in Magento 2

I have created one virtual product in my Magento2 website. Now, I want to add it programmatically to the existing customer orders on some occasions with its custom price and name. Can someone please ...
0
votes
0answers
68 views

Magento2: How to properly set actions & conditions when creating sales-rule programmatically?

I'm working on a script that creates shopping cart rules programmatically and I was wondering what is the best way to set the actions & conditions. This is what I have so far: /* @var \Magento\...
2
votes
1answer
51 views

Magento1.9 CSV generate but not download on save action

Here is my controller code :: public function saveAction() { $post_data=$this->getRequest()->getPost(); if ($post_data) { try { ...
1
vote
2answers
316 views

Add shipping method programmaticaly

I'm creating quote / order programmaticaly. But when I do this, I have an exception : (in english, "select shipping method") Magento\Framework\Exception\LocalizedException: Sélectionnez un mode ...
0
votes
1answer
19 views

Possibility of creating order programatically without quote

Has anyone checked wheter it is possible to add order programatically without creation of quote?
4
votes
0answers
51 views

Apply unique images by attribute to each sku magento 2 programmatically

How can I perform this task through a script? I already relate the configurations to the product with this segment $attributeModel = $this->objectManager->create('Magento\ConfigurableProduct\...
2
votes
1answer
57 views

Using the Mage_Sales_Model_Order_Shipment_Api create() method to create a new shipment

I am making a connector for Magento, where orders from Magento are pushed into our system, then get shipments created that need to be pulled back into Magento and converted to the right format. In ...
0
votes
0answers
37 views

Set Magento Category Custom Design Attributes Programmatically (M 1.9.3.2)

Okay I'm trying to create a Magento category and programmatically set either it's Page Layout or it's Custom Layout Update. I've tried the following because I have a Page Layout option where the ...
0
votes
3answers
1k views

Magento 2: How to add customer address programmatically?

I have succeed create customer programmatically. Now I want to add customer address to the customer, how can i do this programmatically?
0
votes
0answers
19 views

How to get product SKUs which have more than one product images through programmatically in magento1.9.2.4?

I don't know how to implement this task. I want to get product SKUs which have more than one product images through coding. Can you please help me?
0
votes
1answer
25 views

Programatically load orders of data changed in magento1.9

Can anyone help me how to load the data edited orders in magento1.9. Please help me if any one have idea about this. Thanks
0
votes
1answer
36 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
0answers
204 views

Magento 2 Add a block to a layout programatically?

public function __construct( Context $context, array $data = [] ) { parent::__construct($context, $data); $block = $this->getLayout() ->createBlock('Magento\Framework\...
0
votes
1answer
134 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
108 views

Duplicate quote on reload last quote

Recently, I needed to create an order programmaticaly. Here's my code : public function createMageOrder($orderData) { $store=$this->_storeManager->getStore(); $websiteId =...
0
votes
0answers
24 views

Renew the last quote

how can I renew the last quote made by a customer ? For now I have this : $customerId = $this->_customerSession->getCustomer()->getId(); $collection = $this->...
0
votes
0answers
25 views

Problem with adding null (?) quote programmaticaly Magento 2.2.4

recently I've faced a big issue adding quote programmaticaly. Here, 117 and 118 are created at the same moment, and that never append before, i was perfectly working until recently. Here's my full ...
0
votes
0answers
35 views

Magento 2.2.5 creating simple product programmatically, Qty value not getting saved

I am using Magento 2.2.5 creating simple product programmatically. But qty value not getting saved, In stock status of product is working fine using below code but every time Qty field is blank $...
1
vote
0answers
50 views

Update product stock with observer Magento 2

right now I need to have a sincronization between my magento products and a third party software, lets call it X, X stores all the products info, my goal is to use a observer to update a single ...
0
votes
0answers
45 views

magento 2.2.4 : Create orders programmaticaly

I want to know how to create orders programmatically. I want to create an order in the same time, add cart product when I click on by "confirm my order". I want my customer to add product to his ...
0
votes
0answers
37 views

Create orders programmatically 2.2.4

I want to know how to create orders programmatically without passing through the payment step. I know it's possible, using helper (or model, but I can't find the link): https://webkul.com/blog/...
1
vote
2answers
272 views

Magento2: How to temporarily disable “update on save” when saving products programatically?

I have a CLI command on my module that runs through the products collection & updates some of the attributes. I noticed that it's extremely slow. Each save() takes about 4-5 seconds, which is a ...
1
vote
2answers
157 views

Product custom option delete while edit product programmatically

I have added a custom option in product from the back-end. After that when I tried to update the product programmatically but Facing an issue: When I edited the product all the custom options of ...
0
votes
0answers
23 views

How to force adding product to the order

As seems my previous question is not getting any help, will have to think about a different approach to my problem. It there a way to programmatically add a single product(s) to the order just before ...
0
votes
0answers
72 views

How to set Shipping date and Invoice date of specific order programatically

I have created a script to import order programmatically and it runs successfully but only issue is I am not able to set Invoice and shipment date as my CSV it will always save the current date in ...
0
votes
0answers
90 views

Magento 2 Multiple Widget on same page issue

I created a custom widget that should display the listing of item created in grid. I'm getting a strange issue. When I add more than 1 widget on the same page all the widgets are returning same ...
0
votes
1answer
860 views

How to create order programmatically with customer email in magento 1.9

I want to place order with customer email id in magento 1.9 For this i need a script means i want to do it programmatically in php Please help asap
0
votes
2answers
2k views

How to create directory and text file and write content in file in media folder programmatically in Magento 2?

I tried to create directory and file and then put content in file programmatically but it does not work. Here is my code in sample.phtml <?php $om = \Magento\Framework\App\ObjectManager::...