Consulta SQL para exportar productos con atributos en Prestashop

Desde el Gestor SQL / Generador de informes, podemos informes sobre distintos datos de la tienda y exportar datos, como puede ser un listado de los productos sin atributos de tu tienda Prestashop.

Generar informe y exportar datos en Prestashop
SELECT m.name AS manufacturer, p.id_product, pl.name, GROUP_CONCAT(DISTINCT(al.name) SEPARATOR ", ") AS combinations,

GROUP_CONCAT(DISTINCT(cl.name) SEPARATOR ",") AS categories, p.price, pa.price, p.id_tax_rules_group, p.wholesale_price,
p.reference, p.supplier_reference, p.id_supplier, p.id_manufacturer, p.upc, p.ecotax, p.weight, s.quantity,
pl.description_short, pl.description, pl.meta_title, pl.meta_keywords, pl.meta_description, pl.link_rewrite,
pl.available_now, pl.available_later, p.available_for_order, p.date_add, p.show_price, p.online_only, p.condition,
p.id_shop_default
FROM ps_product p
LEFT JOIN ps_product_lang pl ON (p.id_product = pl.id_product)
LEFT JOIN ps_manufacturer m ON (p.id_manufacturer = m.id_manufacturer)
LEFT JOIN ps_category_product cp ON (p.id_product = cp.id_product)
LEFT JOIN ps_category_lang cl ON (cp.id_category = cl.id_category)
LEFT JOIN ps_category c ON (cp.id_category = c.id_category)
LEFT JOIN ps_stock_available s ON (p.id_product = s.id_product)
LEFT JOIN ps_product_tag pt ON (p.id_product = pt.id_product)
LEFT JOIN ps_product_attribute pa ON (p.id_product = pa.id_product)
LEFT JOIN ps_product_attribute_combination pac ON (pac.id_product_attribute = pa.id_product_attribute)
LEFT JOIN ps_attribute_lang al ON (al.id_attribute = pac.id_attribute)
WHERE pl.id_lang = 1
AND cl.id_lang = 1
AND p.id_shop_default = 1
AND c.id_shop_default = 1
GROUP BY pac.id_product_attribute

PosData: Si el prefijo de las tablas de tu tienda Prestashop es distinto a “ps_” debes cambiarlo por el tuyo, sino la consulta no funcionara.

Más información en el foro de Prestashop:

https://www.prestashop.com/forums/topic/468470-sql-query-to-get-product-stock-for-all-combinations/

* Actualización del artículo
Otros enlaces de interés: 
https://www.team-ever.com/prestashop-requetes-sql-utiles/

Otros temas relacionados con información similar en el blog:
Consulta SQL para exportar productos

Listado de hooks en Prestashop

Tipos de hook

Los hooks “action” se ejecutan cuando se realiza una “acción”, un ejemplo podría ser el hook -> actionValidateOrder que se ejecuta al realizar un pedido. Estos hooks no cargan valores de visualización, nos sirven de utilidad para realizar determinar acciones que se ejecutan de forma interna.

Los hooks “display” nos devuelven información que cargamos en nuestra tienda, un ejemplo podría ser el: displayFooter que es un hook situado en el pie de página donde podemos ver que carga distintos módulos. Tenemos disponibles tanto hooks de visualización del backoffice cómo del frontoffice.

Hooks en Prestashop 1.6

Listado de hooks (conocido popularmente como posiciones) obtenidos en una instalación limpia de Prestashop 1.6.

Datos obtenidos en base a la tabla: ps_hook

