x5 - Finding the selected attribute in PHP
I'm working on a module that creates a SKU dynamically. I need to find the currently selected options on the product page.
So far I have this in my View... Code:
/** and in the template: Code:
{foreach:getAttributeValues(),key,value} Which outputs this: + Select ID: 51 Option ID: 247 ~~~Option Name ID : 117 ~~~Option Name : flat ~~~Option Name ID : 118 ~~~Option Name : metallic +++ + Select ID: 52 Option ID: 249 ~~~Option Name ID : 119 ~~~Option Name : normal ~~~Option Name ID : 120 ~~~Option Name : big +++ All very nice except I can't work out how to find which options are currently selected. I've tried various methods including working with Code:
/** Anyone any idea? |
Re: x5 - Finding the selected attribute in PHP
I believe the method that retrieves attributes selected on the page is this one:
\XLite\View\Product\Details\Customer\Widget::getAt tributeValues() Is it what you are looking for? |
Re: x5 - Finding the selected attribute in PHP
I've used that to get the options but I need to know which option values are currently selected.
|
Re: x5 - Finding the selected attribute in PHP
I'm working on a similar situation. Did you ever figure out the answer to this puzzle?
|
Re: x5 - Finding the selected attribute in PHP
Quote:
What is the page and what is the class where you need information on the selected attributes? |
Re: x5 - Finding the selected attribute in PHP
Quote:
I needed this on the Product page so I could calculate a price based on Width, Length, and Height. After searching some other posts I cam up with a solution. Knowing the id of the attribute I wanted to check the value for (619-620) I found the following to work: PHP Code:
|
Re: x5 - Finding the selected attribute in PHP
Quote:
I did mine in JavaScript in the end. |
All times are GMT -8. The time now is 11:20 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.