shpetimi Posted July 6, 2015 Share Posted July 6, 2015 Is it possible to get attribute names in the priceCalculation() function inside the Product.php class based on the $id_product_attribute variable? what could be the mysql query for this? Link to comment Share on other sites More sharing options...
vekia Posted July 6, 2015 Share Posted July 6, 2015 if you've got an id of attribute you can just simply use Combination class $combination = new Combination($id_product_attribute); then $combination variable will store each available combination object definition 1 Link to comment Share on other sites More sharing options...
shpetimi Posted July 6, 2015 Author Share Posted July 6, 2015 Thank you Vekia, I tried the Combination class with print_r($combination) and as I can see there it doesnt fetch the name column from the attribute_lang. Because I need the attribute names. Basically I am trying to change the PriceCalculation() function. so in order to do that I need the attribute names because the calculation formula that I am trying to implement depends on the selected attributes (2 selected attributes) to show the price in cart, etc.. In the product page it works because I implemented this with javascript. But I need to fetch the selected attributes to show the price based on those attributes. (Note: I am not using prestashop default combinations). Link to comment Share on other sites More sharing options...
savvato Posted July 6, 2015 Share Posted July 6, 2015 $combination = new Combination($id_product_attribute); $arr = $combination->getAttributesName($id_lang); p($arr); 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now