Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Hot answers tagged

100

follow below steps it will help you, in my module I just added fee column this will add one row in cart total called fee and also side bar in checkout page and also it added fee amount to total amount (fee static value I kept as 100) once order is placed total will be with fee and if you are logged in fronted in order view you can see fee's new row in ...


60

To load an order by increment id one would do: Mage::getModel('sales/order')->loadByIncrementId('10000001'); //use a real increment order id here To load by entity id you would just call load: Mage::getModel('sales/order')->load(24999); //use an entity id here


48

This issue must be related to the new Magento Email Queue system, that leaves orphan records on the Recipients table. If this is your issue, I send you a fix. The new Magento Email Queue system manages these two tables: core_email_queue and core_email_queue_recipients. The former one handles the email Messages, and the later one, the Recipients of these ...


47

I'll give it a shot. Let's take them one at a time: Method 1 $converter=Mage::getModel('sales/convert_order'); $shipment=$converter->toShipment($order); $converter above is loaded from the class Mage_Sales_Model_Convert_Order, which uses a core helper called copyFieldset to copy order details into a shipment object. $order has to be of type array or ...


40

According to "The Definitive Guide to Magento" [1], the order statuses are defined as follows: Pending: Pending orders are brand new orders that have not been processed. Typically, these orders need to be invoiced and shipped. Pending PayPal: Pending PayPal orders are brand new orders that have not been cleared by PayPal. [...] Processing: ...


32

Magento 2 uses Service Contracts for retrieving and saving objects. In Magento this layer is formed by Repositories, which are managers with get() and save() methods. This keeps user code away from Model calls. Don't call model methods (like load() or save() or loadByIncrementId()) directly, they are being deprecated as custom code should use the Service ...


30

TL;DR: For recurring profile - orders are generated by Magento after a notification from Paypal, taxes are stored as line-items are are charged in accordance with your store's tax rules, based on the original order. Invoices happen automatically and no action is required from the customer. There are two ways of performing 'recurring' payments via Magento: ...


30

Open your PHP Admin database (I tested on php 7) Find & click on the table called: sequence_order_1 (it is located in database itself not in the information_schema ) Click on "Operations" tab & under "AUTO_INCREMENT" edit to desired order number.


29

grand_total = current currency grand total base_grand_total = store base currency grand total


26

id = the sales_flat_order table primary key value. This is autoincremented for each order you get in your shop. It usually starts from 1 and goes up. increment id = a "user friendly" number generated prior to placing the order. It must be unique and it is used by online payment methods as reference (but not only). The increment id by default looks like this....


25

Magento does not deal well with this scenario: deleting a payment method that has been used. Your options from here are: installing the old extension again from a backup or similar adjust the payment method in the database For the second approach you can use something like UPDATE`sales_flat_order_payment` SET `method`= 'NEW_CODE' WHERE `method` = '...


23

The difference is: order_id is the internal Magento order ID order increment ID is the ID which you communicate to your customer You can easily load an order using the internal order_id: Mage::getModel('sales/order')->load($orderId); PS: If you need it, you can easily get the increment ID from a loaded order: $order->getIncrementId();


23

Go to your database from phpmyadmin, Here _1 is used for store id after tablename. Default Frontend store id is 1. if you have multi store then you have to set query for each store with table name like sequence_order_2 upto sequence_order_.* Enter below query for table sequence_order_1 is used for default store. If you have multiple store you have to set ...


22

You can call $order->getBaseTotalDue(). If this is 0, the order is fully paid.


20

Let's start with thinking about the SQL, not Magento (we'll get there later). I would write it as such (ignoring timezones for simplicity): SELECT sku,SUM(qty_ordered) FROM sales_flat_order_item WHERE created_at BETWEEN NOW()-INTERVAL 2 WEEK AND NOW() GROUP BY sku That query works (I tested). So, how would we go about writing this query in Magento? ...


20

