FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour EXPORTAR DATOS FW A PRESTASHOP [SOLUCIONADO PROBLEMA IMAGEN]
Posts: 199
Joined: Wed Jan 02, 2019 08:36 AM
EXPORTAR DATOS FW A PRESTASHOP [SOLUCIONADO PROBLEMA IMAGEN]
Posted: Mon Dec 26, 2022 08:43 AM

Buenos dias a todos y Felices Fiestas.

Quiero, en este a帽o nuevo, poder exportar desde mi aplicaci贸n a mi p谩gina web.

La verdad es que despues de leer los manuales de importaci贸n de Prestashop y todo lo relativo a ficheros CSV, no parece (a priori) complicado.

La idea es exportar los datos y tambien tener sincronizada la Base de Datos con la web.

Pero no se por d贸nde empezar.

Alguien me ayuda con un ejemplo ?

Gracias

Jes煤s Mar铆n
deumare@gmail.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: EXPORTAR DATOS DESDE FW A PRESTASHOP
Posted: Mon Dec 26, 2022 08:49 AM
Buenos dias Jes煤s,

Te responde chatGPT :-) https://chat.openai.com/chat
Para exportar datos desde una aplicaci贸n a una p谩gina web utilizando Prestashop, necesitar谩s seguir los siguientes pasos:

Prepara los datos que deseas exportar: Aseg煤rate de que tienes los datos que deseas exportar en un formato compatible con Prestashop, como un archivo CSV o XML.

Accede a la administraci贸n de Prestashop: Inicia sesi贸n en tu panel de administraci贸n de Prestashop y ve a la p谩gina de importaci贸n de datos.

Selecciona el archivo que deseas importar: Haz clic en el bot贸n "Examinar" y selecciona el archivo que contiene los datos que deseas importar.

Especifica el tipo de importaci贸n: Selecciona la opci贸n "Importar a una nueva tabla" si deseas importar los datos a una tabla nueva en la base de datos de Prestashop. Si deseas actualizar los datos de una tabla existente, selecciona la opci贸n "Actualizar datos existentes".

Configura las opciones de importaci贸n: Configura las opciones de importaci贸n seg煤n tus necesidades, como el idioma y la moneda que deseas utilizar para los datos importados.

Realiza la importaci贸n: Haz clic en el bot贸n "Importar" para iniciar el proceso de importaci贸n de datos. Espera a que se complete el proceso y revisa los resultados para asegurarte de que todo ha ido bien.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: EXPORTAR DATOS DESDE FW A PRESTASHOP
Posted: Mon Dec 26, 2022 08:51 AM
Y sigue explicando...
Para exportar una base de datos en formato DBF a un archivo CSV utilizando Harbour, puedes utilizar la funci贸n DBF2CSV() de la siguiente manera:

DBF2CSV( cFile, cSeparator, lHeader )
Donde:

cFile es la ruta completa del archivo DBF que deseas exportar.
cSeparator es el separador de campos que deseas utilizar en el archivo CSV. Puedes utilizar cualquier car谩cter, como una coma (,) o una tabulaci贸n (\t).
lHeader es un valor l贸gico que indica si deseas incluir una fila de encabezados en el archivo CSV. Si estableces este valor en .T., se incluir谩 una fila con los nombres de los campos en el archivo CSV. Si estableces este valor en .F., no se incluir谩 ninguna fila de encabezados.
Por ejemplo, para exportar el archivo clientes.dbf a un archivo CSV con una coma como separador de campos y con una fila de encabezados, podr铆as utilizar la siguiente l铆nea de c贸digo:

DBF2CSV( "clientes.dbf", ",", .T. )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 199
Joined: Wed Jan 02, 2019 08:36 AM
Re: EXPORTAR DATOS DESDE FW A PRESTASHOP
Posted: Mon Dec 26, 2022 08:56 AM

Buenos dias Antonio

Gracias por responder.

D茅sde que versi贸n de Harbour est谩 la funci贸n DBF2CSV( cFile, cSeparator, lHeader ) ?

Gracias

