Pages:

Add photo to Order Print

stephano6

No avatar

2007-11-17 17:43

After longtemp look on the forum and FAQ and Documentation.
I ask you to help,

I want to add the photo of the product purchased in the template print_order.tpl (corresponding to the id of the product course, even for 3.4 product)

I tested with:
$aList[sPhotoSmall]
$aList[iPhoto], $aData[iProduct]

:-( I do not know how to call

» Quick.Cart v1.x

steph2switzerland

merci

No avatar

2007-11-19 08:58

stephano6 - execute following steps:
1. in file actions_client/orders.php add the following lines somewhere at the top below other require:

require_once DIR_CORE.'files-'.$config['db_type'].'.php';
require_once 
DIR_CORE.'files.php';


2. open file core/orders.php, in function listBasket( ); below following code:

if( isset( $aData ) ){

add this:

$aPhoto       throwFirstPhoto);


3. then below this code:

$aList['fSummary']  = tPrice$aList['iQuantity'] * $aList['fPrice'] );

add the following:

if( isset( $aPhoto[$aList['iProduct']] ) && is_fileDIR_PRODUCTS_FILES.$aPhoto[$aList['iProduct']]['sPhoto'] ) ){
          
$aName $oFF->throwNameExtOfFile$aPhoto[$aList['iProduct']]['sPhoto'] );
          
$aList['sFile']       = $aPhoto[$aList['iProduct']]['sPhoto'];
          
$aList['sPhotoSmall'] = DIR_PRODUCTS_FILES.$aName[0].'_m.'.$aName[1];
          
$aList['sPhotoBig']   = DIR_PRODUCTS_FILES.$aPhoto[$aList['iProduct']]['sPhoto'];
          
$aList['sPhoto']      = $tpl->tbHtml$sFile'PHOTO' );    
        }
        else{
          
$aList['sPhoto'] = ' ';
        }


4. still in the same file find:

global $tpl$aList;[/php]
 and 
replace it with:
[
php]global $tpl$aList$oFF;


5. now copy from file templates/products_list.tpl block PHOTO and paste it to file templates/orders_print.tpl
6. in file templates/orders_print.tpl before variable $aList[sProduct] add: $aList[sPhoto]

Now you have to adjust design (styles and so on). It will work also in basket, if you will need it.

idaryl

Avatar: idaryl

2007-11-19 22:47

Can it be added to the basket? Please...

merci

No avatar

2007-11-20 08:05

idaryl - after this modyfications I wrote, it should work in basket also, you have to change only steps 5 and 6 - use another tpl file, as you need.

idaryl

Avatar: idaryl

2007-11-20 09:26

OK I'll try it out - thank you

stephano6

No avatar

2007-11-20 11:59

merci - Thank you for your Answer,I tried several times,
idaryl - It works with you ?

But, there is an image that appears, but it does coresspond not to the ID and the name of the product. (This is another product that appears)

Moreover, if I make Ctrl + F5. the image is a random display a new image,
(that should not of done it is always the same ID).

I joined the three files if you want to watch, but I think that change properly.
http://rapidshare.com/files/70995678/Add_photo_to_Order_Print_.rar.html

Thanks, and sorry for my English

steph2switzerland

merci

No avatar

2007-11-21 08:51

stephano6 - I have checked it on oryginal v1.4 of Q.C and it works good, but you have to add block PHOTO also to files: templates/orders_basket.tpl and templates/orders_delivery. In this files you can add empty block PHOTO because you don't need it in this files (idaryl can't add empty block to templates_orders_basket.tpl because he want to display there photo also).
For me photo which was displayed was the same photo from products list page and after refreshing it doesn't changed.

stephano6

No avatar

2007-11-21 17:11

Thank you for your answer, I will try again.

You can send your files with changes so that I test? Please. Because I did not understand why it does not work.

In addition to templates_orders_basket.tpl it shows a bad image from the beginning.
thank you

(the block it is well that: templates/products_list.tpl)
<!-- BEGIN PHOTO -->
<div class="photo">
<a href="?p=productsMore&amp;iProduct=$aList[iProduct]&amp;sName=$aList[sNameUrl]">& lt;img src="$aList[sPhotoSmall]" alt="$aList[sName]" title="$aList[sName]" /></a>
</div>
<!-- END PHOTO -->

