magento-1.8

How to get the category name in product/view.phtml from product_viewed.phtml?

偶尔善良 提交于 2019-12-13 03:36:58
问题 How can I get the category name from product_viewed.phtml list? I get an error when I land on the product page frontend\base\default\template\catalog/product/view.phtml if I click a product from frontend\base\default\template\reports/product_viewed.phtml This is the code on my view.phtml <?php $_helper = $this->helper('catalog/output'); $_category_detail = Mage::registry('current_category'); var_dump($_category_detail->getName()); //gives current category name ?> This is the error I get,

Magento. How to add simple product in cart programmatically with custom options

喜夏-厌秋 提交于 2019-12-12 17:01:54
问题 I am trying to add my simple product with custom options in cart. $post = $this->getRequest()->getPost(); $_product = Mage::getModel('catalog/product')->load(8); $QuoteId= Mage::getModel('checkout/cart_api')->create('default'); $storeId = Mage::app()->getStore()->getId(); $arrProducts = array( array( "product_id" => 8, "qty" => 1, "options" => array( '1' => array( 'sku' => 'cheese' ) ) ) ); $cart = Mage::getSingleton('checkout/cart'); $cart->addProduct($_product, $arrProducts); $cart->save();

Magento : get attribute value php

独自空忆成欢 提交于 2019-12-12 04:59:54
问题 i have tow attributes described in the image bellow : i wanna know how to get value of it ________ _________ _________ Thanks ! 回答1: First load the product model: $product = Mage::getModel('catalog/product')->load(<product_id>); then use: $allowCustomPrice = $product->getAttributeText('allow_custom_price'); and $minPrice = $product->getMinPrice(); Note: I am asuming, that you will replace with original product id, and attribute codes are "allow_custom_price" and "min_price" respectively. 来源:

Magento Duplicate Attribute Value

╄→尐↘猪︶ㄣ 提交于 2019-12-12 01:58:53
问题 I have an attribute "Brands" that i can´t use in layered Navigation, because its part of a plugin that imports external products. However, i need to use that in filtered Navigation. What i remember, was to get that value and insert it on Manufacturers attribute, this way i could use it in layered Navigation. Now, the problem is that i have more than 5000 products, and it would take an eternity to copy the value manually. I tried to import/export, but the CSV is confusing. and it doesnt even

local.xml added to Magento layout directory but is not being applied and is ignored

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 01:43:07
问题 I'm using Alan Storm's advice from: Specify Category specific layout updates without using Magento's administration dashboard using several category specific layout updates inside of my local.xml. I have validated the xml, and it is being returned as valid xml. I have enabled mage developer mode to on to report an error and have looked at the exception logs to see if something is wrong, however no luck. here is my local.xml: <?xml version="1.0" encoding="UTF-8"?> <!-- /** * local.xml * *

Add new field in bundle item option in admin section

做~自己de王妃 提交于 2019-12-12 01:39:58
问题 I am new bie in magento.I am creating a bundle product from admin section .when I add the bundle item there is only the title field for information but I need to add one more field for the description like I created a bundle item for computers but I need to show description about it . Please help .my requirement is to add new field for description along with the title in bundle item option. any help will be appreciated . 回答1: you can add extra field to magento bundle products by editing app

How to get Amazon Customer review on magento site

柔情痞子 提交于 2019-12-10 12:05:21
问题 i want to show the amazon customer review on my magento site ... i searched a lot and i found some links which showing me the steps for this.. <iframe src="http://www.amazon.com/reviews/iframe?akid=[AWS Access Key ID]&asin=0316067938&exp=2011-08-01T17%3A54%3A07Z&linkCode=xm2&summary=0&tag=ws&truncate=256&v=2&sig=[Signature]" /> In this iframe AWSAccessKeyId and Signature is using .... i got the AWSAccessKeyId but i haven't found the Signature . so please can you tell me, from where i get the

how to check product has custom options?

落爺英雄遲暮 提交于 2019-12-07 01:43:57
问题 I'm trying to check whether product has custom options or not in code (my code runs sales_order_place_after event). I have try below code but it does not returning anything. $product->hasCustomOptions() and $product->hasOptions() Please let me know what I'm missing. 回答1: I've encountered this error more times than I care to count. Either $_product->hasOptions() or $_product->hasCustomOptions() always returns false . I still don't know why this error occurs. Anyway, you can get the same result

dbModel read resource does not implement Zend_Db_Adapter_Abstract

梦想的初衷 提交于 2019-12-06 10:44:50
i am facing a situation where i can't find any solution. My website was working fine till i installed a new extension. After installing this extension my website and admin panel is not working. Actually i have installed lower version extension because i didn't noticed version and installed. I am getting this stack trace :- dbModel read resource does not implement Zend_Db_Adapter_Abstract Trace: #0 /home/krishangrover/public_html/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(134): Varien_Data_Collection_Db->setConnection(false) #1 /home/krishangrover/public_html/app/code

how to check product has custom options?

橙三吉。 提交于 2019-12-05 05:14:27
I'm trying to check whether product has custom options or not in code (my code runs sales_order_place_after event). I have try below code but it does not returning anything. $product->hasCustomOptions() and $product->hasOptions() Please let me know what I'm missing. I've encountered this error more times than I care to count. Either $_product->hasOptions() or $_product->hasCustomOptions() always returns false . I still don't know why this error occurs. Anyway, you can get the same result by doing the following. For configurable products: <?php if ( $_product->getData('has_options') ): ?> <!--