Jes煤s Mar铆n
deumare@gmail.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: EXPORTAR DATOS DESDE FW A PRESTASHOP
Posted: Mon Dec 26, 2022 09:02 AM
chatGPT habla de una funci贸n DBF2CSV() inexistente e innecesaria ya que puedes usar directamente este comando de Harbour:
COPY TO <targetFile> ;
[FIELDS <fieldNames,...> ;]
[<Scope> ; ]
[WHILE <lWhileCondition> ;]
[FOR <lForCondition> ;]
[VIA <rddName>]
[SDF | DELIMITED [WITH BLANK | TAB | PIPE | <xDelimiter> ] ]
[CODEPAGE <cCodePage>] ;
DELIMITED WITH <xDelimiter>
The WITH option specifies the delimiting character to enclose values of Character fields in. <xDelimiter> can be specified as a literal character or a character expression enclosed in parentheses. <xDelimiter> can also be specified as an array with two elements: { <cCharacterDelimiter>, <cFieldDelimiter> }. If this option is used, the array must be enclosed in parentheses. It defines the delimiting characters for field values of type "C" and the delimiters between field values.
COPY TO newfile DELIMITED WTH ( '"', "," )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 309
Joined: Wed Mar 28, 2018 04:38 PM
Re: EXPORTAR DATOS DESDE FW A PRESTASHOP
Posted: Mon Dec 26, 2022 03:06 PM
Utiliza el wsAPI que integra PrestaShop. Justamente es para lo que necesitas.
https://devdocs.prestashop-project.org/8/webservice/

Enviado desde mi motorola edge 20 mediante Tapatalk
--------

驴 Y porque no ?

驴 And why not ?
Posts: 199
Joined: Wed Jan 02, 2019 08:36 AM
Re: EXPORTAR DATOS DESDE FW A PRESTASHOP
Posted: Tue Dec 27, 2022 04:37 AM
Buenos dias.
Me he pasado un rato probando la funcion ....
Code (fw): Select all Collapse
COPY TO newfile DELIMITED WTH ( '"', "," )
Al final, para que si me genere correctamente el fichero he utilizado la instruccion
Code (fw): Select all Collapse
COPY TO newfile DELIMITED WITH ( { "",";" } )
Tal y como estaba redactado no funcionaba.

Sigo con las pruebas
Jes煤s Mar铆n
deumare@gmail.com
Posts: 309
Joined: Wed Mar 28, 2018 04:38 PM
Re: EXPORTAR DATOS DESDE FW A PRESTASHOP
Posted: Tue Dec 27, 2022 08:38 AM
Hola.
Te comparto una clase que hice de prueba para conectar con el Api de Prestashop. No la he utilizado nunca en producci贸n pero las pruebas que lleva prueba.prg funcionan perfectamente :D

https://github.com/VictorCasajuanaMas/Prestashop

utilizo una clase para los xml que me dej贸 el maestro Cristobal Navarro, espero me permita tambi茅n incluirla en el repositorio, de lo contrario la quito enseguida :wink: .

La clase TPrestashop es sencilla pero tiene las bases para entender el API y a partir de ah铆 hacerla crecer. Al principio yo tambi茅n trabaj茅 la conexi贸n con prestashop mediante ficheros csv, pero para el usuario es m谩s engorroso. Si trabajas a nivel de API lo puedes automatizar absolutamente todo.
Consejo: aunque se puede, no trabajes directamente con la BD MySql que lleva integrada, te puedes volver loco :twisted: .

Si te interesa la clase y la vas vitaminando, estar铆a bien trabajarla desde el repositorio para poder aprovechar las mejoras 8) .

Gracias y salud :D !
--------

驴 Y porque no ?

驴 And why not ?
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: EXPORTAR DATOS DESDE FW A PRESTASHOP
Posted: Tue Dec 27, 2022 08:45 AM

V铆ctor,

Muchas gracias de nuevo por otra de tus aportaciones.

En mi caso no lo necesito a煤n, pero da gusto ver tu c贸digo que a la misma vez que innova est谩 muy bien dise帽ado.

Gracias y felicidades !

