Print Page | Close Window

Customizing URL for digital product

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Customizing ProductCart
Forum Description: Exchange messages with other users that are customizing ProductCart.
URL: https://forum.productcart.com/forum_posts.asp?TID=739
Printed Date: 25-February-2025 at 8:46pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Customizing URL for digital product
Posted By: corduroy
Subject: Customizing URL for digital product
Date Posted: 17-April-2007 at 5:10pm

I am trying to customize the product download URL delivered in the customer email confirmation.  I am trying to create a custom link that retrieves fields from the DB but generate a different URL - to our online product.  I've listed the code below; for some reason, it does not recognize the new code I added to overwrite the URL.  It just sends the standard URL when I test it.  Much thanks to anyone that responds.

 

'********************************************************

'* START - DIGITAL PRODUCTS

'* If the order contains digital products and the order

'* status is "processed", then include license/link info

'********************************************************

IF DPOrder="1" AND pOrderStatus="3" then

query="select * from ProductsOrdered WHERE idOrder="& qry_ID

pidorder=qry_ID

set rs11=connTemp.execute(query)

if err.number<>0 then

'//Logs error to the database

call LogErrorToDatabase()

'//clear any objects

set rs11=nothing

'//close any connections

call closedb()

'//redirect to error page

response.redirect "techErr.asp?err="&pcStrCustRefID

end if

do while not rs11.eof

query="select * from Products,DProducts where products.idproduct=" & rs11("idproduct") & " and DProducts.idproduct=Products.idproduct and products.downloadable=1"

set rs=connTemp.execute(query)

if err.number<>0 then

'//Logs error to the database

call LogErrorToDatabase()

'//clear any objects

set rs=nothing

'//close any connections

call closedb()

'//redirect to error page

response.redirect "techErr.asp?err="&pcStrCustRefID

end if

if not rs.eof then

pIdproduct=rs11("idproduct")

pProductName=rs("Description")

pURLExpire=rs("URLExpire")

pExpireDays=rs("ExpireDays")

pLicense=rs("License")

pLL1=rs("LicenseLabel1")

pLL2=rs("LicenseLabel2")

pLL3=rs("LicenseLabel3")

pLL4=rs("LicenseLabel4")

pLL5=rs("LicenseLabel5")

pAddtoMail=rs("AddtoMail")

pSku = rs("sku") 'hu April 17

query="select RequestSTR from DPRequests where idproduct=" & rs11("idproduct") & " and idorder=" & pidorder & " and idcustomer=" & pidcustomer

set rs19=connTemp.execute(query)

if err.number<>0 then

'//Logs error to the database

call LogErrorToDatabase()

'//clear any objects

set rs19=nothing

'//close any connections

call closedb()

'//redirect to error page

response.redirect "techErr.asp?err="&pcStrCustRefID

end if

pdownloadStr=rs19("RequestSTR")

SPath1=Request.ServerVariables("PATH_INFO")

mycount1=0

do while mycount1<2

if mid(SPath1,len(SPath1),1)="/" then

mycount1=mycount1+1

end if

if mycount1<2 then

SPath1=mid(SPath1,1,len(SPath1)-1)

end if

loop

SPathInfo="http://" & Request.ServerVariables("HTTP_HOST") & SPath1

if Right(SPathInfo,1)="/" then

pdownloadStr=SPathInfo & "pc/pcdownload.asp?id=" & pdownloadStr

else

pdownloadStr=SPathInfo & "/pc/pcdownload.asp?id=" & pdownloadStr

end if

 

 

'/hu April 17, 2007

query="select idProductOrdered from ProductOrdered where idproduct=" & rs11("idproduct") & " and idorder=" & pidorder

set rsHu=connTemp.execute(query)

if err.number<>0 then

'//Logs error to the database

call LogErrorToDatabase()

'//clear any objects

set rsHu=nothing

'//close any connections

call closedb()

'//redirect to error page

response.redirect "techErr.asp?err="&pcStrCustRefID

