Immagine prodotto su account_history_info.php
Moderatore: mod Generali
Immagine prodotto su account_history_info.php
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
Re: Immagine prodotto su account_history_info.php
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
------------------------------------------------------------
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
------------------------------------------------------------
Re: Immagine prodotto su account_history_info.php
ottimo non ci avevo mai pensato
per aggiungere anche il modello prodotto, sempre utile, ho modificato così l'ultimo step:
poi aggiungo che è da commentare questo pezzo da:
a:
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
************************************************************
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 ) bene bravo bis!!:)