Posts: 199
Joined: Wed Jan 02, 2019 08:36 AM
Re: EXPORTAR DATOS DESDE FW A PRESTASHOP
Posted: Tue Dec 27, 2022 09:53 AM

Muchas gracias Victor

Le dar茅 un vistazo a fondo. (porque a primera vista estoy a a帽os luz)

Ya he conseguido importar algo con el fichero CSV.

Como aqu铆 soy el programador y tambien el usuario, me tendr茅 que conformar.

Ir茅 informando

Saludos y gracias de nuevo

JESUS MARIN

VALENCIA (ESPA脩A)

Jes煤s Mar铆n
deumare@gmail.com
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: EXPORTAR DATOS DESDE FW A PRESTASHOP
Posted: Tue Dec 27, 2022 12:37 PM
DBF2CSV.PRG

https://www.raymarron.com/clipper/

Regards, saludos.
Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: EXPORTAR DATOS DESDE FW A PRESTASHOP
Posted: Tue Dec 27, 2022 01:30 PM

If you can go for API, the do it !!! Best option if you can handle it.

Export : Spend many days in making csv compatible code etc for Presta.

(Hard in my case)

Finaly I made a dbf file with all data needed (pics, sizes, groups,...) and transformed to xls

I bought once a 3 party import module from Presta where you can select the fields to match the dbf fields and from that moment just update you data.

The import module did a great job, catagories and pics are difficult at Presta, but no problem with the import.

The extra spend money (+- 90 euros) was easily won, since a presta update will give you a update also.

You will spend much more time looking for solutions for problems with import.

Just my 2 cents...

I left Presta some years ago for security reasons, spam and hacking. If you have a good running Presta, keep it else... Consider changing now

Marc Venken

Using: FWH 23.08 with Harbour
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: EXPORTAR DATOS DESDE FW A PRESTASHOP
Posted: Tue Dec 27, 2022 02:39 PM
If you would like to change the data of Presta direct, try this code. Just tried it myself and working (change your data, PW,..)

First you will see a xbrowse with the product data that can be changed online
Second a folder with some Xbrowses.
This will give you a start i think.
Code (fw): Select all Collapse
static function Prestabeheer()
聽 聽local oDlg, oFont, nWild := 1, cZoek:=""
聽 聽local cList, aFlds, aHdrs, oBold
聽 聽local nChoice, uDataSource, nCombo1:= 1 , nCombo2:= 1
聽 聽local aTabs:={"Kleuren","Volgorde"}
聽 聽local oBrw[5]
聽 聽Public oRsATT


聽 Public cServer 聽 聽 := "YOUR DATA HERE"
聽 Public cDataBase 聽 := ""
聽 Public cUser 聽 聽 聽 := ""
聽 Public cPassWord 聽 := ""
聽 Public oCn, oRs, oRsATT, oRsVolgorde

聽 FWCONNECT oCn HOST cServer USER cUser PASSWORD cPassword DATABASE cDatabase

聽 if oCn == nil
聽 聽 聽? "Failed to connect"
聽 聽 聽return nil
聽 endif

聽 oRsProduct := oCn:RowSet( "select * from ps_product_lang " )

聽 xbrowse(oRsProduct)

聽 cZoek := "1"
聽 oRs := oCn:RowSet( "select * from `ps_attribute` where `id_attribute` = ? ", { cZoek } )

聽 oRsAtt:= oCn:RowSet( "SELECT * FROM `ps_attribute_lang` where `id_lang` = ? ORDER BY id_attribute", { "1" } )
聽 cDbf:="c:\data\temp.dbf"
聽 oRsAtt:savework(cDbf)

聽 oRsGroepen:= oCn:RowSet( "SELECT * FROM `ps_category_lang` where `id_lang` = ? ", { "1" } )

聽 cZoekProduct := "77"

聽 oRsvolgorde:= oCn:RowSet( "SELECT * FROM `ps_category_product` where `id_category` = ? ", { cZoekProduct } )

聽 oRsvolgorde:= oCn:RowSet( "SELECT *,P.description_short AS PName FROM ps_category_product C LEFT JOIN ps_product_lang P ON C.id_product WHERE id_category = ?" )

