Immagine prodotto su account_history_info.php

Postate qui discussioni di carattere generale riguardo a problemi di installazione e configurazione di osCommerce

Moderatore: mod Generali

Rispondi
bellaudda
membro Junior
membro Junior
Messaggi: 4
Iscritto il: 06/02/2008, 10:27

Immagine prodotto su account_history_info.php

Messaggio da bellaudda »

Salva a tutti, ho bisogno di un piccolo aiuto per risolvere un problema al quale non trovo rimedio. Vorrei dare l'opportunità a chi controlla lo storico degli ordini effettuati di poter vedere oltre alla descrizione, quantità e prezzo del prodotti ordinati, anche la fotografia del prodotto stesso. Il file da editare è sicuramente account_history_info.php, ma non saprei da dove incominciare. qualche idea? grazie anticipatamente Anna
bellaudda
membro Junior
membro Junior
Messaggi: 4
Iscritto il: 06/02/2008, 10:27

Re: Immagine prodotto su account_history_info.php

Messaggio da bellaudda »

ho risolto, per chi fosse interessato posto le modifiche effettuate su account_history_info.php

OPEN catalog/account_history_info.php
------------------------------------------------------------
FIND
------------------------------------------------------------

require('includes/application_top.php');

------------------------------------------------------------
INSERT AFTER

// define(ORDERS_IMAGE_HEIGHT, 50);
define(ORDERS_IMAGE_WIDTH, 50);

------------------------------------------------------------
FIND
------------------------------------------------------------

</head>

------------------------------------------------------------
INSERT BEFORE

************************************************************
A word about the javascript variables -

width=500 this is the width of the popup window
height=500 this is the height of the popup window
************************************************************

<script language="javascript">
<!--
function popupWindow(url) {
window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=500,height=500,screenX=150,screenY=150,top=150,left=150')
}
//-->
</script>

------------------------------------------------------------
FIND
------------------------------------------------------------

for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
echo ' <tr>' . "\n" .
' <td class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
' <td class="main" valign="top">' . $order->products[$i]['name'];

------------------------------------------------------------
REPLACE WITH
------------------------------------------------------------

for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {

$orders_products_pic_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$order->products[$i]['id'] . "'");
$orders_products_pic = tep_db_fetch_array($orders_products_pic_query);

echo ' </td>' . "\n" .
' <td class="main" valign="top" align="left"><a href="javascript:popupWindow(\'' . DIR_WS_IMAGES . $orders_products_pic['products_image'] . '\'' . ')">' . tep_image(DIR_WS_IMAGES . $orders_products_pic['products_image'], $order->products[$i]['name'], ORDERS_IMAGE_WIDTH, ORDERS_IMAGE_HEIGHT) . '</a></td>' . "\n" .
' <td class="main" valign="top" align="right" width="30">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
' <td class="main" valign="top">' . $order->products[$i]['name'] . "\n";

------------------------------------------------------------
SAVE and CLOSE catalog/account_history_info.php
------------------------------------------------------------
06voip
membro Veteran
membro Veteran
Messaggi: 549
Iscritto il: 12/09/2009, 11:58

Re: Immagine prodotto su account_history_info.php

Messaggio da 06voip »

ottimo non ci avevo mai pensato :)

per aggiungere anche il modello prodotto, sempre utile, ho modificato così l'ultimo step:

Codice: Seleziona tutto

for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {

$orders_products_pic_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$order->products[$i]['id'] . "'");
$orders_products_pic = tep_db_fetch_array($orders_products_pic_query);

echo ' </td>' . "\n" .
' <td class="main" valign="top" align="left"><a href="javascript:popupWindow(\'' . DIR_WS_IMAGES . $orders_products_pic['products_image'] . '\'' . ')">' . tep_image(DIR_WS_IMAGES . $orders_products_pic['products_image'], $order->products[$i]['name'], ORDERS_IMAGE_WIDTH, ORDERS_IMAGE_HEIGHT) . '</a></td>' . "\n" .
' <td class="main" valign="top" align="right" width="30">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
' <td class="main" valign="top">' . $order->products[$i]['name'] . '   (' . $order->products[$i]['model'] . ')'. "\n";

poi aggiungo che è da commentare questo pezzo da:

Codice: Seleziona tutto

************************************************************
A word about the javascript variables -

width=500 this is the width of the popup window
height=500 this is the height of the popup window
************************************************************
a:

Codice: Seleziona tutto

<?php /*
************************************************************
A word about the javascript variables -

width=500 this is the width of the popup window
height=500 this is the height of the popup window
************************************************************
*/ ?>
ATTENZIONE: Questi non sono cambiamenti banali. C'è un sacco di codice qui :o) bene bravo bis!!:)
Rispondi