Commit 35e9527ba8436981fca833ccea9fc33b1709a29b
1 parent
4d93fdee
Cargamos los eans apartir del id del producto y combinación.
Showing
3 changed files
with
16 additions
and
3 deletions
FuncionesImaxMultiEAN.php
| @@ -40,5 +40,18 @@ class FuncionesImaxMultiEAN { | @@ -40,5 +40,18 @@ class FuncionesImaxMultiEAN { | ||
| 40 | 40 | ||
| 41 | return $resultado; | 41 | return $resultado; |
| 42 | } | 42 | } |
| 43 | - | 43 | + |
| 44 | + /** | ||
| 45 | + * Devuelve los eans13 asociados a un producto | ||
| 46 | + * @param mixed $idProduct | ||
| 47 | + * @param mixed $idProductAttribute | ||
| 48 | + * @return array | ||
| 49 | + */ | ||
| 50 | + public function getEansByIds($idProduct, $idProductAttribute){ | ||
| 51 | + $idProduct = (int) $idProduct; | ||
| 52 | + $idProductAttribute = (int) $idProductAttribute; | ||
| 53 | + $sql = 'SELECT `ean13` FROM ' . _DB_PREFIX_ . $this->modulo->prefijo . "multiean WHERE `id_product` = '$idProduct' AND `id_product_attribute` = '$idProductAttribute'"; | ||
| 54 | + $resultado = Db::getInstance()->executeS($sql); | ||
| 55 | + return $resultado; | ||
| 56 | + } | ||
| 44 | } | 57 | } |
config.xml
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | <module> | 2 | <module> |
| 3 | <name>imaxmultiean</name> | 3 | <name>imaxmultiean</name> |
| 4 | <displayName><![CDATA[Gestor de EANs Múltiples]]></displayName> | 4 | <displayName><![CDATA[Gestor de EANs Múltiples]]></displayName> |
| 5 | - <version><![CDATA[1.5]]></version> | 5 | + <version><![CDATA[1.6]]></version> |
| 6 | <description><![CDATA[Permite añadir y gestionar múltiples códigos EAN para cada producto y combinación.]]></description> | 6 | <description><![CDATA[Permite añadir y gestionar múltiples códigos EAN para cada producto y combinación.]]></description> |
| 7 | <author><![CDATA[Informax]]></author> | 7 | <author><![CDATA[Informax]]></author> |
| 8 | <tab><![CDATA[administration]]></tab> | 8 | <tab><![CDATA[administration]]></tab> |
imaxmultiean.php
| @@ -22,7 +22,7 @@ class ImaxMultiEAN extends Module { | @@ -22,7 +22,7 @@ class ImaxMultiEAN extends Module { | ||
| 22 | $this->name = 'imaxmultiean'; | 22 | $this->name = 'imaxmultiean'; |
| 23 | $this->tab = 'administration'; | 23 | $this->tab = 'administration'; |
| 24 | $this->path = _PS_MODULE_DIR_ . $this->name . '/'; | 24 | $this->path = _PS_MODULE_DIR_ . $this->name . '/'; |
| 25 | - $this->version = '1.5'; | 25 | + $this->version = '1.6'; |
| 26 | $this->author = 'Informax'; | 26 | $this->author = 'Informax'; |
| 27 | $this->need_instance = 0; | 27 | $this->need_instance = 0; |
| 28 | $this->idManual = ''; | 28 | $this->idManual = ''; |