Obtener hooks
Obtener hooks
  • displayPayment
  • actionValidateOrder
  • displayMaintenance
  • actionPaymentConfirmation
  • displayPaymentReturn
  • actionUpdateQuantity
  • displayRightColumn
  • displayLeftColumn
  • displayHome
  • Header
  • actionCartSave
  • actionAuthentication
  • actionProductAdd
  • actionProductUpdate
  • displayTop
  • displayRightColumnProduct
  • actionProductDelete
  • displayFooterProduct
  • displayInvoice
  • actionOrderStatusUpdate
  • displayAdminOrder
  • displayAdminOrderTabOrder
  • displayAdminOrderTabShip
  • displayAdminOrderContentOrder
  • displayAdminOrderContentShip
  • displayFooter
  • displayPDFInvoice
  • displayInvoiceLegalFreeText
  • displayAdminCustomers
  • displayOrderConfirmation
  • actionCustomerAccountAdd
  • displayCustomerAccount
  • displayCustomerIdentityForm
  • actionOrderSlipAdd
  • displayProductTab
  • displayProductTabContent
  • displayShoppingCartFooter
  • displayCustomerAccountForm
  • displayAdminStatsModules
  • displayAdminStatsGraphEngine
  • actionOrderReturn
  • displayProductButtons
  • displayBackOfficeHome
  • displayAdminStatsGridEngine
  • actionWatermark
  • actionProductCancel
  • displayLeftColumnProduct
  • actionProductOutOfStock
  • actionProductAttributeUpdate
  • displayCarrierList
  • displayShoppingCart
  • actionSearch
  • displayBeforePayment
  • actionCarrierUpdate
  • actionOrderStatusPostUpdate
  • displayCustomerAccountFormTop
  • displayBackOfficeHeader
  • displayBackOfficeTop
  • displayBackOfficeFooter
  • actionProductAttributeDelete
  • actionCarrierProcess
  • actionOrderDetail
  • displayBeforeCarrier
  • displayOrderDetail
  • actionPaymentCCAdd
  • displayProductComparison
  • actionCategoryAdd
  • actionCategoryUpdate
  • actionCategoryDelete
  • actionBeforeAuthentication
  • displayPaymentTop
  • actionHtaccessCreate
  • actionAdminMetaSave
  • displayAttributeGroupForm
  • actionAttributeGroupSave
  • actionAttributeGroupDelete
  • displayFeatureForm
  • actionFeatureSave
  • actionFeatureDelete
  • actionProductSave
  • actionProductListOverride
  • displayAttributeGroupPostProcess
  • displayFeaturePostProcess
  • displayFeatureValueForm
  • displayFeatureValuePostProcess
  • actionFeatureValueDelete
  • actionFeatureValueSave
  • displayAttributeForm
  • actionAttributePostProcess
  • actionAttributeDelete
  • actionAttributeSave
  • actionTaxManager
  • displayMyAccountBlock
  • actionModuleInstallBefore
  • actionModuleInstallAfter
  • displayHomeTab
  • displayHomeTabContent
  • displayTopColumn
  • displayBackOfficeCategory
  • displayProductListFunctionalButtons
  • displayNav
  • displayOverrideTemplate
  • actionAdminLoginControllerSetMedia
  • actionOrderEdited
  • actionEmailAddBeforeContent
  • actionEmailAddAfterContent
  • displayCartExtraProductActions
  • actionObjectProductUpdateAfter
  • actionObjectProductDeleteAfter
  • displayCompareExtraInformation
  • displaySocialSharing
  • displayBanner
  • actionObjectLanguageAddAfter
  • displayPaymentEU
  • actionCartListOverride
  • actionAdminMetaControllerUpdate_optionsBefore
  • actionAdminLanguagesControllerStatusBefore
  • actionObjectCmsUpdateAfter
  • actionObjectCmsDeleteAfter
  • actionShopDataDuplication
  • actionAdminStoresControllerUpdate_optionsAfter
  • actionObjectManufacturerDeleteAfter
  • actionObjectManufacturerAddAfter
  • actionObjectManufacturerUpdateAfter
  • actionModuleRegisterHookAfter
  • actionModuleUnRegisterHookAfter
  • displayMyAccountBlockfooter
  • displayMobileTopSiteMap
  • displaySearch
  • actionObjectSupplierDeleteAfter
  • actionObjectSupplierAddAfter
  • actionObjectSupplierUpdateAfter
  • actionObjectCategoryUpdateAfter
  • actionObjectCategoryDeleteAfter
  • actionObjectCategoryAddAfter
  • actionObjectCmsAddAfter
  • actionObjectProductAddAfter
  • dashboardZoneOne
  • dashboardData
  • actionObjectOrderAddAfter
  • actionObjectCustomerAddAfter
  • actionObjectCustomerMessageAddAfter
  • actionObjectCustomerThreadAddAfter
  • actionObjectOrderReturnAddAfter
  • actionAdminControllerSetMedia
  • dashboardZoneTwo
  • actionAdminMetaControllerUpdate_optionsAfter
  • actionAdminPerformanceControllerSaveAfter
  • actionObjectCarrierAddAfter
  • actionObjectContactAddAfter
  • actionAdminThemesControllerUpdate_optionsAfter
  • actionObjectShopUpdateAfter
  • actionAdminPreferencesControllerUpdate_optionsAfter
  • actionObjectShopAddAfter
  • actionObjectShopGroupAddAfter
  • actionObjectCartAddAfter
  • actionObjectEmployeeAddAfter
  • actionObjectImageAddAfter
  • actionObjectCartRuleAddAfter
  • actionAdminStoresControllerSaveAfter
  • actionAdminWebserviceControllerSaveAfter

