| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
x5 - Finding the selected attribute in PHP | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
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:
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?
__________________
Core version: 5.5.xx |
|||||||
#2
|
|||||||||
|
|||||||||
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?
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
#3
|
|||||||
|
|||||||
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.
__________________
Core version: 5.5.xx |
|||||||
#4
|
|||||||
|
|||||||
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?
__________________
5.2.6 |
|||||||
#5
|
|||||||||
|
|||||||||
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?
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
#6
|
|||||||
|
|||||||
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:
__________________
5.2.6 |
|||||||
|
#7
|
|||||||
|
|||||||
Re: x5 - Finding the selected attribute in PHP
Quote:
I did mine in JavaScript in the end.
__________________
Core version: 5.5.xx |
|||||||
|
|||
X-Cart forums © 2001-2020
|