steph2switzerland

merci

No avatar

2007-11-22 08:53

stephano6 - in step 5 you have to add this block:

<!-- BEGIN PHOTO -->
<
div class="photo">
  <
a href="?p=productsMore&amp;iProduct=$aList[iProduct]&amp;sName=$aList[sNameUrl]">& lt;img src="$aList[sPhotoSmall]" alt="$aList[sName]" title="$aList[sName]" /></a>
</
div>
<!-- 
END PHOTO -->

to file templates/orders_print.tpl
To files: templates/orders_basket.tpl and templates/orders_delivery you put empty block:

<!-- BEGIN PHOTO -->
<!-- 
END PHOTO -->

stephano6

No avatar

2007-11-23 20:00

:-( Yes Yes Mister -Merci- !!!! SORRY >>> I am a zer0

After hitting head on desktop ..... I understand :-)

I install two version: Quick.Cart.Loaded_v14_fat and Quick.Cart_v1.4 it is true that the Original version of Quick.Cart_v1.4 work very well.

But for the version "Loaded 1.4 Fat" This script does not work,
I wanted to use this code to this version also,
Do you have a solution for this release please

A big thank you for all your efforts and your advice
Thank you

Quick.Cart.Loaded v14 Fat / steph2switzerland

merci

No avatar

2007-11-26 09:41

stephano6 - I don't know how to make this modyfication for Loaded version, as I don't use this one and don't have experiance with it.

stephano6

No avatar

2007-11-27 15:58

heyyyy .... the problem does not come from the version but from the plugin ProductAttributes.

the plugin blocks the view image _ m in orders_basket, orders_delivry and orders_print /.tpl

...... and now...

Thanks and steph

spamex

No avatar

2007-11-27 23:52

Add in productAttributes.tpl

where you want it in section
<!-- BEGIN BASKET_LIST_LIST_PRINT -->

this code =>
<img src="$aList[sPhotoSmall]" alt="$aList[sName]" title="$aList[sName]" /></a>

spamex

No avatar

2007-11-28 00:06

sorry bad copy paste

this code =>
<img src="$aList[sPhotoSmall]" alt="$aList[sName]" title="$aList[sName]" />

stephano6

No avatar

2007-11-30 15:17

spamex - RRRRRRRRR.... no no ...... :-(
Thanks for your answer .....

But, there is an image that appears, but it does coresspond not to the ID and the name of the product, I tested with :
<img src="?p=productsMore&amp;iProduct=$aList[sPhotoSmall]" alt="$aList[sName]" title="$aList[sName]" /> But no result

Another idea / Thanks

stephano6

Mike001

No avatar

2008-01-04 20:27

I tried to do modifications above, but no result. Can you help me anybody?

merci

No avatar

2008-01-07 09:30

Mike001 - write exactly where do you have problem? Which version do you have? What is wrong after doing this modyfication?

Mike001

No avatar

2008-01-08 08:28

Yes, I have 1.4 version. I did described changes above, but i would like to have image in basket. And I tried to modifiy orders_basket.tpl, orders_delivery.tpl and orders_print.tpl, but no images neither in basket or in delivery page.
How exactly do I have modify TPL files?

Thanks

merci

No avatar

2008-01-08 09:12

Mike001 - if about modyfication of tpl files, copy this code:

<!-- BEGIN PHOTO -->
<
div class="photo">
  <
a href="?p=productsMore&amp;iProduct=$aList[iProduct]&amp;sName=$aList[sNameUrl]">& ampamplt;img src="$aList[sPhotoSmall]" alt="$aList[sName]" title="$aList[sName]" /></a>
</
div>
<!-- 
END PHOTO -->

and paste it to files: templates/orders_print.tpl templates/orders_basket.tpl and templates/orders_delivery
It is step 5. from instruction which I wrote in my first post.
In step 6. you have to use another tpl file - templates/orders_basket.tpl

goory

No avatar

2008-01-09 13:19

a jak bedzie w wersji 2.2 ?

Pages:
Back to top
about us | contact