聽 聽DEFINE FONT oBold NAME 'CALIBRI' SIZE 0,-12 BOLD
聽 聽DEFINE FONT oFont NAME "CALIBRI" SIZE 0,-12
聽 聽DEFINE FONT oFontS NAME "Segoe UI" SIZE 0,-09

聽 聽DEFINE DIALOG oDlg SIZE 1410,800 PIXEL TRUEPIXEL ;
聽 聽STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU,WS_MAXIMIZEBOX, WS_MINIMIZEBOX, WS_THICKFRAME );
聽 聽TITLE "Ploegen";
聽 聽GRADIENT { { 1, nRGB( 125, 155, 175 ), nRGB( 125, 155, 175 ) } }

聽 聽DEFINE BUTTONBAR oBar OF oDlg SIZE 56,56 2007

聽 聽@ 90,05 FOLDER oFld SIZE 1400,700 PIXEL OF oDlg ITEMS aTabs

///////////////////////////////////////////////////////////////// 聽BRW FOLDER 1 /////////////////////////////////////////////////

聽 聽aVelden1 := 聽{ ;
聽 聽{ "id_attribute" 聽 , "ID" 聽 聽 聽 聽 聽,nil, 聽50 }, ; // 1
聽 聽{ "id_lang" 聽 聽 聽 聽, "Taal" 聽 聽 聽 聽,nil, 聽50 }, ; // 2
聽 聽{ "name" 聽 聽 聽 聽 聽 , "Kleurnaam" 聽 ,nil, 100 }} 聽 // 9

聽 聽@ 1,1 XBROWSE oBrw[1] size 1400,100 PIXEL OF 聽oFld:aDialogs[ 1 ] font oFont ;
聽 聽 聽 DATASOURCE oRsATT;
聽 聽 聽 COLUMNS aVelden1;
聽 聽 聽 AUTOSORT CELL LINES NOBORDER FOOTERS
聽 聽 聽 //FASTEDIT

聽 聽 聽oBrw[1]:nEditTypes = EDIT_GET
聽 聽 聽oBrw[1]:SetChecks()


聽 聽 聽oBrw[1]:lF2KeyToEdit := .t. 聽// Edit when F2 is pressed
聽 聽 聽oBrw[1]:nHeadStrAligns 聽:= AL_CENTER

聽 聽WITH OBJECT oBrw[1]

聽 聽 聽 :lColChangeNotify := .t.

聽 聽 聽 :oHeaderFonts 聽 聽 := oBold

聽 聽 聽 :bClrEdits 聽 聽 聽 聽:= { || { CLR_BLACK, CLR_YELLOW }}
聽 聽 聽 :bClrRowFocus 聽 聽 := { || { CLR_BLACK, RGB(185,220,255) } }

聽 聽 聽 :nColDividerStyle := LINESTYLE_LIGHTGRAY
聽 聽 聽 :nRowDividerStyle := LINESTYLE_LIGHTGRAY
聽 聽 聽 :bClrRowFocus 聽 聽 := { || { CLR_BLACK, RGB(185,220,255) } }
聽 聽 聽 :nMarqueeStyle 聽 聽:= MARQSTYLE_HIGHLROWMS

聽 聽 聽 :bOnChange 聽 聽 := { || oRs:Requery( { oBrw[1]:ID:Value } ), oBrw[2]:refresh() }

聽 聽 聽 :bRClicked 聽 聽 聽 聽:= {|nRow, nCol| Prestapop( nRow,nCol, oBrw[1], oRsATT ),oBrw[1]:refresh() }

聽 聽 聽 :bKeyDown 聽 := { |nKey| If( nKey == VK_DELETE, 聽oBrw[1]:kleurnaam:varput("##DEL"+oBrw[1]:kleurnaam:value), nil ) 聽}

聽 聽 聽 :lFooter 聽 聽 聽 聽 聽:= .t.
聽 聽 聽 :bRecSelHeader 聽 聽:= { || "RowNo" }
聽 聽 聽 :bRecSelData 聽 聽 聽:= { |o| o:KeyNo }
聽 聽 聽 :bRecSelFooter 聽 聽:= { |o| o:nLen }
聽 聽 聽 :oRecSelFont 聽 聽 聽:= oFont 聽// optional
聽 聽 聽 :nRecSelWidth 聽 聽 := "99999" // required size

