The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Hot answers tagged

29

Set the store first: $store = Mage::getSingleton('core/store')->load(1); $quote = Mage::getModel('sales/quote')->setStore($store)->load($quoteId);


15

The problem here is that someone defined a handle in the etc/adminhtml/di.xml search for something like this <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory"> <arguments> <argument name="collections" xsi:type="array"> <item name="NameOfHandle" xsi:type="string">Vendor\...


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

Okay so I found the problem. I found another stackexchange topic that didn't seem to be 100% related because it was a different module, however the exact same scenario was occurring. You can find the discussion here: https://stackoverflow.com/questions/39763550/magento-2-1-1-admin-content-pages-not-loading-handle-not-registered The main thing was that I ...


11

The answer lies in your question and I believe this is so in Magento and as well in lot of other e-commerce and accounting software cause of dependencies the "order document" has. In commerce and accounting usually editing is not a way to do things and in order to achieve editing effect credit or debit balances on specific accounts are altered with adding ...


11

You can customize the invoice layout by modifying this file : Mage_Sales_Model_Order_Pdf_Invoice(app/code/core/Mage/Sales/Model/Order/Pdf/Invoice.php). Of course you need to rewrite the file properly. Also take a look at these articles for additional info and examples: http://www.atwix.com/magento/customize-magento-pdf-invoice-and-packingslip/ http://...


10

I've done something like this, and this is a contrived example and over-simplified to see if you would even consider this to be a viable solution: It's similar to defining a sudoku grid but that sudoku grid's open areas are open seats: $section1 = <<<SECTION A,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-, B,-,-,-,-,-,-,-,-,-,-,-,-,-...


10

Your presumption is correct. But for the sales_ table they are one and the same. Initially the sales entities were EAV. They changed into flat tables starting with version 1.4.0.1 (I think). And for backwards compatibility both methods were kept. For any other flat tabled entities (cms pages, blocks, polls) you cannot use addAttribute, only addColumn, but ...


10

Edit the grid.phtml file located: .../app/design/adminhtml/default/default/template/widget/grid.phtml At line 81-87: <select name="<?php echo $this->getVarNameLimit() ?>” onchange="<?php echo $this->getId() ?>JsObject.loadByElement(this)"> <option value="20"<?php if($this->getCollection()->getPageSize()==20): ?> ...


9

