Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

You will first need to loop through the cart products to check for the existence of the product that is required for the attribute.

Depending on where you want to place the attribute you need to be looking at the template files in YOURTHEME/default/template/checkout/onepage.phtml and YOURTHEME/default/template/checkout/onepage

$cart = Mage::getModel('checkout/cart')->getQuote();
   foreach ($cart->getAllItems() as $item) {
   $productSku = $item->getProduct()->getSku();
   if ($productSku === $myProduct)
   { 
     $showAttribute=true; 
   }
}

if ($showAttribute)
{
 // render custom attribute
}

If the product is present you can show/set the attribute value.

You might find these answers useful

Adding custom attribute to Customer

http://stackoverflow.com/questions/5961290/adding-attributes-to-customer-entityhttps://stackoverflow.com/questions/5961290/adding-attributes-to-customer-entity

You will first need to loop through the cart products to check for the existence of the product that is required for the attribute.

Depending on where you want to place the attribute you need to be looking at the template files in YOURTHEME/default/template/checkout/onepage.phtml and YOURTHEME/default/template/checkout/onepage

$cart = Mage::getModel('checkout/cart')->getQuote();
   foreach ($cart->getAllItems() as $item) {
   $productSku = $item->getProduct()->getSku();
   if ($productSku === $myProduct)
   { 
     $showAttribute=true; 
   }
}

if ($showAttribute)
{
 // render custom attribute
}

If the product is present you can show/set the attribute value.

You might find these answers useful

Adding custom attribute to Customer

http://stackoverflow.com/questions/5961290/adding-attributes-to-customer-entity

You will first need to loop through the cart products to check for the existence of the product that is required for the attribute.

Depending on where you want to place the attribute you need to be looking at the template files in YOURTHEME/default/template/checkout/onepage.phtml and YOURTHEME/default/template/checkout/onepage

$cart = Mage::getModel('checkout/cart')->getQuote();
   foreach ($cart->getAllItems() as $item) {
   $productSku = $item->getProduct()->getSku();
   if ($productSku === $myProduct)
   { 
     $showAttribute=true; 
   }
}

if ($showAttribute)
{
 // render custom attribute
}

If the product is present you can show/set the attribute value.

You might find these answers useful

Adding custom attribute to Customer

https://stackoverflow.com/questions/5961290/adding-attributes-to-customer-entity

replaced http://magento.stackexchange.com/ with https://magento.stackexchange.com/
Source Link

You will first need to loop through the cart products to check for the existence of the product that is required for the attribute.

Depending on where you want to place the attribute you need to be looking at the template files in YOURTHEME/default/template/checkout/onepage.phtml and YOURTHEME/default/template/checkout/onepage

$cart = Mage::getModel('checkout/cart')->getQuote();
   foreach ($cart->getAllItems() as $item) {
   $productSku = $item->getProduct()->getSku();
   if ($productSku === $myProduct)
   { 
     $showAttribute=true; 
   }
}

if ($showAttribute)
{
 // render custom attribute
}

If the product is present you can show/set the attribute value.

You might find these answers useful

Adding custom attribute to CustomerAdding custom attribute to Customer

http://stackoverflow.com/questions/5961290/adding-attributes-to-customer-entity

You will first need to loop through the cart products to check for the existence of the product that is required for the attribute.

Depending on where you want to place the attribute you need to be looking at the template files in YOURTHEME/default/template/checkout/onepage.phtml and YOURTHEME/default/template/checkout/onepage

$cart = Mage::getModel('checkout/cart')->getQuote();
   foreach ($cart->getAllItems() as $item) {
   $productSku = $item->getProduct()->getSku();
   if ($productSku === $myProduct)
   { 
     $showAttribute=true; 
   }
}

if ($showAttribute)
{
 // render custom attribute
}

If the product is present you can show/set the attribute value.

You might find these answers useful

Adding custom attribute to Customer

http://stackoverflow.com/questions/5961290/adding-attributes-to-customer-entity

You will first need to loop through the cart products to check for the existence of the product that is required for the attribute.

Depending on where you want to place the attribute you need to be looking at the template files in YOURTHEME/default/template/checkout/onepage.phtml and YOURTHEME/default/template/checkout/onepage

$cart = Mage::getModel('checkout/cart')->getQuote();
   foreach ($cart->getAllItems() as $item) {
   $productSku = $item->getProduct()->getSku();
   if ($productSku === $myProduct)
   { 
     $showAttribute=true; 
   }
}

if ($showAttribute)
{
 // render custom attribute
}

If the product is present you can show/set the attribute value.

You might find these answers useful

Adding custom attribute to Customer

http://stackoverflow.com/questions/5961290/adding-attributes-to-customer-entity

Source Link
paj
  • 6k
  • 5
  • 23
  • 45

You will first need to loop through the cart products to check for the existence of the product that is required for the attribute.

Depending on where you want to place the attribute you need to be looking at the template files in YOURTHEME/default/template/checkout/onepage.phtml and YOURTHEME/default/template/checkout/onepage

$cart = Mage::getModel('checkout/cart')->getQuote();
   foreach ($cart->getAllItems() as $item) {
   $productSku = $item->getProduct()->getSku();
   if ($productSku === $myProduct)
   { 
     $showAttribute=true; 
   }
}

if ($showAttribute)
{
 // render custom attribute
}

If the product is present you can show/set the attribute value.

You might find these answers useful

Adding custom attribute to Customer

http://stackoverflow.com/questions/5961290/adding-attributes-to-customer-entity