magento

Product details in magento

我与影子孤独终老i 提交于 2020-01-07 07:53:07
问题 I have this code in my magento app <?php $order_id = Mage::getSingleton('checkout/session')->getLastRealOrderId(); $order_details = Mage::getModel('sales/order')->loadByIncrementId($order_id); foreach ($order_details->getAllItems() as $item) { //here i know we can get item name as $item->getName(), sku as $item->getSku() //but how do we get the following details //1.category name,2.store,3.tax,city,country,state <?php } ?> I know by simply print_r($order_details->getAllItems()) will get the

Event/Observer input into database

帅比萌擦擦* 提交于 2020-01-07 05:25:09
问题 I have an event observer creating a log after an order is placed from the admin section. How can I get this to insert into a database instead of being a log file? Can anyone provide a good tutorial. 回答1: http://www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-5-magento-models-and-orm-basics/ Firstly you are going to need to add the setup/read/write sections to your config.xml. Lets say your module is Test/Demo then your setup section may look a bit like this: <models> <demo>

magento print friendly page for products

时间秒杀一切 提交于 2020-01-07 04:08:38
问题 In magento, is there already a way to do for a friendly print pages? Just before I write my own block to do this, I wasn't sure if there was an default / existing one I can edit.... :) Cheers Shane 回答1: Actually, I think I may be able to do this through a print css... Going to give it a go! Yep used the defualt print.css - but changed it to look how I wanted, job done! 回答2: Not as far as I know, although there is a print.css. There are a few ways I can think of to go about it, and none of

Customize Checkout定制化结账流程

可紊 提交于 2020-01-07 00:38:58
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 这边文章包含定制化已经存在的checkout步骤视图的基本信息。在Magento中,结账流程是用UI组件来实现的。你可以通过改变js实现或者模版的方式来改变。添加,禁用,移除一个组件。 想要改变组件.js的实现和模版文件,你需要先在结账布局文件里面声明你的文件。请参照以下步骤: 1.在你的模块里面,创建以下文件: <your_module_dir>/view/frontend/layout/checkout_index_index.xml (问了定制化能顺利工作,你需要声明你的模块依赖于Magento_Checkout模块)。 2.在这个文件里,添加以下内容: <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.root"> <arguments> <argument name="jsLayout" xsi:type="array"> <!-- Your customization

Magento datepicker should only enable two days after today (today+48hours)

三世轮回 提交于 2020-01-06 19:55:25
问题 I have added datepicker in my magento checkout page by the use of this tutorial: Tutorial It is working fine. What I need is The datepicker should enable dates after two dates from today. Suppose I am purchasing on May 1 then then I can select May 3 only as delivery date, It should show only those dates(today+48 hours). How can I do that? 回答1: function dateRange(date) { var today = new Date(); var dd = today.getDate(); // Put your logic here, I'm just guessing below logic. return date.getDate

Core overrides in Magento

霸气de小男生 提交于 2020-01-06 19:41:53
问题 So I found an answer for a question I had about dynamic option pricing, but that lead to me being stumped. I can understand the majority of the answer, but when it comes to the XML and module implementation, I'm lost. Here's what I'm trying to do: http://www.magentocommerce.com/boards/viewthread/260544/#t348802 Need to override the Mage_Catalog_Model_Product_Type_Price model and the Mage_Catalog_Block_Product_View_Options block. Modified Price.php is located at /app/core/local/rtega

Issue while adding custom field in billing address section in Magento

旧巷老猫 提交于 2020-01-06 19:34:20
问题 I followed this tutorial for inserting new field in billing address section in Magento checkout. I added new module , form field in billing.phtml page as described in this tutorial. I make sure that the module is enabled in advanced section in admin panel. And the attribute is saved in eav_attribute , sales_flat_order_address , sales_flat_quote_address tables. The issue is when I make place order the checkout page become broken and nothing can done. How can I solve this? Please help.. 来源:

Magento: Adding a custom entity

自古美人都是妖i 提交于 2020-01-06 18:10:11
问题 Im creating an extension that adds extra functionality to the review model. I've created a database table and I need to add it as an entity in the etc/config.xml file. In the review config.xml it creates entities with the following: <models> <review> <class>Mage_Review_Model</class> <resourceModel>review_mysql4</resourceModel> </review> <review_mysql4> <class>Mage_Review_Model_Mysql4</class> <entities> <review> <table>review</table> </review> <review_detail> <table>review_detail</table> <

Trying to upgrade from Magento 1.6.2.0 to 1.7.0.2 via downloader fails

江枫思渺然 提交于 2020-01-06 17:59:21
问题 I've tried to upgrade my existing 1.6.2.0-Installation to 1.7.0.2 via the downloader by the following command: ./mage upgrade http://connect20.magentocommerce.com/community Mage_All_Latest --force This results in the following message: Already installed: community/Mage_All_Latest 1.6.2.0, skipping [...] [...] But if I'm checking "./mage list-upgrades" I can see that there is an update for Mage_All_Latest: Mage_All_Latest: 1.6.2.0 => 1.7.0.2 Next I tried to install 1.7.0.2 by the following

Magento - add field to sales_flat_quote

北城余情 提交于 2020-01-06 17:14:07
问题 I have created a module which requires an additional field to be added to the sales_flat_quote table / model. Everything appears to work fine in my install script and the new field can be seen in the database. When retrieving a quote object and storing a value against my new field the value never gets recorded to the database. The save method doesnt product an error or exception but the value never sticks. If it makes a difference, I am trying to save the value to the quote from an observer,