View Single Post
  #1  
Old 07-03-2019, 08:07 AM
 
David Harrison David Harrison is offline
    
Join Date: Jan 2009
Posts: 1
 

Default Pulling product product attributes into quantity_box.twig

I am trying to modify the quantity box style based on a product attribute. I've been able to do what I want on the product page by calling getAttributeInfo() in quantity_box.twip. However, quantity_box.twip is also used on the cart page and getAttributeInfo() fails there. How can I get a product attribute in quantity_box.twip when on the cart page?

I discovered I can get attributes in /customer/shopping_cart/parts/item.qty.twig by calling getSortedAttributeValues(), but there are two problems. First, there seems to be a bug where getSortedAttributeValues() will only get an attribute if there is more than one value. Second, I can't figure out a way to get a value from item.qty.twig to quantity_box.twip. It seems so strange to me that I can print out the attribute value I want to use next to the quantity box on the cart page, but not be able to do anything with it in quantity_box.twip.

I'm new to this type of programming, so I'm guessing I'm missing some concepts. But boy, this seems far more more difficult to do than it should be.

Thanks
Reply With Quote