@user1240207 Please use the below code. It will may help you. Mage::getSingleton('checkout/session')->setQuoteId($_quote->getId()); Code convert an order to quote please used below: $quote = Mage::getModel('sales/quote')->load($order->getQuoteId()); if ($quote->getId()) { $quote->setIsActive(1) //->...


8

The reason of making order not editable is not a complexity but data consistency. For instance product can be modified or even deleted from catalog after order was placed. So modification of ordered products will make no sense. Same with a customer and his details. Of course such things can be taken into consideration and tracked intelligently but this will ...


8

Easiest way to do this is to create a custom extension that works with an Observer and a Cronjob. Create a category for the sales products. This way you can use the normal Magento functionalities in the frontend like layered navigation etc. To get the products in this category automatically we will use the observer and cronjob. The observer will observe ...


8

$this->getOrderId() returns the increment ID (i.e. 100000456) and not the actual database ID. You'll need to use loadByIncrementId() instead of load(): <?php $grayson_order_id = $this->getOrderId(); $order = Mage::getModel('sales/order')->loadByIncrementId($grayson_order_id); $custname = $order->getBillingAddress()->getName(); ?> (...


8

The self-provided answer from @jason-diehl doesn't really explain this issue, and I believe includes some incorrect information. I ran into this issue when developing a custom module and testing the admin grid. I could see the container with the "Add ____" button, but a single message: Not registered handle ________. After looking into things I realized ...


7

Let's think this through: The year is 2010 An order is created in your store for an iPhone 3GS The admin loads the order to capture funds, and generate shipment The customer receives the order on time and is happy. Fast forward to 2013 The customer's contract is up and wants to upgrade and purchase a new iPhone. You ask for the contract number. They don'...


7

You need to create a block that extends the product list block. Create it inside one of your extensions or create a separate extension. Let's assume the extension is called Easylife_Special. You need to create this block: app/code/local/Easylife/Special/Block/Catalog/Product/Sales.php <?php class Easylife_Special_Block_Catalog_Product_Sales extends ...


7

The solution offered by @SanderMangel is top notch. I can help expand on this with some code, which I currently use in my module Automated / Dynamic Category products - which has the ability to do Category rules of products on special The code adjusts a standard product collection to get all the products with special price set, on the day the code runs. You ...


7

Please try it app/code/Vendor/Module/etc/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Catalog\Model\Product"> <plugin name="module-filter" type="Vendor\Module\Plugin\...


6

I logged in php MYadmin and executed this query in SQL window. SELECT name, sku, sum(qty_ordered), sum(row_total) FROM sales_flat_order_item WHERE price > 0 AND created_at > "2013-01-01 00:00:00" GROUP BY sku ORDER BY sku LIMIT 1000 After this I saved as new VIEW CSALES_PER_SKU Improvements to query are welcome. Would be interested in adding ...


6

The single most important place to debug a Magento rewrite is right here #File: app/code/core/Mage/Core/Model/Config.php public function getGroupedClassName($groupType, $classId, $groupRootNode=null) { //... $config = $this->_xml->global->{$groupType.'s'}->{$group}; // First - check maybe the entity class was rewritten $...


6

You can get the subtotal like this easier: Mage::getSingleton('checkout/session')->getQuote()->getSubtotal();


6

To add the contents to the Order Information section (First block on the admin order page), inside app/design/adminhtml/default/default/layout/yourmodule.xml add below: <adminhtml_sales_order_view> <reference name="order_info"> <action method="setTemplate"> <template>yourmodule/sales/order/view/info.phtml</...


6

I have the same problem in my couple of sites in recent past. As in the latest magento version, magento has introduce new feature of processing the order confirmation email in a queue, so we must have to configure cron.php to call every 5 minutes in order to make this scheduled task work properly. This cron.php file indirectly calls the cron.sh file which ...


6

There are lot of works need to do this question: Here the steps: 1.Disable Checkout module block output This case, you disable checkout module block output that make Cart/Checkout blank and also will remove minicart pop,So Customer cannot place order place. disable module Magento_Checkout output from Admin.Just to admin>Store>Configuration>...


5

AVS Response: I've used 3 Authorize.net payment modules with Magento: Core IDP_AuthorizeCim Gorilla_AuthorizenetCim None of these store the AVS response - the only place they are available is via the gateway response object. Now, there is some information stored from the transaction and if you were to coax the Authorize.net payment gateway module into ...


5

You can include the output of any block into the shipping email via the following: {{block type="yourcustom/shippingblock" template="path/to/your/template.phtml"}} IIRC your block must extend Mage_Core_Block_Template. To get ahold of the current shipment information in your block use the following: $shipment = Mage::registry('current_shipment'); Since ...


5

if you have the order object you can get the shipping description $order = $observer->getEvent()->getOrder(); // or where ever the order is located in your observer event echo $order->getShippingDescription(); Or optionally if you want all the shipping method data you should be able to retrieve it via $shipping = $order->getShippingAddress()-&...


5

The sales_order table and other tables related to sales are dropped in the upgrade script that changes the structure of the sales entities from EAV to flat. The actual file is: app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-1.3.99-1.4.0.0.php. Near the end of the file there is this code: // Remove previous tables $tablesToDrop = array( '...


5

Here is the collection which should give you the resultset of all the special price products in your catalog which you can display in one page $collection = Mage::getResourceModel('catalog/product_collection') ->addAttributeToSelect('price') ->setStoreId($this->getStoreId()); $date = strtotime(date('Y-m-d')); $current_date = date("Y-m-d hh:...


5

Magento manged store name from admin>System >Configuration> General > Store information also {{var store.getFrontendName()}} is provide store name of current store and Goto for register customer app/locale/yourlanguage/template/email/sales/order_new.html and for guest customer app/locale/yourlanguage/template/email/sales/...


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