is it possible to show custom attributes of associated products under a grouped product in front end? (Magento) - 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.

Related

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'))

is it possible to edit Magento creation date? and how?

hey there? I have a problem and I need to edit product's creation date on magento to arrange my products to the right order, but I just cannot find out how to do it? can anyone here help me? thanks
It depends if you are wishing to do this via the admin section or programmatically in some sort of script. The created_at field is a core field found in the "catalog_product_entity" table. Programmatically you could do it along these lines:
$productId = 123; //use your own product id here
$myProduct = Mage::getModel('catalog/product')->load($productId);
$myProduct->setCreatedAt(strtotime("now"))->save();
// I put strtotime("now") as an example - use whatever date you need to.
$myProduct->unset();
However, you could reconsider using a different attribute to order by. There is a "position" field, or use a custom order attribute. The created_at is useful to keep as a proper point of reference to when the product was actually entered into the system.
To use the position attribute, you can order your products in the admin by going to "categories" and then choosing the "category products" tab. You should see the position field as one of the columns. Set this for each product with the lowest number you want to appear at the top.

Magento product list view sort by new from/new to

In my magento store product category grid view, there are two sorting options by now, price and name. I'd like to add on more option: New products. I found tutorials and extensions for date added or date modified, but thats not what I need. Id like to use 'New from date' / 'New to date' to sort them.
Thanks!
You can use your attribute is new from the attribute frontend option. For that navigate to your attributes, go to your respective attribute and change the settings for: use for filtering in frontend. Then the attribute will be added in frontend for sorting, see the screenshot (sorry, just german):
I don't know if that resolves your problem. Otherwise check this extension here

Filter one specific attribute values from products in 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.

How to change the product display order in magento

How can I change the product display order in the front end (grid or list) by setting some preferences from back-end? I guess it should be other than best value and name from the default Magento display order property.
I tried by creating a new attribute called display_order, and each product holds a value based on its value the product needs to shown in front end. However, it is not working. Please help me fix this.
You'll need to extend the Mage_Catalog_Block_Product_List block to provide your own functionality for the getProductCollection() method. Probably something along the lines of:
class ... extends Mage_Catalog_Block_Product_List {
function getProductCollection() {
parent::getProductCollection()->addAttributeToSort('display_order', 'ASC')
}
}
Then, of course, you'll have to update you layout xml file on your, presumably, custom controller (unless you want all of the product listing screens to act like this) to use your new block instead of the Magento default of catalog/product_list.
Why don't you use the Magento sorting thing ?
In your category, under Category Product you have the possibility to choose the sorting order in the last column. To do it through php, just make a custom script that you'll need to launch once.
$collection = 'Your product collection';
$result = array();
foreach ($collection as $product) {
$sort = 'Your way of calculating the desired sorting';
$result[$product->getId()]=$sort;
}
Mage::getModel('catalog/category')->load('your category id')->setPostedProducts($result)->save();
And that's it :)
To change the display order , first you need to set the default sort by option to position.This can be done from the magento admin configuration.After that you need to set position for all the products starting with the value 1.
I come across the following module which will make this task very easy, just by drag and drop the products from the manage categories itself.Please check the following extension
http://www.blackqubers.com/extensions/product-sorting-drag-and-drop.html
Hope this will helps you

Resources