聽 聽END

聽 聽oBrw[1]:CreateFromCode()

///////////////////////////////////////////////////////////////// 聽BRW FOLDER 2 /////////////////////////////////////////////////


聽 聽aVelden2 := 聽{ ;
聽 聽{ "id_attribute" 聽 聽 聽, "ID" 聽 聽 聽 ,nil, 聽50 }, ; // 1
聽 聽{ "id_attribute_group", "Groep" 聽 聽,nil, 聽50 }, ; // 2
聽 聽{ "color" 聽 聽 聽 聽 聽 聽 , "Kleur" 聽 聽,nil, 聽55 }, ; 聽 // 9
聽 聽{ "id_attribute" 聽 聽 聽, "File" 聽 聽 ,nil, 聽70 }} 聽 // 9

聽 聽@ 105,1 XBROWSE oBrw[2] size 1400,200 PIXEL OF 聽oFld:aDialogs[ 1 ] font oFont ;
聽 聽 聽 DATASOURCE oRs;
聽 聽 聽 COLUMNS aVelden2;
聽 聽 聽 AUTOSORT CELL LINES NOBORDER FOOTERS

聽 聽 聽oBrw[2]:nRowHeight:= 70
聽 聽 聽oBrw[2]:nEditTypes = EDIT_GET
聽 聽 聽oBrw[2]:SetChecks()

聽 聽 聽oBrw[2]:lF2KeyToEdit := .t. 聽// Edit when F2 is pressed
聽 聽 聽oBrw[2]:nHeadStrAligns 聽:= AL_CENTER

聽 聽 聽oBrw[2]:kleur:bClrStd := { || showcolors(oBrw[2]:kleur:Value) 聽}

聽 聽WITH OBJECT oBrw[2]

聽 聽 聽 :lColChangeNotify := .t.

聽 聽 聽 :oHeaderFonts 聽 聽 := oBold

聽 聽 聽 :nColDividerStyle := LINESTYLE_LIGHTGRAY
聽 聽 聽 :nRowDividerStyle := LINESTYLE_LIGHTGRAY

