Questions tagged «magento-1.7»

Magento社区1.7版


4
最佳实践方法,编辑Magento顶部链接
假设我们要在Magento顶部链接上的“我的购物车”链接之前添加购物车图标(请参见下面的顶部链接)。 做这个的最好方式是什么? 对toplinks.php做点什么? 对links.phtml做些什么? 一个xml文件? 还有其他选择吗? 我了解这可以使用CSS来完成,但是随着我对定制的需求的增长,我想知道没有CSS怎么办,所以我能够定制更困难的事情。


5
为什么PATCH_SUPEE-6788对1.7.0.2安装似乎无效?
注意: 此问题似乎适用于已收到SUPEE-6788补丁的所有Magento版本。您会在我的答案中看到这两者, .htaccess并且都.htaccess.sample需要还原才能使补丁成功。 我正在使用提供的shell脚本应用SUPEE-6788补丁到CE 1.7.0.2网站magentocommerce.com/downloads。该站点已应用了所有以前的安全补丁。 脚本的名称是PATCH_SUPEE-6788_CE_1.7.0.2_v1-2015-10-27-12-00-16.sh且具有md5sum cfc0cf533fe36a5f573414f0feeb1590(此修补程序是不寻常的,因为它未经压缩就被释放了-尽管该文件未显示损坏或被截断)。 运行此脚本时,控制台输出似乎表明所包含的补丁程序中至少有一个失败或被跳过,但是补丁程序的许多部分均已成功执行,但是git未显示任何更改。该脚本已在具有相同代码库的两个不同环境中进行了测试-一个是Ubuntu GNOME 14.04 LTS工作站,另一个是nexcess.com共享服务器(运行CentOS)。 有趣的是,两种环境的输出略有不同。注意以“ checking”和“ patching”开头的行。 Ubuntu环境的输出示例: bash PATCH_SUPEE-6788_CE_1.7.0.2_v1-2015-10-27-12-00-16.sh [19:27:10] Checking if patch can be applied/reverted successfully... ERROR: Patch can't be applied/reverted successfully. checking file .htaccess Hunk #1 FAILED at 207. 1 out of 1 hunk FAILED can't find file to patch …

2
addAttributeToFilter()与addFieldToFilter()有什么区别?
我有点困惑addAttributeToFilter()和addFieldToFilter()函数的区别是什么。我检查了magento中的核心文件。但是我不知道有一个明确的想法。因为magento中的某些集合使用了addAttributeToFilter(),而有些集合使用了addFieldToFilter()。请对此进行任何澄清将是很大的帮助。提前致谢。


2
打印发票时出错
我已经使用XAMPP的BitNami Magento安装在Windows 7上安装了标准的Magento 1.8.0.0。 当我打开销售->发票屏幕并单击发票,然后单击屏幕右上角的橙色“打印”按钮时,我在网络浏览器中收到以下错误消息: 致命错误:Zend_Pdf_FileParserDataSource_File :: __ construct()的声明必须与C:\ xampp \ apps \ magento \ htdocs \ lib \ Zend \ Pdf \ FileParserDataSource \ File.php中的Zend_Pdf_FileParserDataSource :: __ construct()兼容 有人知道我为什么得到这个以及如何解决这个问题吗?