PosData: En la misma tabla ps_hook en el campo “description” tenéis a que corresponde a cada hook o al menos una descripción:

Descripción hooks

* Actualización artículo

Hooks en Prestashop 1.7

Enlace de Hooks en Prestashop 1.7.1.0 con información de que en fichero se encuentran: Acceder a la información.

  • Nueva actualización de artículo para Prestashop 1.7.3.0 beta1
    Todos los hooks que tiene Prestashop 1.7.3.0 beta 1

    Obtener datos de los hooks
    • actionValidateOrder
    • displayMaintenance
    • displayProductPageDrawer
    • actionPaymentConfirmation
    • displayPaymentReturn
    • actionUpdateQuantity
    • displayRightColumn
    • displayWrapperTop
    • displayWrapperBottom
    • displayContentWrapperTop
    • displayContentWrapperBottom
    • displayLeftColumn
    • displayHome
    • Header
    • actionCartSave
    • actionAuthentication
    • actionProductAdd
    • actionProductUpdate
    • displayAfterBodyOpeningTag
    • displayBeforeBodyClosingTag
    • displayTop
    • displayNavFullWidth
    • displayRightColumnProduct
    • actionProductDelete
    • actionObjectProductInCartDeleteBefore
    • actionObjectProductInCartDeleteAfter
    • displayFooterProduct
    • displayInvoice
    • actionOrderStatusUpdate
    • displayAdminOrder
    • displayAdminOrderTabOrder
    • displayAdminOrderTabShip
    • displayAdminOrderContentOrder
    • displayAdminOrderContentShip
    • displayFooter
    • displayPDFInvoice
    • displayInvoiceLegalFreeText
    • displayAdminCustomers
    • displayAdminCustomersAddressesItemAction
    • displayOrderConfirmation
    • actionCustomerAccountAdd
    • actionCustomerAccountUpdate
    • displayCustomerAccount
    • actionOrderSlipAdd
    • displayShoppingCartFooter
    • displayCreateAccountEmailFormBottom
    • displayAuthenticateFormBottom
    • displayCustomerAccountForm
    • displayAdminStatsModules
    • displayAdminStatsGraphEngine
    • actionOrderReturn
    • displayProductAdditionalInfo
    • displayBackOfficeHome
    • displayAdminStatsGridEngine
    • actionWatermark
    • actionProductCancel
    • displayLeftColumnProduct
    • actionProductOutOfStock
    • actionProductAttributeUpdate
    • displayCarrierList
    • displayShoppingCart
    • actionCarrierUpdate
    • actionOrderStatusPostUpdate
    • displayCustomerAccountFormTop
    • displayBackOfficeHeader
    • displayBackOfficeTop
    • displayBackOfficeFooter
    • actionProductAttributeDelete
    • actionCarrierProcess
    • displayBeforeCarrier
    • displayAfterCarrier
    • displayOrderDetail
    • actionPaymentCCAdd
    • actionCategoryAdd
    • actionCategoryUpdate
    • actionCategoryDelete
    • displayPaymentTop
    • actionHtaccessCreate
    • actionAdminMetaSave
    • displayAttributeGroupForm
    • actionAttributeGroupSave
    • actionAttributeGroupDelete
    • displayFeatureForm
    • actionFeatureSave
    • actionFeatureDelete
    • actionProductSave
    • displayAttributeGroupPostProcess
    • displayFeaturePostProcess
    • displayFeatureValueForm
    • displayFeatureValuePostProcess
    • actionFeatureValueDelete
    • actionFeatureValueSave
    • displayAttributeForm
    • actionAttributePostProcess
    • actionAttributeDelete
    • actionAttributeSave
    • actionTaxManager
    • displayMyAccountBlock
    • actionModuleInstallBefore
    • actionModuleInstallAfter
    • displayTopColumn
    • displayBackOfficeCategory
    • displayProductListFunctionalButtons
    • displayNav
    • displayOverrideTemplate
    • actionAdminLoginControllerSetMedia
    • actionOrderEdited
    • actionEmailAddBeforeContent
    • actionEmailAddAfterContent
    • sendMailAlterTemplateVars
    • displayCartExtraProductActions
    • displayPaymentByBinaries
    • additionalCustomerFormFields
    • addWebserviceResources
    • displayCustomerLoginFormAfter
    • actionClearCache
    • actionClearCompileCache
    • actionClearSf2Cache
    • actionValidateCustomerAddressForm
    • displayCarrierExtraContent
    • validateCustomerFormFields
    • displayProductExtraContent
    • filterCmsContent
    • filterCmsCategoryContent
    • filterProductContent
    • filterCategoryContent
    • filterManufacturerContent
    • filterSupplierContent
    • filterHtmlContent
    • displayDashboardTop
    • actionUpdateLangAfter
    • actionOutputHTMLBefore
    • displayAfterProductThumbs
    • actionDispatcherBefore
    • actionDispatcherAfter
    • filterProductSearch
    • actionProductSearchAfter
    • actionEmailSendBefore
    • displayAdminProductsMainStepLeftColumnMiddle
    • displayAdminProductsMainStepLeftColumnBottom
    • displayAdminProductsMainStepRightColumnBottom
    • displayAdminProductsQuantitiesStepBottom
    • displayAdminProductsPriceStepBottom
    • displayAdminProductsOptionsStepTop
    • displayAdminProductsOptionsStepBottom
    • displayAdminProductsSeoStepBottom
    • displayAdminProductsShippingStepBottom
    • displayAdminProductsCombinationBottom
    • displayDashboardToolbarTopMenu
    • displayDashboardToolbarIcons
    • dashboardZoneOne
    • dashboardData
    • actionObjectOrderAddAfter
    • actionObjectCustomerAddAfter
    • actionObjectCustomerMessageAddAfter
    • actionObjectCustomerThreadAddAfter
    • actionObjectOrderReturnAddAfter
    • actionAdminControllerSetMedia
    • dashboardZoneTwo
    • actionSearch
    • actionObjectLanguageAddAfter
    • paymentOptions
    • displayNav1
    • actionAdminStoresControllerUpdate_optionsAfter
    • actionAdminCurrenciesControllerSaveAfter
    • actionModuleRegisterHookAfter
    • actionModuleUnRegisterHookAfter
    • displayFooterBefore
    • displayAdminCustomersForm
    • productSearchProvider
    • displayOrderConfirmation2
    • displayCrossSellingShoppingCart
    • actionAdminGroupsControllerSaveAfter
    • actionShopDataDuplication
    • actionObjectCategoryUpdateAfter
    • actionObjectCategoryDeleteAfter
    • actionObjectCategoryAddAfter
    • actionObjectCmsUpdateAfter
    • actionObjectCmsDeleteAfter
    • actionObjectCmsAddAfter
    • actionObjectSupplierUpdateAfter
    • actionObjectSupplierDeleteAfter
    • actionObjectSupplierAddAfter
    • actionObjectManufacturerUpdateAfter
    • actionObjectManufacturerDeleteAfter
    • actionObjectManufacturerAddAfter
    • actionObjectProductUpdateAfter
    • actionObjectProductDeleteAfter
    • actionObjectProductAddAfter
    • displaySearch
    • displayAdminNavBarBeforeEnd
    • displayAdminAfterHeader
    • displayNav2
    • displayReassurance

Recordar que en el campo “Description” de la tabla ps_hook podéis obtener mas información sobre los hooks.

Información hooks