聽 聽 聽 WITH OBJECT :file
聽 聽 聽 聽:bStrImage 聽 聽 := { || "d:\pictures\kleuronline\"+alltrim(str(oBrw[2]:SelectedCol():Value))+".jpg" }
聽 聽 聽 聽:oDataFont 聽 聽 := oFontS
聽 聽 聽 聽:nDataStrAlign := AL_CENTER + AL_BOTTOM
聽 聽 聽 聽:nDataBmpAlign := AL_CENTER
聽 聽 聽 聽:aImgRect 聽 聽 聽:= { nil, nil, -10, nil }

聽 聽 聽 聽END

聽 聽END

聽 聽oBrw[2]:CreateFromCode()

///////////////////////////////////////////////////////////////// 聽/////////////////////////////////////////////////
聽 聽aVelden4 := 聽{ ;
聽 聽{ "id_category" 聽 聽, "Cat_ID" 聽 聽 聽 聽 聽,nil, 聽50 }, ; // 1
聽 聽{ "name" 聽 聽 聽 聽 聽 , "Naam" 聽 聽 聽 聽 聽 聽,nil, 聽200 }, ; // 2
聽 聽{ "position" 聽 聽 聽 , "Pos" 聽 聽 聽 聽 聽 聽 ,nil, 聽50 }} 聽 // 9

聽 聽@ 1,1 XBROWSE oBrw[4] size 1100,100 PIXEL OF 聽oFld:aDialogs[ 2 ] font oFont ;
聽 聽 聽 DATASOURCE oRsgroepen;
聽 聽 聽 COLUMNS aVelden4;
聽 聽 聽 AUTOSORT CELL LINES NOBORDER FOOTERS
聽 聽 聽 //FASTEDIT

聽 聽 聽oBrw[4]:nEditTypes = EDIT_GET
聽 聽 聽oBrw[4]:SetChecks()


聽 聽 聽oBrw[4]:lF2KeyToEdit := .t. 聽// Edit when F2 is pressed
聽 聽 聽oBrw[4]:nHeadStrAligns 聽:= AL_CENTER

聽 聽WITH OBJECT oBrw[4]

聽 聽 聽 :lColChangeNotify := .t.

聽 聽 聽 :oHeaderFonts 聽 聽 := oBold

聽 聽 聽 :bClrEdits 聽 聽 聽 聽:= { || { CLR_BLACK, CLR_YELLOW }}
聽 聽 聽 :bClrRowFocus 聽 聽 := { || { CLR_BLACK, RGB(185,220,255) } }

聽 聽 聽 :nColDividerStyle := LINESTYLE_LIGHTGRAY
聽 聽 聽 :nRowDividerStyle := LINESTYLE_LIGHTGRAY
聽 聽 聽 :bClrRowFocus 聽 聽 := { || { CLR_BLACK, RGB(185,220,255) } }
聽 聽 聽 :nMarqueeStyle 聽 聽:= MARQSTYLE_HIGHLROWMS

聽 聽 聽 :lFooter 聽 聽 聽 聽 聽:= .t.
聽 聽 聽 :bRecSelHeader 聽 聽:= { || "RowNo" }
聽 聽 聽 :bRecSelData 聽 聽 聽:= { |o| o:KeyNo }
聽 聽 聽 :bRecSelFooter 聽 聽:= { |o| o:nLen }
聽 聽 聽 :oRecSelFont 聽 聽 聽:= oFont 聽// optional
聽 聽 聽 :nRecSelWidth 聽 聽 := "99999" // required size

聽 聽 聽 :bOnChange 聽 聽 := { || oRSNewGroep(oBrw[4]:cat_id:Value), oBrw[3]:refresh() }

聽 聽END

聽 聽oBrw[4]:CreateFromCode()

///////////////////////////////////////////////////////////////// 聽BRW FOLDER 3 /////////////////////////////////////////////////
聽 聽aVelden3 := 聽{ ;
聽 聽{ "id_category" 聽 聽, "Cat_ID" 聽 聽 聽 聽 聽,nil, 聽50 }, ; // 1
聽 聽{ "id_product" 聽 聽 , "Product_ID" 聽 聽 聽,nil, 聽70 }, ; // 2
聽 聽{ "position" 聽 聽 聽 , "Pos" 聽 聽 聽 聽 聽 聽 ,nil, 聽50 }, ; 聽 // 9
聽 聽{ "oRsProduct:description_short" 聽 聽 聽 , "Naam" 聽 聽 聽 聽 聽 聽 ,nil, 聽150 }} 聽 // 9

聽 聽@ 110,1 XBROWSE oBrw[3] size 1100,200 PIXEL OF 聽oFld:aDialogs[ 2 ] font oFont ;
聽 聽 聽 DATASOURCE oRsvolgorde;
聽 聽 聽 COLUMNS aVelden3;
聽 聽 聽 AUTOSORT CELL LINES NOBORDER FOOTERS FASTEDIT

聽 聽 聽//oBrw[3]:nEditTypes = EDIT_GET
聽 聽 聽oBrw[3]:SetChecks()

聽 聽 聽oBrw[3]:lF2KeyToEdit := .t. 聽// Edit when F2 is pressed
聽 聽 聽//oBrw[3]:nHeadStrAligns 聽:= AL_CENTER

聽 聽WITH OBJECT oBrw[3]

聽 聽 聽 :lColChangeNotify := .t.

聽 聽 聽 //:oHeaderFonts 聽 聽 := oBold

聽 聽 聽 :bClrEdits 聽 聽 聽 聽:= { || { CLR_BLACK, CLR_YELLOW }}
聽 聽 聽 :bClrRowFocus 聽 聽 := { || { CLR_BLACK, RGB(185,220,255) } }

聽 聽 聽 :nColDividerStyle := LINESTYLE_LIGHTGRAY
聽 聽 聽 :nRowDividerStyle := LINESTYLE_LIGHTGRAY
聽 聽 聽 :bClrRowFocus 聽 聽 := { || { CLR_BLACK, RGB(185,220,255) } }
聽 聽 聽 :nMarqueeStyle 聽 聽:= MARQSTYLE_HIGHLROWMS


聽 聽 聽 //:bOnChange 聽 聽 := { || oRs:Requery( { oBrw[1]:ID:Value } ), oBrw[2]:refresh() }

聽 聽 聽 :lFooter 聽 聽 聽 聽 聽:= .t.
聽 聽 聽 :bRecSelHeader 聽 聽:= { || "RowNo" }
聽 聽 聽 :bRecSelData 聽 聽 聽:= { |o| o:KeyNo }
聽 聽 聽 :bRecSelFooter 聽 聽:= { |o| o:nLen }
聽 聽 聽 :oRecSelFont 聽 聽 聽:= oFont 聽// optional
聽 聽 聽 :nRecSelWidth 聽 聽 := "99999" // required size

聽 聽END

聽 聽oBrw[3]:CreateFromCode()


///////////////////////////////////////////////////////////////// 聽/////////////////////////////////////////////////

// 聽 BrwBarploegen( oBar, oBrw )

聽 聽ACTIVATE DIALOG oDlg CENTERED

聽 聽RELEASE FONT oFont
聽 聽oCn:close()

return nil
Marc Venken

Using: FWH 23.08 with Harbour
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: EXPORTAR DATOS DESDE FW A PRESTASHOP
Posted: Tue Dec 27, 2022 04:04 PM
VictorCasajuana wrote:Hola.
Te comparto una clase que hice de prueba para conectar con el Api de Prestashop. No la he utilizado nunca en producci贸n pero las pruebas que lleva prueba.prg funcionan perfectamente :D

https://github.com/VictorCasajuanaMas/Prestashop

utilizo una clase para los xml que me dej贸 el maestro Cristobal Navarro, espero me permita tambi茅n incluirla en el repositorio, de lo contrario la quito enseguida :wink: .

La clase TPrestashop es sencilla pero tiene las bases para entender el API y a partir de ah铆 hacerla crecer. Al principio yo tambi茅n trabaj茅 la conexi贸n con prestashop mediante ficheros csv, pero para el usuario es m谩s engorroso. Si trabajas a nivel de API lo puedes automatizar absolutamente todo.
Consejo: aunque se puede, no trabajes directamente con la BD MySql que lleva integrada, te puedes volver loco :twisted: .

Si te interesa la clase y la vas vitaminando, estar铆a bien trabajarla desde el repositorio para poder aprovechar las mejoras 8) .