3
将链接添加到类别菜单
我知道这是一个有很多答案的老问题,其中大多数建议编辑菜单模板,但这对我不起作用。无需解释为什么,让我有点强迫症,以“正确”的方式做事。 这个问题可以作为有需要的其他人的材料。开始。 从Magento 1.7开始,使用以下事件构建顶部菜单:page_block_html_topmenu_gethtml_before。Mage_Catalog模块使用它来添加类别。我想用那个。为此,我在模块中创建了一个观察者,如下所示: <global> <events> <page_block_html_topmenu_gethtml_before> <observers> <my_observer> <class>mymodule/observer</class> <method>addItemsToTopmenuItems</method> </my_observer> </observers> </page_block_html_topmenu_gethtml_before> </events> </global> 在Observer.php课堂上我有 public function addItemsToTopmenuItems($observer){ //get the menu object: //Type Varien_Data_Tree_Node $menu = $observer->getMenu(); //get the tree object in the menu //type Varien_Data_Tree $tree = $menu->getTree(); //get current page handler $action = Mage::app()->getFrontController()->getAction()->getFullActionName(); $brandNodeId = …
20 magento-1.7  menu 

1
如何禁用特定产品上的“添加到购物车”,而在类别列表视图中显示“查看详细信息”按钮?
我想知道如何在某些特定产品上禁用“添加到购物车”按钮,但是我发现了一个废弃的指南,该指南虽然有效,但是由于它只是产品视图页面上的一个解决方案,因此它并不完整,而不是在类别列表或网格页面上。 在我解释了第一步之后,我将在8个小时内在这里回答我自己的问题(由于我的声誉低于某个点,我需要等待8个小时),所以我的答案将是我必须弄清楚的缺少的第三步为我自己。我将尝试使其易于理解: [步骤1] [1] 创建一个将在不需要“添加到购物车”按钮的产品上使用的属性。在管理控制台中,转到... 目录>属性>管理属性> 添加新属性 随便命名属性,例如:“ No_cart_button” 具有属性: Attribute Code: No_cart_button Catalog Input Type for Store Owner: Yes/No Use in Quick Search: No Use in Advanced Search: No Comparable on Front-end: No Visible on Product View Page on Front-end: No Used in Product Listing: YES Used for Sorting …

4
为什么将created_at(customer_entity表)设置为在更新时更改?
在查看customer_entity表的结构时,我注意到该created_at字段具有以下属性:on update CURRENT_TIMESTAMP。因此,每次更新行时,created_at时间戳都会更改。 似乎此属性应该存在于updated_at字段上,而不是created_at字段上。我知道很少有由于EAV结构而直接修改此表的方法,但是修改此created_at字段似乎仍然是错误的。 此表结构是否有原因,还是只是一个错误? 编辑:我从Magento找到了确认的错误报告。问题#27944。不幸的是,您必须登录才能查看。 http://www.magentocommerce.com/bug-tracking/issue?issue=13882

3
如何诊断“无效块类型..”错误?
不知道如何找出这个错误,我已经搜寻了一个星期,但似乎找不到解决方法。有任何想法吗? 2013-06-10T04:04:28+00:00 ERR (3): exception 'Mage_Core_Exception' with message 'Invalid block type: ' in /home/xxxxxxx/public_html/app/Mage.php:594 Stack trace: #0 /home/xxxxxxx/public_html/app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Invalid block t...') #1 /home/xxxxxxx/public_html/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('', Array) #2 /home/xxxxxxx/public_html/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('', 'checkout.cart') #3 /home/xxxxxxx/public_html/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('', 'checkout.cart') #4 /home/xxxxxxx/public_html/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element)) #5 /home/xxxxxxx/public_html/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element)) #6 /home/xxxxxxx/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks() #7 /home/xxxxxxx/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(269): Mage_Core_Controller_Varien_Action->generateLayoutBlocks() #8 /home/xxxxxxx/public_html/app/code/core/Mage/Checkout/controllers/CartController.php(159): Mage_Core_Controller_Varien_Action->loadLayout() #9 …

1
如何在Magento中创建具有不同域的多个商店
如何在Magento中使用相同的产品,相同的数据库但不同的客户创建具有不同域的多个商店。 范例: 我买了2个域:mystore1.com和mystore2.com(仅供参考:mystore1.com已在运行) 现在,我想添加mystore2.com到mystore2.com具有相同的产品,相同的数据库,但不同的客户。 笔记: 已经通过这种方式进行了测试 请一步一步回答!提供正确答案的赏金。并且不通过引荐链接进行回答。

2
自定义表单验证-Magento
我正在尝试使用jQuery在Magento中实现一些自定义表单验证,但是我不确定我是否具有正确的方法。 基本上,我需要验证以下内容: 仅数字字段需要具有.00才能验证1到1.00 字母必须大写 号码不能大于9.99 字段中没有空格 我正在考虑使用jQuery,并着手编写一些东西来验证表单: <script> jQuery(document).ready(function() { jQuery.validator.addMethod("integer", function(value, element) { return this.optional(element) || /^-?\d+$/.test(value); }, "A positive or negative non-decimal number please"); function(field, length) { if (!numericRegex.test(length)) { return false; } return (field.value.length <= parseInt(length, 4)); }, } </script> 问题是我找不到其他验证字段的功能,请提供一些帮助。

3
在产品保存上创建自定义选项
每当创建产品时,我都在为我的产品自动创建自定义选项。到目前为止,我所得到的是一个在catalog_product_save_before事件上触发并运行以下代码的观察者: //check that we haven't made the option already $options = $product->getProductOptions(); foreach ($options as $option) { if ($option['title'] == 'Auto Date & Time' && $option['type'] == 'date_time' && !$option['is_delete']) { //we've already added the option return; } } $options[] = array( 'title' => $product->getDateLabel(), 'type' => 'date_time', 'is_require' => …


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.