Filter one specific attribute values from products in magento - magento

I'm new in magento, I'm working on http://www.theartworkgallery24.com/stage/ website. Please check beneath flash banner, there are 4 big images that are links to attributes value from which user can directly go to a product.
I need a page that display on one specific attribute values like in case of artist, it should be Gustav Klimt, Leonardo Da Vinci etc. These should be links to actual product related to the attribute values.
Please tell me how to make your own PHTML or PHP file, which code to use and how, and in last how to call your code in your magento website.
Any ideas will be appreciated, thanks.

You please create an attribute (davinchi) in admin side for these functionality. You can create products attributes from catalog->attributes->menu.After that you can see these attribute value in product creation page.You just assign it to different products
After that you can either create a module for this. Otherwise just create a phtml file in catalog/product/ folder.
then enter the below custom collection code in it.
$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addAttributeToSelect('*');
//filter codition
$collection->addFieldToFilter(array(
array('attribute'=>'davinchi','eq'=>1),
));
This will load products having attribute value davinchi=1.

Related

How To Create Multiple Attribute In Magento For Product Details Page

I want to create multiple attribute in magento for product details page because i have to show two things on the product details page and they are attribute first of all i have color swatches with the help of attribute i am showing on the product details page the next thing is the google map and each different product has a different google map how to show two attribute in magento product details page any help would be very appreciated
You would need to first create an attribute. Read here on a simple tutorial on how to do that.
To display any product attribute in magento you need the "Attribute Code". Lets say you make a attribute called "Gogole Map" with a Attribute Code "gmap". You would need to open the html for the product detail page which can be found
app/design/frontend/default/[your template]/template/catalog/product/view.phtml
and just add the following code to where you want to place
<?php echo $_product_getGmap();?>

Create magento product that links to an external website

I want to add a product that is not held on my magento website. It must only show on my website. But when a customer clicks on a product it directly goes to the website that holds the product.
I want to give the URL to the product on the site. I am not sure how to do this. Please help me. Thanks.
Here are some screen shots that show what I actually want to do:
product show on my website
Customer goes to other website
The way i would suggest you is to create an attribute called external_url, a textinput field. Assign it to required attribute sets then, while adding product if that particular product will be linked to external; input that field with external url.
And while populating product in listings, check if that external_url attribute value exists or not. (for eg on template/catalog/product/list.phtml check for this value $_product->getData('external_url'))
If the value exists then, change the product link(on product list.phtml change $_product->getProductUrl() with our $_product->getData('external_url'))

Magento Go - Adding attribute above product description in Grid view

Im wanting to add the Brand name (or designer name in this case which i have made a new attribute for) just above the product description in the Category view (grid) but cant figure it out.
As its Magento Go i have no access to the code, other than XML updates for the category itself.
Ive looked everywhere and would value any help.
Thanks
If you are cant get to the template phtml codes, you can put it on by admin.
Open catalog / attributes / manage attributes, find your attribute and in the properties set to
Visible on Product View Page on Front-end
Used in Product Listing
But it will not be on position you want.
You can edit CSS for the template and set an absolute position for your attribute.
Next way is to add in the admin in category XML layout, but this you need to do for each category. (Custom Layout Update)

Display products against attributes in magento

I am working on custom module in magento.
I create two new attributes (combo box) make and location. After that I add values for these attributes using custom code against specific product. Like I add make "Sony" and location is "Australia" against product 1 (1 is id for product).
Now on admin side i want to display this product with attributes values like make is Sony and location is Australia and product is 1.
I found some tables where these values are linked like (catalog_product_entity_int,eav_attribute,eav_attribute_option,eav_attribute_option_value), but I am unable to query such records. The page where I want to display data I have attribute id and attribute code.
Can anyone knows how I can figure it out?
Very simple Dude.
inside your _prepareCollection() method of your custom module grid
Load the product collection and select these two attribute... If there is a need to filter it by these two attributes then do it.

is it possible to show custom attributes of associated products under a grouped product in front end? (Magento)

I have a typical condition in my magento Grouped product.
Is it possible to show Custom attribute (color dropdown) of associated product under Grouped products in the fronted.. as shown below
Consider the sample blanket product
Let me know if i am not clear.
Thanks
It's not clear your question but I would give you a small example to get text field, multiple select or drop-down listbox value.
First, we should load the product collection :
<?php
// load the product that id 125, then show attributes of the product
$product = Mage::getModel('catalog/product')->load($this->getProduct()->getId(125));
echo $product->getCustomAttribute();
// lets say your custom attributes name is "size" and type is text field
echo $product->getSize();
// lets assume your custom attributes name is "product_size then
echo $product->getProductSize();
// lets assume your attribute type is drop-down, this will get array of attribute options instead of value that you selected
echo $product->getAttributeText(product_size);
// to get drop-down value that you selected
$attribute = $product->getAttributes();
$productSize = $attribute['product_size']->getFrontend()->getValue($product);
let me know if it's not meet your request.
I have found a solution for this, 3 edited files.
But these files are edited for a previous version of Magento, I don't know which version.
I have uploaded this 3 files on my Magento 1.7 and it works but when add the product to the cart it give's a error with app/code/core/Mage/Sales/Model/Quote.php
This file: Quote.php is one of the edited files, when i upload the original Quote.php it works.
Look at this pic: http://s8.postimage.org/g8bvbth0z/Naamloos.png
But maybe i get more errors in the future, i don't have any ideas..
I am a noob with this, if someone can look at the edited files and chek how they have do this and compare this with the newest files for Magento 1.7 maybe we can help to many peoples with this problem.

Resources