Gracias y salud :D !
Si, yo tengo otra clase para la conexi贸n e interaccion de aplicaciones Fivewin con Prestashop en producci贸n diariamente y sin problema realizando un gran n煤mero de transacciones entre ambos entornos.
El consejo que te da Victor, es adecuado: no intentes acceder a las bases de datos MySql que utiliza Prestashop directamente porque luego te puede dar muchos quebraderos de cabeza. Es mucho mejor, y m谩s seguro y limpio utilizar el API que proporcionan.
El proyecto contempla clases para el mantenimiento de Productos, categorias, Customers, Orders, adem谩s de otra clase base de la que derivan las anteriores.
Si hay alguien interesado, que se ponga en contacto conmigo
utilizo una clase para los xml que me dej贸 el maestro Cristobal Navarro, espero me permita tambi茅n incluirla en el repositorio, de lo contrario la quito enseguida :wink:
Si, es una clase que no estaba publicada a煤n, pero no hay problema. Un regalito de Navidad
Saludos
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 1144
Joined: Mon Feb 05, 2007 07:15 PM
Re: EXPORTAR DATOS DESDE FW A PRESTASHOP
Posted: Tue Dec 27, 2022 05:49 PM

Maestro Navarro, me lo compartes?

mi correo: SysCtrlSoftware AROBA.GMAIL.COM

SALUDOS.

Cesar Cortes Cruz

SysCtrl Software

Mexico



' Sin +- FWH es mejor "