X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Pulling product product attributes into quantity_box.twig (https://forum.x-cart.com/showthread.php?t=77029)

David Harrison 07-03-2019 08:07 AM

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


All times are GMT -8. The time now is 09:47 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.