Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 VP-Cart 8.00 Issues
 Add Item Image to shopthanks.asp
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

vaheh
VP-CART New User

USA
115 Posts

Posted - May 11 2017 :  16:15:01  Show Profile  Visit vaheh's Homepage  Reply with Quote
Hi,

Does anyone know how to add item(s) image to shopthanks.asp?
I mean once the customer placed the order and website showed the receipt also show the ordered item images.

Thanks,
Vaheh

Edited by - vaheh on May 12 2017 11:43:27

diegomilito
VP-CART Expert

Argentina
779 Posts

Posted - May 16 2017 :  22:21:20  Show Profile  Reply with Quote
on the shopthanks.asp, its bit different to cart pages. images are showing from shopaddtocart.asp until shopcreateordera.sp if you set xcartimage to yes because it is loading from cart session array
these pages are loading from shopcartformat.asp.
in shopthanks.asp is loading from shopformatorder.asp which is not calling cart session array but are loaded from orders db.
if you want to display prod images in shopthanks.asp possible u ll modif shopformatorder.asp, inside routine sub FormatItemDetails, you need to call cart session array again like below maybe (just my estimation):
dim scartItem, ArrCart, image
scartItem = GetSess("CartCount")
ArrCart = GetSessA("CartArray")
for i = 1 to scartItem
image=ArrCart(cProductimage,i)

if GetConfig("xcartimage")="Yes" and image<>"" then
%><img border="0" src="<%=image%>" alt=" " /><%
end if
next

this is just logic how you can achieve, and i do not guarantee will work correctly 100%, you need some tweak to make it work ;)
saludos,
diego...

Go to Top of Page

vaheh
VP-CART New User

USA
115 Posts

Posted - May 17 2017 :  11:04:17  Show Profile  Visit vaheh's Homepage  Reply with Quote
Hi Diego,
Thank you so much for the reply. I will test it and post the result.
Best,
Vaheh
Go to Top of Page

sancess
Starting Member

37 Posts

Posted - May 18 2017 :  16:55:10  Show Profile  Reply with Quote
Hi Diego,

I have tried to implement the code but it seems does not works. Do we just need to copy and paste above code to any place under the FormatItemDetails routine?
Go to Top of Page

vaheh
VP-CART New User

USA
115 Posts

Posted - May 18 2017 :  16:58:52  Show Profile  Visit vaheh's Homepage  Reply with Quote
I did it in different way and it is working. Also I have added the product picture to customer email too.

Edited by - vaheh on May 18 2017 17:00:35
Go to Top of Page

sancess
Starting Member

37 Posts

Posted - May 18 2017 :  17:01:29  Show Profile  Reply with Quote
wow that''s cool!

Can you share it please?
Go to Top of Page

vaheh
VP-CART New User

USA
115 Posts

Posted - May 18 2017 :  17:16:51  Show Profile  Visit vaheh's Homepage  Reply with Quote
Show Item Image in Shopthanks.asp

First Take a backup from shopformatorder.asp and shopfileio.asp.

Open shopformatorder.asp and go to around line 340 you should see something like this:
=======================================
if GetConfig("xcustomerimages") = "Yes" then
if items("customerimage") > "" then
itemname = itemname & "<br /><span class=''fontbold''>Attachment: </span>" & right(items("customerimage"), len(items("customerimage")) - instrrev(items("customerimage"), "/"))
end if
end if
=======================================

Right after that ADD the following code:

=======================================
''Vaheh to add item image
Dim tempsql,ProdInfo,itemimage, tempsqlupdate,ProdInfoupdate
tempsql="cimageurl from products where catalogid ="&CatalogId
Set ProdInfo = Server.CreateObject("ADODB.Recordset")
ProdInfo.open tempsql, dbc, adopenkeyset, adlockoptimistic
if (ProdInfo.BOF and ProdInfo.EOF) then
else
itemimage = ProdInfo("cimageurl")
end if
itemname = "<img src=''"&itemimage&"'' width=''60''>" & "<br />" & itemname


=======================================

*****The code above will put the item image on shopthanks.asp*****

If you would like to have the ordered items image in the customer email then make sure email format from the website setting is set to HTML then:

ADD the following code right after the above code in shopformatorder.asp

=======================================
''VAHEH - update ORDERS TO SAVE ITEM IMAGE IN CUSTOMERIMAGE FIELD
tempsqlupdate="update oitems set customerimage = ''" & itemimage & "'' where orderid = " & lngorderid & " AND catalogid = " & CatalogId
Set ProdInfoupdate = Server.CreateObject("ADODB.Recordset")
ProdInfoupdate.open tempsqlupdate, dbc, adopenkeyset, adlockoptimistic
''END VAHEH

=======================================

Save the file and close it.
Then open:

shopfileio.asp
Find the following sub:
sub Handle_OITEMS

then inside it find
Body = Body & CR & Itemname & CR

right After that ADD:
''Vaheh to ADD ITEM IMAGE
dim itemimagev
itemimagev=rsitems("customerimage")
if len(trim(itemimagev)) > 0 then
body = Body & CR & "<img src=''http://www.yourwebsitename.com/"& itemimagev & "'' width=''60''>" & CR
end if
Go to Top of Page

sancess
Starting Member

37 Posts

Posted - May 18 2017 :  17:28:20  Show Profile  Reply with Quote
i got this error:

Microsoft JET Database Engine error ''80040e14''

Invalid SQL statement; expected ''DELETE'', ''INSERT'', ''PROCEDURE'', ''SELECT'', or ''UPDATE''.

/tesuto/shopformatorder.asp, line 349

trying in test environment with access database
Go to Top of Page

vaheh
VP-CART New User

USA
115 Posts

Posted - May 18 2017 :  17:28:44  Show Profile  Visit vaheh's Homepage  Reply with Quote
Hi sancess,

Try the instruction above. It should work.
let me know if you have any questions.

:)
Vaheh
Go to Top of Page

vaheh
VP-CART New User

USA
115 Posts

Posted - May 18 2017 :  17:29:49  Show Profile  Visit vaheh's Homepage  Reply with Quote
sancess my code IS for MSSQL db. It will not probably work with Access.

Edited by - vaheh on May 18 2017 17:32:20
Go to Top of Page

serjtankian
VP-CART Super User

Armenia
378 Posts

Posted - May 19 2017 :  16:06:53  Show Profile  Visit serjtankian's Homepage  Reply with Quote
a very good share!

thanks vaheh



*peace - serj*
Go to Top of Page

vaheh
VP-CART New User

USA
115 Posts

Posted - May 19 2017 :  16:19:51  Show Profile  Visit vaheh's Homepage  Reply with Quote
Serj,
Khendrem.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00