Krio Posted July 16, 2016 Share Posted July 16, 2016 Is it possible to do that on prestashop with a module or withe the basic prestashop settings? Link to comment Share on other sites More sharing options...
rocky Posted July 17, 2016 Share Posted July 17, 2016 It's not possible to do that with PrestaShop's settings, but there is a paid module called Attribute Grid here that does it. Link to comment Share on other sites More sharing options...
Krio Posted July 17, 2016 Author Share Posted July 17, 2016 It's not possible to do that with PrestaShop's settings, but there is a paid module called Attribute Grid here that does it. Okay thanks perfect man ONE last question when you have like multiple products with like different size and 1 size is out of stock it doesn't go automatically on the one with stock how can you change it so that when that size is out of stock it goes automatically on the one with stock instead Link to comment Share on other sites More sharing options...
rocky Posted July 17, 2016 Share Posted July 17, 2016 PrestaShop doesn't have a setting for that either. It would require writing an override that changes the default combination after getting the product information. Link to comment Share on other sites More sharing options...
Krio Posted July 17, 2016 Author Share Posted July 17, 2016 PrestaShop doesn't have a setting for that either. It would require writing an override that changes the default combination after getting the product information. Ok thanks so no module does that? Link to comment Share on other sites More sharing options...
rocky Posted July 17, 2016 Share Posted July 17, 2016 I did a quick search of the forums and found this module. Link to comment Share on other sites More sharing options...
Krio Posted July 17, 2016 Author Share Posted July 17, 2016 (edited) I did a quick search of the forums and found this module. Thanks mate for the help it looks nice but you know where you see the products it still says Product available with different options I want it to display the one that is available Edited July 17, 2016 by Krio (see edit history) Link to comment Share on other sites More sharing options...
rocky Posted July 18, 2016 Share Posted July 18, 2016 It is quite difficult, but I've tried to write an override. Try creating override/controllers/front/CategoryController.php with the following: <?php class CategoryController extends CategoryControllerCore { public function assignProductList() { parent::assignProductList(); foreach ($this->cat_products as &$cat_product) { $product = new Product((int)$cat_product['id_product']); if (Validate::isLoadedObject($product)) { $combinations = $product->getAttributeCombinations((int)$this->context->language->id); $default_attribute = (int)Product::getDefaultAttribute((int)$product->id); $default_quantity = 0; $first_with_quantity = 0; $first_minimal_quantity = 0; $first_attribute_price = 0; foreach ($combinations as $combination) { if ($combination['id_product_attribute'] == $default_attribute) { $default_quantity = $combination['quantity']; } else if ($first_with_quantity == 0 && $combination['quantity'] > 0) { $first_with_quantity = $combination['id_product_attribute']; $first_quantity = $combination['quantity']; $first_minimal_quantity = $combination['minimal_quantity']; $first_attribute_price = $combination['price']; } } if ($default_quantity == 0 && $first_with_quantity > 0) { $cat_product['available_for_order'] = "1"; $cat_product['id_product_attribute'] = $first_with_quantity; $cat_product['cache_default_attribute'] = $first_with_quantity; $cat_product['quantity'] = $first_quantity; $cat_product['product_attribute_minimal_quantity'] = $first_minimal_quantity; $cat_product['price'] = $cat_product['price'] - $cat_product['attribute_price'] + $first_attribute_price; $cat_product['price_tax_exc'] = Product::getPriceStatic( (int)$product->id, false, $first_with_quantity, (Product::$_taxCalculationMethod == PS_TAX_EXC ? 2 : 6) ); if (Product::$_taxCalculationMethod == PS_TAX_EXC) { $cat_product['price_tax_exc'] = Tools::ps_round($cat_product['price_tax_exc'], 2); $cat_product['price'] = Product::getPriceStatic( (int)$product->id, true, $first_with_quantity, 6 ); $cat_product['price_without_reduction'] = Product::getPriceStatic( (int)$product->id, false, $first_with_quantity, 2, null, false, false ); } else { $row['price'] = Tools::ps_round( Product::getPriceStatic( (int)$product->id, true, $first_with_quantity, 6 ), (int)Configuration::get('PS_PRICE_DISPLAY_PRECISION') ); $row['price_without_reduction'] = Product::getPriceStatic( (int)$product->id, true, $first_with_quantity, 6, null, false, false ); } $cat_product['orderprice'] = $cat_product['price_tax_exc']; } } } } } Remember to go to Advanced Parameters > Performance and click the "Clear cache" button (or manually delete cache/class_index.php) so PrestaShop finds the override. I didn't have time to fully test this code, so it may need to be improved. Link to comment Share on other sites More sharing options...
Krio Posted September 8, 2016 Author Share Posted September 8, 2016 so anybody KNOW where I can get this module?? 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