We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [programmatically]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
65 views

Create order for Customer Group

Let's say I want to send my best customers a free sticker. I have all my best customers in a group aptly named Best Customers. Are there any extensions or programatic ways to create an order of one ...
0
votes
0answers
145 views

Create a category programatically in frontend don't work

I have tried for hours to create programatically a new category under the root category. My code so far: $parentCategory = Mage::getModel('catalog/category') ->load(Mage::app() ->...
2
votes
1answer
2k views

saving new category programmatically with setPath

Now this is the sort of problem I would help others with but I am flummoxed. I am creating new categories in an import routine, e.g. $this->magObject = Mage::getModel("catalog/category"); $this-&...
4
votes
1answer
5k views

Programmatically adding images to products

I am trying to create a system which automatically creates a configurable product and creates and associates simple products to it. It is all working well but a lot of the simple products will be ...
2
votes
1answer
1k views

How to add particular product into cart programmatically at admin side

Many a times you have heard or seen about how to add particular product into shopping cart programmatically at frontend side. But I want to do the same at admin side. Suppose, I have product 'SLR ...
1
vote
0answers
443 views

Programmatically login customer is not working with Associate to Website as “Main website"

I am trying to login a customer using email id and password. Please check my below code: public function customerlogin($email,$password) { $session = Mage::getSingleton('customer/session'); ...
11
votes
2answers
2k views

Magento create order programmatically with paypal payment method

Currently we have two magento independent websites. One is behaving as storefront and other as back end. User can place the order at front end. So same order I am trying to create programmatically ...
0
votes
2answers
9k views

How to programmatically edit a customer account outside Magento directory?

I am using magento customer session outside magento. I have added section to signup and login from outside. But I dont know how to edit the customer accounts from outside magento. This code, I used ...
1
vote
0answers
541 views

Programatically create order with Authorize.net payment method, already authorized [closed]

In short my question is How can I programatically create an 'Authorize Only' order for Authorize.net for an order that is already authorized? I am trying to programatically create orders which have ...
1
vote
1answer
511 views

Link Grouped Parent/Children With Default Quantity set

I have been looking into programmatically attaching children to their parent (grouped) products, but with the default quantity set as well. There seems to be little to no information on how to do more ...
2
votes
3answers
2k views

How to create/update bulk of products at a time programmatically

In the following code I have written to create a single simple product at a time, but I want to make a bulk creation of products at a time, can anyone help me in doing this? Mage::app('default')->...
1
vote
1answer
740 views

Creating Users Programmatically for multiple sites

I am looking to assign imported customers programmatically to another site and store within a multisite. However, each time I attempt to manually set the website id it errors out claiming that it ...
0
votes
1answer
3k views

Calculate tax programmatically in magento for some customers

my products price are inclusive of 12.5% tax so if my customer has tax excempt then he should not pay 12.5% instead he should pay 2%. tax excempt:- if my customer produce c form then he is ...
2
votes
0answers
795 views

Programatically generate order with custom order#

I'm using the code available here to generate orders programmatically (importing from an older in-house system) and its actually working quite well. I've made some changes to check/create customers as ...
3
votes
1answer
790 views

Programmatically create a Smart Category Rules

I was following this guide from inchoo for programmatically creating 50+ categories, but then I discovered this Enterprise feature, “Smart Category Rules”, and would like to use this approach instead. ...
4
votes
3answers
2k views

Create simple product programatically in magento2

I have created simple product using following code.almost its working fine, but I'm not able assign product to websites. Actually I have created two websites. I want to assign product to particular ...
1
vote
3answers
364 views

Copy a product's attributes value to another attribute?

I want to copy a product's attribute (weight) to another atribute (general_weight). I found this: Create an script at magento root update.php and put the below code : <?php require_once "app/...
1
vote
2answers
5k views

Create invoice programmatically and capture online not working while running from cron

I'm currently facing a weird result with my script when running it by cron. This script is creating the invoice and capture the amount online. if($order->canInvoice()) { $invoice = Mage::...
15
votes
4answers
4k views

Adding multiple items with different attributes to cart programmatically

I'm making a bulk add to cart system. Please note : i want it to works for simple products with with custom options -> Where custom option are like color(red , green , blue) or Size(Xl, M , S) ...
0
votes
1answer
3k views

How can assign multiple categories to product programatically

I Have a multiple categories for products . I want to assign these categories to specific products programtically . Here is my code to run now. $categories = Mage::getModel('catalog/category')->...
1
vote
1answer
302 views

Adding a custom attribute to magento backend category pages on second category levels

I am trying to display a custom attribute in the backend of magento on the category pages where the category levels are 2nd level. I found an tutorial online which enabled me to add a custom ...
1
vote
1answer
509 views

Static block not visible under admin panel->cms->static blocks

I want to add a static block programmatically. The way I'm trying to do that is next: I created file data-upgrade-1.0.0-1.0.1.php (there were none other files except data-install...) inside setup ...
2
votes
0answers
264 views

Delete all orders and quotes of customers that do not exist anymore

On our testing environment we are constantly creating new customers and also (mass) removing them again, currently only having 12 customers. Now after a while our sales_flat_order (5038 rows) and ...
2
votes
1answer
5k views

How to make add a customer attribute in Magento Programmatically

$installer = $this; $installer->startSetup(); $installer->addAttribute('customer','badge', array( 'label' => 'Badge', 'type' => 'text', //...
1
vote
2answers
3k views

Updating prices for products using a .csv programmatically

My question more broad at the beginning but I will go more into detail later. I have around 3000 products where I have the Skus and prices in a .csv file. Now the prices changed recently and I would ...
1
vote
1answer
204 views

Programmatically create attribute of type select and options

I am having following category structure. Category 1 Category 2 Category 3 - Category 3.1 - Category 3.1.1 - Category 3.1.2 - Category 3.1.3 - Category 3.1.4 ...
1
vote
1answer
1k views

Magento API to import external data into Magento database

Are there Magento API to import massive external data (products) from a third-party application into Magento database programmatically? If they exist, what are they and how can I find them? Since I am ...
1
vote
1answer
641 views

How do I turn on template and block hints programmatically?

I know how to do it via system->configuration->Developer and on other sites people have mentioned doing it by setting template_path_hints to 1 in the config files. I would have tried to copy ...
2
votes
1answer
2k views

Create invoice and shipment in magento via cron based on store view and order age

I am looking for help setting up a cron job that will look at all orders in all store views that have a status of "pending" created in the past X minutes and create an invoice and a shipment for those ...
0
votes
2answers
1k views

Programmatically create new orders from multiple existing orders

I would like to programmatically create new orders from existing orders by their id and send new order confirmations by mail. The new orders need to contain all the information the old ones had (Items,...
1
vote
1answer
1k views

how to apply catalog price rules in magento by observer?

i need to create price rule by programmatically with help of Observer and i want to know that which event call for this
3
votes
1answer
888 views

Create invoice again which was deleted programmatically

I had deleted an invoice programmatically by using the following code: $invoice = Mage::getModel('sales/order_invoice')->load(97); $invoice->delete(); Now I need Invoice Button to invoice ...
0
votes
2answers
1k views

Error while trying to programatically create flat category

Using Magento 1.9.0.1 I am trying to programmatically create categories using a data upgrade script with the flat categories option turned on. This first category I want to create is a new root ...
1
vote
1answer
311 views

Grouped Product vs Downloadable Product (or simple product)

Ive got an issue where grouped products are not being recognized as the same thing as the downloadable product being added to the cart which makes different cart items instead of just increasing the ...
3
votes
3answers
5k views

Programmatically duplicated product not getting displayed in frontend

I use the following script (inside a controller - action for now) for duplicating a product programatically. public function createAction(){ $data = $this->getRequest()->getParams(); $...
1
vote
3answers
2k views

Magento does not save billing city programmatically

I have an external application and I have to update the billing and shipping details of an existing order. The problem is that the billing city doesn't get saved with the rest of the data. I'm using ...
0
votes
1answer
832 views

Delete store view programmatically

I'm using Magento 1.7.0.2 How can I delete store view by id programmatically?
2
votes
3answers
2k views

Delete products from order programmatically

I use Magento CE 1.8.1.0 and I have developed a php script that can delete a product from an order. After the product is deleted the value of the order is the same. How can I reduce the order value ...
2
votes
1answer
9k views

Change shipping and billing address from order programmatically

How can i change shipping and billing adress from order programmatically? I tried this but don't work. $shippingAddress = Mage::getModel('sales/order_address') ->setFirstname("value") ->...
3
votes
2answers
2k views

Add to cart the same product with different configurations

I'm working on a Magento product configurator. In one page, you are able to configurate multiple file, then add to cart. Let's say, we want to add to cart the same product twice but with 2 different ...
1
vote
2answers
7k views

Programmatically add items to cart and assign to guest user

I got the code working for creating quote object and quote item object, and I'm able to create quote successfully which I could confirm it by checking the database, I also created cookie named front-...
2
votes
4answers
8k views

How to get invoice from order item

Is it possible to get the invoice from an order item? To be more specific: I'm iterating the order ItemsCollection and if the order-item has been invoiced $item->getStatusId() == ...
1
vote
2answers
143 views

How to issue “programmatic” solutions in Magento?

Using Community Edition 1.7.0.2 I found a solution for modifying a customer's password outside of issuing password reset emails. $write = Mage::getSingleton('core/resource')->getConnection('...
2
votes
1answer
2k views

Products not showing in frontend

I am programmatically importing a list of products in Magento 1.8.1.0. Although the products are enabled they are not showing in the frontend pages (searches, list, ...). This are my product ...
0
votes
1answer
122 views

Call to a member function log() on a non-object [closed]

I wrote code like this... <?php class SmashingMagazine_LogProductUpdate_Model_Observer { public function logUpdate(varien_Event_Observer $observer) { $product=$observer->...
1
vote
1answer
3k views

Add product to wishlist programmatically not working

I am trying to add products from the admin create order screen straight into the users wishlist programmatically however it doesn't seem to be working. $quote = Mage::getSingleton('adminhtml/...
22
votes
1answer
13k views

How to add a foreign key to a table programmatically?

I am trying to add a set of new tables and I'm trying to add a foreign key to link these tables. I have looked online to try and find some information about addForeignKey() but cannot find anything. ...
1
vote
1answer
2k views

How to Create Customer Group and Product Attribute with Script / Programmatic of type drop down and having values as customer name?

I want to create attribute through script of drop down type. in Drop down i want to display Customer Name of particular group. and also want to create customer group with script how its possible? ...
1
vote
1answer
2k views

Resources to create grouped product programmatically?

I searched the web. But was unable to find any proper guide to create grouped product programmatically. Can anyone provide proper guide for this? Links to web posts, books, pdf and any other online ...