borjamulleras Posted March 8, 2015 Share Posted March 8, 2015 Hola, Estoy desarrollando un módulo y tengo la necesidad de mostrar un listado de todas las combinaciones como tal. He encontrado funciones que me muestra listados de atributos y que me hace referencia al id de la combinación, pero no un listado tal cual de las combinaciones. ¿Me podéis decir algún método/función que recupere tal cual las combinaciones? ¿O se ha de hacer programáticamente? Es decir, puedo tener los atributos talla: S, M y L y otro color Blanco y Negro y lo que quiero obtener son el listado del producto de ambos atributos, es decir: S Blanco id_combinacion S Negro id_combinacion M Blanco id_combinacion M Negro id_combinacion L Blanco id_combinacion L Negro id_combinacion y sus correspondientes ID's de combinación. Muchas gracias!! Link to comment Share on other sites More sharing options...
ventura Posted March 8, 2015 Share Posted March 8, 2015 Eso lo tienes en el modulo Layered navigation block Todo lo relacionado con los atributos asociados a productos lo tienes en la funcion de la clase Product.php getAttributeCombinations 1 Link to comment Share on other sites More sharing options...
borjamulleras Posted March 8, 2015 Author Share Posted March 8, 2015 (edited) Hola Ventura!! Gracias por responder. Pero la función que me indicas devuelve la información, atributo atributo, no el listado de combinaciones del producto que es lo que pregunto si existe. Y, estoy de acuerdo que con este información y el campo id_product_attribute se puede deducir, pero yo buscaba algo superdirecto. Para ser más concreto, quiero saber a partir de la elección de dos atributos por ejemplo la Talla M y el Color Negro, cual es el id_Combination. Y con la información que me proporciona esta función, me parece farragoso encontrarlo. A modo de ejemplo es paso impresión lo que devuelve esta función que me comentas: Array ([0] => Array ( [id_product_attribute] => 7 [id_product] => 2 [reference] => [supplier_reference] => [location] => [ean13] => [upc] => [wholesale_price] => 0.000000 [price] => 0.000000 [ecotax] => 0.000000 [quantity] => 299 [weight] => 0.000000 [unit_price_impact] => 0.000000 [default_on] => 1 [minimal_quantity] => 1 [available_date] => 0000-00-00 [id_shop] => 1 [id_attribute_group] => 1 [is_color_group] => 0 [group_name] => Size [attribute_name] => S [id_attribute] => 1 )[1] => Array ( [id_product_attribute] => 7 [id_product] => 2 [reference] => [supplier_reference] => [location] => [ean13] => [upc] => [wholesale_price] => 0.000000 [price] => 0.000000 [ecotax] => 0.000000 [quantity] => 299 [weight] => 0.000000 [unit_price_impact] => 0.000000 [default_on] => 1 [minimal_quantity] => 1 [available_date] => 0000-00-00 [id_shop] => 1 [id_attribute_group] => 3 [is_color_group] => 1 [group_name] => Color [attribute_name] => Negro [id_attribute] => 11 )[2] => Array ( [id_product_attribute] => 8 [id_product] => 2 [reference] => [supplier_reference] => [location] => [ean13] => [upc] => [wholesale_price] => 0.000000 [price] => 0.000000 [ecotax] => 0.000000 [quantity] => 300 [weight] => 0.000000 [unit_price_impact] => 0.000000 [default_on] => 0 [minimal_quantity] => 1 [available_date] => 0000-00-00 [id_shop] => 1 [id_attribute_group] => 1 [is_color_group] => 0 [group_name] => Size [attribute_name] => S [id_attribute] => 1 )[3] => Array ( [id_product_attribute] => 8 [id_product] => 2 [reference] => [supplier_reference] => [location] => [ean13] => [upc] => [wholesale_price] => 0.000000 [price] => 0.000000 [ecotax] => 0.000000 [quantity] => 300 [weight] => 0.000000 [unit_price_impact] => 0.000000 [default_on] => 0 [minimal_quantity] => 1 [available_date] => 0000-00-00 [id_shop] => 1 [id_attribute_group] => 3 [is_color_group] => 1 [group_name] => Color [attribute_name] => Blanco [id_attribute] => 8 )[4] => Array ( [id_product_attribute] => 9 [id_product] => 2 [reference] => [supplier_reference] => [location] => [ean13] => [upc] => [wholesale_price] => 0.000000 [price] => 0.000000 [ecotax] => 0.000000 [quantity] => 300 [weight] => 0.000000 [unit_price_impact] => 0.000000 [default_on] => 0 [minimal_quantity] => 1 [available_date] => 0000-00-00 [id_shop] => 1 [id_attribute_group] => 1 [is_color_group] => 0 [group_name] => Size [attribute_name] => M [id_attribute] => 2 )[5] => Array ( [id_product_attribute] => 9 [id_product] => 2 [reference] => [supplier_reference] => [location] => [ean13] => [upc] => [wholesale_price] => 0.000000 [price] => 0.000000 [ecotax] => 0.000000 [quantity] => 300 [weight] => 0.000000 [unit_price_impact] => 0.000000 [default_on] => 0 [minimal_quantity] => 1 [available_date] => 0000-00-00 [id_shop] => 1 [id_attribute_group] => 3 [is_color_group] => 1 [group_name] => Color [attribute_name] => Negro [id_attribute] => 11 )[6] => Array ( [id_product_attribute] => 10 [id_product] => 2 [reference] => [supplier_reference] => [location] => [ean13] => [upc] => [wholesale_price] => 0.000000 [price] => 0.000000 [ecotax] => 0.000000 [quantity] => 300 [weight] => 0.000000 [unit_price_impact] => 0.000000 [default_on] => 0 [minimal_quantity] => 1 [available_date] => 0000-00-00 [id_shop] => 1 [id_attribute_group] => 1 [is_color_group] => 0 [group_name] => Size [attribute_name] => M [id_attribute] => 2 )[7] => Array ( [id_product_attribute] => 10 [id_product] => 2 [reference] => [supplier_reference] => [location] => [ean13] => [upc] => [wholesale_price] => 0.000000 [price] => 0.000000 [ecotax] => 0.000000 [quantity] => 300 [weight] => 0.000000 [unit_price_impact] => 0.000000 [default_on] => 0 [minimal_quantity] => 1 [available_date] => 0000-00-00 [id_shop] => 1 [id_attribute_group] => 3 [is_color_group] => 1 [group_name] => Color [attribute_name] => Blanco [id_attribute] => 8 )[8] => Array ( [id_product_attribute] => 11 [id_product] => 2 [reference] => [supplier_reference] => [location] => [ean13] => [upc] => [wholesale_price] => 0.000000 [price] => 0.000000 [ecotax] => 0.000000 [quantity] => 300 [weight] => 0.000000 [unit_price_impact] => 0.000000 [default_on] => 0 [minimal_quantity] => 1 [available_date] => 0000-00-00 [id_shop] => 1 [id_attribute_group] => 1 [is_color_group] => 0 [group_name] => Size [attribute_name] => L [id_attribute] => 3 )[9] => Array ( [id_product_attribute] => 11 [id_product] => 2 [reference] => [supplier_reference] => [location] => [ean13] => [upc] => [wholesale_price] => 0.000000 [price] => 0.000000 [ecotax] => 0.000000 [quantity] => 300 [weight] => 0.000000 [unit_price_impact] => 0.000000 [default_on] => 0 [minimal_quantity] => 1 [available_date] => 0000-00-00 [id_shop] => 1 [id_attribute_group] => 3 [is_color_group] => 1 [group_name] => Color [attribute_name] => Negro [id_attribute] => 11 )[10] => Array ( [id_product_attribute] => 12 [id_product] => 2 [reference] => [supplier_reference] => [location] => [ean13] => [upc] => [wholesale_price] => 0.000000 [price] => 0.000000 [ecotax] => 0.000000 [quantity] => 300 [weight] => 0.000000 [unit_price_impact] => 0.000000 [default_on] => 0 [minimal_quantity] => 1 [available_date] => 0000-00-00 [id_shop] => 1 [id_attribute_group] => 1 [is_color_group] => 0 [group_name] => Size [attribute_name] => L [id_attribute] => 3 )[11] => Array ( [id_product_attribute] => 12 [id_product] => 2 [reference] => [supplier_reference] => [location] => [ean13] => [upc] => [wholesale_price] => 0.000000 [price] => 0.000000 [ecotax] => 0.000000 [quantity] => 300 [weight] => 0.000000 [unit_price_impact] => 0.000000 [default_on] => 0 [minimal_quantity] => 1 [available_date] => 0000-00-00 [id_shop] => 1 [id_attribute_group] => 3 [is_color_group] => 1 [group_name] => Color [attribute_name] => Blanco [id_attribute] => 8 )) Edited March 8, 2015 by borjamulleras (see edit history) Link to comment Share on other sites More sharing options...
ventura Posted March 8, 2015 Share Posted March 8, 2015 Depende de donde quieras capturar esa informacion, listado de productos, pagina de producto, carrito, pedido... Link to comment Share on other sites More sharing options...
borjamulleras Posted March 8, 2015 Author Share Posted March 8, 2015 A partir del objeto producto, es un módulo que se enganchará en el carrito y que mostrará un producto determinado a partir del contenido del carrito. Link to comment Share on other sites More sharing options...
ventura Posted March 8, 2015 Share Posted March 8, 2015 Entonces pienso que deberias tomarlo de $params['cart']->getProducts y alli coger id_product_attribute Link to comment Share on other sites More sharing options...
borjamulleras Posted March 8, 2015 Author Share Posted March 8, 2015 Entiendo que esta es la forma de capturar los productos del carrito que también lo necesito para mi siguiente fase, pero los atributos que necesito son de un producto que no se encuentra en el carrito, un producto que quiero añadir posteriormente al carrito como venta cruzada, pero que lo mostraré allí para que el usuario pueda añadirlo al carrito. Link to comment Share on other sites More sharing options...
Recommended Posts