how to display a message if a product is direct delivery (attribute = yes)
I have an attribute called direct delivery. Is there a way to display a message on the shipping method page tell the customer they have a direct delivery item in their cart. The attribute "direct delivery" is a yes/ no attribute.
thank you
Solutions
on method.phtml file.you need get list of product and check it attribute value yes
$quote = Mage::getSingleton('checkout/session')->getQuote();
$cartItems = $quote->getAllVisibleItems();
foreach ($cartItems as $item)
{
$productId = $item->getProductId();
$product = Mage::getModel('catalog/product')->load($productId);
if($product->getData('attributecode')==1){
//direct delivery possaible
}
}
How to display yes/no attribute in custom product grid in Magento?
I am creating a new custom product grid which will show a custom yes/no attribute. I have successfully displayed the value of yes no which is saved in database in 0,1 format. But I need yes or no to be shown in data field. I have used below code in my Grid.php Please help guys.
Display products on home page, with "promotion" attribute set to "yes" - not working
I am trying to display a list of products on the home page. The list of products is the products with the attribute "promotion" with the dropdown value "yes". So far I have tried the following But it just blank and not actually displaying anything.: I have re-used code from my template bought from Template Monster, the code was used to display the ...
How to display Yes/No Attribute on Catalog Page
Typically I can use the following code to display something like an image or a button on a product page when the value of the IF statement is "1" or "true:" However, this does not work on catalog listing pages. The IF statement is ignored. How should this be written to work on catalog listing pages?
Magento 2: Observer Message with Yes/No Button & Functionality
I'm using Magento 2 CE Version 2.1.0. I have a custom attribute called Type with value A or B. User can only add 1 Product of Type A in the Cart. If a user is going to Add Second time Same or Other product of Type A. Then Observer will give a message "This type of product is already exists. Would you like to overwrite?". Able to display a message. ...
Magento 2 custom attribute and show product if attribute YES
its very Urgent I have an attribute called 'show_product' (in the backend of Magento) with two outcomes 'yes' or 'no'. At the moment I'm just echoing the product name on the frontend. However, ideally I'd like to show all product name the attribute value. For example, if 'yes' then show all product, if 'no' then No product. Can anyone please help m...