Author |
Topic |
|
vaheh
VP-CART New User
USA
115 Posts |
Posted - May 11 2017 : 16:15:01
|
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
|
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...
|
|
|
vaheh
VP-CART New User
USA
115 Posts |
Posted - May 17 2017 : 11:04:17
|
Hi Diego, Thank you so much for the reply. I will test it and post the result. Best, Vaheh |
|
|
sancess
Starting Member
37 Posts |
Posted - May 18 2017 : 16:55:10
|
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? |
|
|
vaheh
VP-CART New User
USA
115 Posts |
Posted - May 18 2017 : 16:58:52
|
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 |
|
|
sancess
Starting Member
37 Posts |
Posted - May 18 2017 : 17:01:29
|
wow that''s cool!
Can you share it please? |
|
|
vaheh
VP-CART New User
USA
115 Posts |
Posted - May 18 2017 : 17:16:51
|
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
|
|
|
sancess
Starting Member
37 Posts |
Posted - May 18 2017 : 17:28:20
|
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 |
|
|
vaheh
VP-CART New User
USA
115 Posts |
Posted - May 18 2017 : 17:28:44
|
Hi sancess,
Try the instruction above. It should work. let me know if you have any questions.
:) Vaheh |
|
|
vaheh
VP-CART New User
USA
115 Posts |
Posted - May 18 2017 : 17:29:49
|
sancess my code IS for MSSQL db. It will not probably work with Access. |
Edited by - vaheh on May 18 2017 17:32:20 |
|
|
serjtankian
VP-CART Super User
Armenia
378 Posts |
Posted - May 19 2017 : 16:06:53
|
a very good share!
thanks vaheh
*peace - serj* |
|
|
vaheh
VP-CART New User
USA
115 Posts |
Posted - May 19 2017 : 16:19:51
|
Serj, Khendrem. |
|
|
|
Topic |
|