end if

SPathInfo=scSSLUrl '"http://product.myurl.net/" 'scSSLUrl

pdownloadStr =SPathInfo & "?ProductOrderId=" & trim(rsHu("idProductOrdered")) & "&productcode=" & trim(pSku) & "&username=" & gRegemail & "&id=" & rs19("RequestSTR")

'?ProductOrderId=50&username=spark@earlyimpact.com&p assword=''&productcode=DL-benchmarker

'/end hu

 

CustomerEmail=customerEmail & "=========================================================== ===========" & vbcrlf & vbcrlf

CustomerEmail=customerEmail & dictLanguage.Item(Session("language")&"_sendMail_28") & pProductName & vbcrlf & vbcrlf

CustomerEmail=customerEmail & dictLanguage.Item(Session("language")&"_sendMail_29")

if (pURLExpire<>"") and (pURLExpire="1") then

if date()-(CDate(pprocessDate)+pExpireDays)<0 then

CustomerEmail=customerEmail & dictLanguage.Item(Session("language")&"_sendMail_30") & (CDate(pprocessDate)+pExpireDays)-date() & dictLanguage.Item(Session("language")&"_sendMail_31") & vbcrlf & vbcrlf

else

if date()-(CDate(pprocessDate)+pExpireDays)=0 then

CustomerEmail=customerEmail & dictLanguage.Item(Session("language")&"_sendMail_32") & vbcrlf & vbcrlf

else

CustomerEmail=customerEmail & dictLanguage.Item(Session("language")&"_sendMail_33") & vbcrlf & vbcrlf

end if

end if

else

CustomerEmail=CustomerEmail & ":" & vbcrlf & vbcrlf

end if

CustomerEmail=CustomerEmail & pdownloadStr & vbcrlf &vbcrlf

if (pLicense<>"") and (pLicense="1") then

query="select * from DPLicenses where idproduct=" & rs11("idproduct") & " and idorder=" & pidorder

set rs19=connTemp.execute(query)

if err.number<>0 then

'//Logs error to the database

call LogErrorToDatabase()

'//clear any objects

set rs19=nothing

'//close any connections

call closedb()

'//redirect to error page

response.redirect "techErr.asp?err="&pcStrCustRefID

end if

TempLicStr=""

do while not rs19.eof

TempLic=""

Lic1=rs19("Lic1")

if Lic1<>"" then

TempLic=TempLic & pLL1 & ": " & Lic1 & vbcrlf

end if

Lic2=rs19("Lic2")

if Lic2<>"" then

TempLic=TempLic & pLL2 & ": " & Lic2 & vbcrlf

end if

Lic3=rs19("Lic3")

if Lic3<>"" then

TempLic=TempLic & pLL3 & ": " & Lic3 & vbcrlf

end if

Lic4=rs19("Lic4")

if Lic4<>"" then

TempLic=TempLic & pLL4 & ": " & Lic4 & vbcrlf

end if

Lic5=rs19("Lic5")

if Lic5<>"" then

TempLic=TempLic & pLL5 & ": " & Lic5 & vbcrlf

end if

if TempLic<>"" then

TempLic=TempLic & vbcrlf

TempLicStr=TempLicStr & TempLic

end if

rs19.movenext

loop

if TempLicStr<>"" then

TempLicStr=dictLanguage.Item(Session("language")&"_sendM ail_34") & vbcrlf & vbcrlf & TempLicStr

CustomerEmail=customerEmail & TempLicStr & vbcrlf

end if

end if

if pAddtoMail<>"" then

CustomerEmail=customerEmail & dictLanguage.Item(Session("language")&"_sendMail_35") & vbcrlf & vbcrlf & pAddtoMail & vbcrlf & vbcrlf

end if

end if

rs11.MoveNext

loop

CustomerEmail=customerEmail & "=========================================================== ===========" & vbcrlf & vbcrlf

end if

'********************************************************

'* END - DIGITAL PRODUCTS

'********************************************************




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net