Inchoo wrote a great article on extending the order grid. And on the Atwix blog there's an article on adding a column from a different table. The Inchoo blog post basically extends it with a custom extension. In case you're not familiar with writing your own extension I'd suggest you take a loot at Alan Storms tutorial or the one from Magento 4U. You will ...


20

As far as I know, we should use \Magento\Sales\Api\Data\OrderInterface. /** @var \Magento\Sales\Api\Data\OrderInterfaceFactory $order **/ protected $orderFactory; public function __construct( \Magento\Sales\Api\Data\OrderInterfaceFactory $orderFactory, ...... ) { $this->orderFactory = $orderFactory; } Load order object by increment id: $...


20

sales_order_place_after This event is dispatched after the order payment is placed. This event function from Mage_Sales_Model_Order::place() in Magento 1 & \Magento\Sales\Model\Order::place() in Magento 2 sales_order_save_after This event is called every time the order is saved. For eg. Order status changed, invoiced, shipped & credit memo. This ...


17

Getting the Order Details depends on a few components: The Order (normally order #) The Contents of the Order (Simple vs Configurable, Invisible etc.) The Information you're looking to Extract (Pricing vs Other information) Load your Order: (db: sales_flat_order) $OrderNumber = "100000001";//Put your order Number here $order = Mage::getModel('sales/order')...


16

There is quite big probability that your payment method is processing payment wrongly. Magento Order Save Process is quite simple: Prepares all data that should be transfered from quote item to order item, including prices and product information, afterwards it doesn't invoke price retrieval. Invoke before order submit events ...


16

Void is in regards to the payment on the order invoice - to void the authorization, for instance - so that the funds aren't subsequently captured. Payments have to be refunded after capture and cannot be voided. Cancellation, however, is when the order can no longer be modified. While an order payment might be voided a new invoice can always be generated. ...


16

What was previously in eav_entity_store is now covered in sales_sequence_profile and sales_sequence_meta. The table sequence_order_1 gets populated when orders are placed.


14

Take a look at http://www.mexbs.com/magento-order-statestatus-flow/ Order "Pending" From the Admin panel, the sales order appears in the Order list as "Pending". At this point, payment has not been processed, and the order can still be canceled. Payment Received The status of the order remains "Pending" until payment is received. Depending on the payment ...


14

/app/code/core/Mage/Sales/Model/Quote.php is the Quote class for the quote object /app/code/core/Mage/Sales/Model/Quote/Address.php is the Quote Address class for any quote address objects A quote object would normally contain 2 address objects, but can contain more if multiple delivery addresses are present. In regards to the 'collecttotals' method(s):...


14

Try a workarround: in CMS > SALES EMAILS Set Order > Sent Emails via seperate Mail (BCC is Buggy) Magento know this bug and will fix in 2.0.


13

Yes, it's possible. Manually Go to the order, generate shipment, and then enter the # of qty/items to ship in that particular shipment. The order will remain in Processing or your custom status until all items have been shipped before it will be marked as Completed. Programmatically $shipment = Mage::getModel('sales/service_order', $order)->...


13

Get the latest order_id from the session like this: Mage::getSingleton('checkout/session')->getLastOrderId(); Here is also another way to do it.


13

It is pretty simple to change logo from Magento Admin. Goto to the backend of your website: 1) Goto System>>Configuration>>SALES>>Sales 2) Open the tab Invoices and Packing Slip Design and change the logo from there.


13

Try below code: foreach ($orderCollection as $order) { $items=array(); foreach ($order->getAllItems() as $item) { $items[] = array( 'id' => $order->getIncrementId(), 'name' => $item->getName(), 'sku' => $item->getSku(), 'Price' => $item-...


13

It's pretty similar to M1 in Magento 2, you need to inject the Magento\Sales\Model\Service\InvoiceService in your class: protected $_invoiceService; public function __construct( ... \Magento\Sales\Model\Service\InvoiceService $invoiceService ... ) { ... $this->_invoiceService = $invoiceService; ... } Then, assuming you have the ...


Only top voted, non community-wiki answers of a minimum length are eligible