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.

0
votes
0answers
23 views

Magento 2.2 - Custom options are not saved programmatically on cart update

Initially, while adding an item to cart the custom options and other details are saved successfully to cart. When reupdating the cart with updated custom options are not saved in cart programmatically....
1
vote
1answer
25 views

How to duplicate sales rule programmatically in Magento2

Im try to duplicate some salesrule exist, i can duplicate this, but i can't use setConditionsSerialized and setActionsSerialized with getCondition and getActionCondition, its dont working use ...
0
votes
1answer
29 views

How to set List Mode(backend configuration) programmatically for category page magento 2?

Actually i want to set list/grid mode(List Mode) configuration values for category page programmatically not from magento admin backend.if anyone have any idea please guide me.
0
votes
1answer
44 views

Send Sales Order mail to multiple account Programatically

In this screenshot you can see sales order mail sending to multiple acounts . and It work good mail sending to all accounts which mention in Send Order Email Copy To This is hard code to give ...
0
votes
0answers
13 views

Coupon code being applied only to the first product in cart insead of whole cart

A coupon code is generated programmatically on a particular day. The coupon code when applied shows the correct discount amount and even the checkout shows the correct discount amount, but when the ...
0
votes
1answer
22 views

How to call Web API call inside custom module Magento 2

How can we call Web API in a custom module? I have a third party module, in which they are sending a request with API calls. I have custom functionality where I have to redirect my page to that Web ...
0
votes
0answers
16 views

How to add product qty and product price store wise progrmatically in magento 2

I want to create product progrmatically. product creating section is done, after creating the product i want to update the product qty and price store wise. I have following array which return me the ...
2
votes
2answers
43 views

How to set the category ids to a products from category path?

I want to progrmmatically create products from a xml. Ex : I am getting the product categories as like below. Default Category/Beer , Default Category/Beer /CRAFT, Default Category/Beer /CRAFT/...
1
vote
0answers
13 views

How to add category Path when creating product progrmatically in magento 2

I want to create products programatically by reading an xml file. Reading from xml, and creating product part is completed. I have no idea how to assign the products to category. This is my xml node ...
1
vote
0answers
28 views

Add multiple products in cart programatically magento 2

I am trying to add multiple products in cart programmatically. This below code is working properly but I need to set quantity dynamically. If quantity is not set that product to be skipped without ...
1
vote
1answer
40 views

How to apply Coupon on the Specific Products in Magento 2?

I want to apply the coupon on the specific product I tried: use Magento\SalesRule\Model\Rule; public function __construct( \Magento\Framework\App\Helper\Context $helpercontext, Rule $rule, )...
4
votes
1answer
41 views

How to set cms block to category in Magento 2 programmatically?

I would like to add CMS block to a category programmatically, how to achieve it?
0
votes
1answer
30 views

Only 1 product adding to order when creating orders programmatically in Magento 2

I am in a process of creating orders programatically in Magento 2. below is my code: <?php namespace Eight65media\MpowerSync\Helper; use \Magento\Framework\App\Helper\AbstractHelper; class Data ...
1
vote
0answers
23 views

Issue in pragmatically create orders in magento 2

I want to create orders pragmatically by getting the data from xml. Reading data from xml part is done. when creating order steps i am getting this error. Parse error: syntax error, unexpected '$...
0
votes
1answer
24 views

Magento 2 programmatically create cart rule with condition issue on setOperator

As per my requirement am creating the cart rule programmatically, for that i am reviewed the following code and implemented in my local public function createRule() { $price = 100; $sku = '...
0
votes
3answers
84 views

Magento 2 - How Can I Update Catalog Product Price Programmatically in Frontend and Add Product to Cart With New Price?

I create one Module and make a custom form which is display in the catalog product view page. when the customer change option from dropdown then the product price will change and also that updated ...
1
vote
1answer
30 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
32 views

Magento programmatically refresh statistics. - Magento1

How to refresh statistics programmatically in Magento 1?
0
votes
2answers
41 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
34 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
13 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
33 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
69 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
89 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
67 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
105 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
148 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
58 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
137 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
324 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
102 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
51 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
691 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
119 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
60 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
50 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
107 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
28 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 ...
5
votes
2answers
469 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
95 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
73 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
629 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
30 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
57 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
86 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 ...
1
vote
3answers
2k 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
20 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
33 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
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
0answers
263 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\...