logo
Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
gregfd  
#1 Posted : Monday, May 31, 2010 12:00:51 AM(UTC)
gregfd

Rank: Advanced Member

Reputation:

Groups: Member
Joined: 2/6/2009(UTC)
Posts: 55
Man
Location: Wroclaw

Hi I need to implement some price discount depends on logged in user.

Can I do it in Shop userescape price index?

Which names of values I can use there? Mayby someone have some easy example to show.

Thanks in advanced.
Certico Websolutions - www.certico.pl

Wanna join the discussion?! Login to your Sienn Forum forum account. New Registrations are disabled.

bart  
#2 Posted : Monday, May 31, 2010 12:31:18 PM(UTC)
bart

Rank: Administration

Reputation:

Groups: Administration
Joined: 10/8/2008(UTC)
Posts: 190
Man

Was thanked: 1 time(s) in 1 post(s)
Hi Gregdfd,

For Creating discount for each loged in user,
you can use an open control to add atricles into the shoppingcart.
the code for this is basicly
Code:

Dim ErrString as string = ""
Dim UserEscapeIndex as integer = pbw.UserEscape_Shop_UserEscape_Index("SOURCESHOP25", Cid, False, pbw.Get_RunSource_CreateAssembly, pbw.Get_RunSource_RunFromAssembly(), Server, Request, Session, Constring, "", "", Response, errstring)
Dim ShopSettingIndex as integer = pbw.UserEscape_Shop_Settings_Index("SOURCESHOP24", Cid, False, pbw.Get_RunSource_CreateAssembly, pbw.Get_RunSource_RunFromAssembly(), Server, Request, Session, Constring, "", "", Response, errstring)
pbw.Shop_Cart_Add(ShopSettingIndex,UserEscapeIndex,Httpcontext.current.Session, Id, Amount,Price, "", "", "", "", "", "", "", "", "", "", constring) 

Amount is the number of items you want to add, mostly 1 of the time,
price is de price this custumer has to pay, I think you can calculate it with the original price and customerdiscount.
And Id is the Id of the article you want to add into the shoppingcart.
pawel87  
#3 Posted : Monday, May 31, 2010 4:32:15 PM(UTC)
Guest

Rank: Guest

Groups: Guest
Joined: 9/17/2008(UTC)
Posts: 66

I've got (strange?) problem with shop order procedure.

I implemented function which set shop string with 3 parameters (article id, amount, price)
I use "price" parameter, because I want to have price included discount for specified user.
So, my shop string looks like: "1410$2$267.75#1409$1$0#1418$1$97.75#"
Now, when I look at shopping order wizard, prices for each product and total amount looks correct,
but when I receive confirmation e-mail I've got there strange prices.
e.g for 2 products with price 267.75 it shows: "2 26.775,00 53.550,00" (amount, price, total price).

Maybe price value in shop string is not in correct format?
Any suggestions? Thanks




bart  
#4 Posted : Monday, May 31, 2010 4:48:06 PM(UTC)
bart

Rank: Administration

Reputation:

Groups: Administration
Joined: 10/8/2008(UTC)
Posts: 190
Man

Was thanked: 1 time(s) in 1 post(s)
Your priceformat is the shopstring is correct

Here is an example of a shopstring that works and the format is the same
Code:
109896$1$8.25#113990$5$34.95#

If the format here is wrong, the total amount is also calculated wrong.

In your "final order layout" the prices are also correct.
Are you doing something with the shopstring after this final step?
pawel87  
#5 Posted : Tuesday, June 1, 2010 3:22:07 PM(UTC)
Guest

Rank: Guest

Groups: Guest
Joined: 9/17/2008(UTC)
Posts: 66

When I check shop string in ShopOrders table, it's in correct format, e.g. 1419$3$546.55#1420$1$200.00#1414$1$0#
but values in e-mail are still wrong...
bart  
#6 Posted : Tuesday, June 1, 2010 3:27:11 PM(UTC)
bart

Rank: Administration

Reputation:

Groups: Administration
Joined: 10/8/2008(UTC)
Posts: 190
Man

Was thanked: 1 time(s) in 1 post(s)
can you check your maillayout for typo's?
If the final orderlayout is good, it can't be your mail layout isn't
pawel87  
#7 Posted : Tuesday, June 1, 2010 4:06:43 PM(UTC)
Guest

Rank: Guest

Groups: Guest
Joined: 9/17/2008(UTC)
Posts: 66

Quote:
can you check your maillayout for typo's?


How should I understand "typo's" in maillayout?
I haven't changed anything in mail layout.

Could you check our website to see how it looks?
http://tactical.pol01.sienn.com/Basis.aspx?Tid=2&Lid=30&Lit=VIEW&STIJL=3&QUERY=TACU_ShopArtikel.ArtikelGroepId=1&Hmi=0
(Some product prices are only visible for logged and approved users.)


On the right top corner you can see shopping card, and below is small arrow which redirect user to confirm page.
As you will see, in the last step (accept order list before sending email), shop string will look correctly and after all values in email will be wrong.


Joey  
#8 Posted : Tuesday, June 1, 2010 4:16:20 PM(UTC)
Joey

Rank: Administration

Reputation:

Groups: Moderators, Administration, Member
Joined: 7/16/2009(UTC)
Posts: 30
Man
Netherlands
Location: Groesbeek

Thanks: 1 times
Could you paste the code from your mail layout?
bart  
#9 Posted : Wednesday, June 2, 2010 11:35:56 AM(UTC)
bart

Rank: Administration

Reputation:

Groups: Administration
Joined: 10/8/2008(UTC)
Posts: 190
Man

Was thanked: 1 time(s) in 1 post(s)
Hi There,

I see another problem in your site, the header in the overview with customer data is not always created.
Mostly this happens when a dropdownfield or something not shown in userdata in the shop is not filled, you have to make sure alle dropdown and radiolist fields of the customer are filled. the easyest way to do this is type them hidden in your form {!!fieldname__h!!}

Did you change your culture settings on the site somewhere to polish or something?
pawel87  
#10 Posted : Wednesday, June 2, 2010 3:06:41 PM(UTC)
Guest

Rank: Guest

Groups: Guest
Joined: 9/17/2008(UTC)
Posts: 66

Joey wrote:
Could you paste the code from your mail layout?


row mail:
Code:
<table border="0" cellpadding="1" cellspacing="1" height="bgcolor=" width="570">
     <tr>
         <td style="font-size: 10pt; font-family: Arial;" valign="top" width="120">
         <p style="font-size: 10pt; font-family: Arial;">{!!ShopArtikel.ArtikelCode!!}</p>
         </td>
         <td style="font-size: 10pt; font-family: Arial;" valign="top" width="200">
         <p style="font-size: 10pt; font-family: Arial;">{!!ShopArtikel.Omschrijving!!}<br />
         {!!Art.ExtraInfo01!!}{!!Art.ExtraInfo02!!}{!!Art.ExtraInfo03!!}{!!Art.ExtraInfo04!!}
         </p>
         <font size="2"></font></td>
         <td style="font-size: 10pt; font-family: Arial;" valign="top" width="75">
         <p style="font-size: 10pt; font-family: Arial;" align="right">{!!Aantal!!}</p>
         </td>
         <td style="font-size: 10pt; font-family: Arial;" valign="top" width="75">
         <p style="font-size: 10pt; font-family: Arial;" align="right">{!!Regeleenheid!!}</p>
         </td>
         <td valign="top" width="100">
         <p align="right"><b>{!!Regeltotaal!!}</b></p>
         </td>
     </tr>
</table>


footer mail:

Code:
<table border="0" cellpadding="1" cellspacing="1" width="570">
     <tr>
         <td bgcolor="#0c7eb0" valign="top" width="120">&nbsp;</td>
         <td bgcolor="#0c7eb0" valign="top" width="125">&nbsp;</td>
         <td bgcolor="#0c7eb0" valign="top" width="150"><br />
         </td>
         <td bgcolor="#0c7eb0" valign="top" width="175">
         <p align="right"><font color="#fddc05">&nbsp;<span style="color: #ffffff;">===============</span></font></p>
         </td>
     </tr>
</table>
<table border="0" cellpadding="1" cellspacing="1" height="bgcolor=" width="570">
     <tr>
         <td valign="top" width="45">&nbsp; </td>
         <td style="font-size: 10pt; font-family: Arial;" valign="top" width="200">&nbsp; </td>
         <td style="font-size: 10pt; font-family: Arial;" valign="top" width="150"><br />
         </td>
         <td style="font-size: 10pt; font-family: Arial;" valign="top">
         <p style="font-size: 10pt; font-family: Arial;" align="right">&nbsp;</p>
         </td>
     </tr>
     <tr>
         <td style="font-size: 10pt; font-family: Arial;" valign="top"><br />
         </td>
         <td style="font-size: 10pt; font-family: Arial;" valign="top"><br />
         </td>
         <td style="font-size: 10pt; font-family: Arial;" valign="top">
         <p style="font-size: 10pt; font-family: Arial;" align="right">Bezorgkosten</p>
         </td>
         <td style="font-size: 10pt; font-family: Arial;" align="right" valign="top">
         <p style="font-size: 10pt; font-family: Arial;" align="right">&nbsp;&euro; {!!Bezorgkosten!!}</p>
         </td>
     </tr>
     <tr>
         <td style="font-size: 10pt; font-family: Arial;" valign="top"><br />
         </td>
         <td style="font-size: 10pt; font-family: Arial;" valign="top"><br />
         </td>
         <td style="font-size: 10pt; font-family: Arial;" valign="top"><br />
         </td>
         <td style="font-size: 10pt; font-family: Arial;" align="right" valign="top">===============</td>
     </tr>
     <tr>
         <td style="font-size: 10pt; font-family: Arial;" valign="top" width="45">
         <p style="font-size: 10pt; font-family: Arial;" align="right">BTW &nbsp;</p>
         </td>
         <td style="font-size: 10pt; font-family: Arial;" valign="top" width="200">
         <p style="font-size: 10pt; font-family: Arial;" align="left">&euro; {!!TotaalbedragBTW!!}</p>
         </td>
         <td style="font-size: 10pt; font-family: Arial;" valign="top" width="150">
         <p style="font-size: 10pt; font-family: Arial;" align="right">Totaalbedrag&nbsp;inclusief BTW:</p>
         </td>
         <td style="font-size: 10pt; font-family: Arial;" align="right" valign="top"><b>&euro; {!!Totaalbedraginclusief!!}</b></td>
     </tr>
   
</table>


pawel87  
#11 Posted : Wednesday, June 2, 2010 4:19:35 PM(UTC)
Guest

Rank: Guest

Groups: Guest
Joined: 9/17/2008(UTC)
Posts: 66

Ok, I found the reason why e-mail was generated with strange values.
Only what I did, was changing "." to "," in shopstring
So, when I had shop string like:
Code:
1409$5$0#1411$1$0#1410$4$243.15#

confirmation e-mail was generated wrong.
But when I changed this string into: "
Code:
1409$5$0#1411$1$0#1410$4$243,15#

prices are generated correctly.

bart  
#12 Posted : Friday, June 4, 2010 4:26:57 PM(UTC)
bart

Rank: Administration

Reputation:

Groups: Administration
Joined: 10/8/2008(UTC)
Posts: 190
Man

Was thanked: 1 time(s) in 1 post(s)
So,

It is the culture, or language settings on your system or somewhere in your code.
by default this should be "en_US" I thougt, if you use some european, it confuses "." and ","
gregfd  
#13 Posted : Monday, September 6, 2010 1:16:16 PM(UTC)
gregfd

Rank: Advanced Member

Reputation:

Groups: Member
Joined: 2/6/2009(UTC)
Posts: 55
Man
Location: Wroclaw

bart wrote:

I see another problem in your site, the header in the overview with customer data is not always created.
Mostly this happens when a dropdownfield or something not shown in userdata in the shop is not filled, you have to make sure alle dropdown and radiolist fields of the customer are filled. the easyest way to do this is type them hidden in your form {!!fieldname__h!!}



Hi Bart,

We have problem like you wrote up but it doesn't show only in mail layout. We can see it on the website but no on mail layout. Also we check it in db and in field KlantId is -1. What it can be?

We chacek all dropdowns (related fields) and everything looks good.
Certico Websolutions - www.certico.pl
bart  
#14 Posted : Monday, September 6, 2010 2:09:40 PM(UTC)
bart

Rank: Administration

Reputation:

Groups: Administration
Joined: 10/8/2008(UTC)
Posts: 190
Man

Was thanked: 1 time(s) in 1 post(s)
Hi Greg,

I don't know,
If I check the website I don't recieve an e-mail at all.
And I don't see the order in de DataBase.
"ShopOrders" has a related field "Status", I think this is NULL but it should be filled with some value.
can you make sure this field is filled correctly?
gregfd  
#15 Posted : Monday, September 6, 2010 2:18:30 PM(UTC)
gregfd

Rank: Advanced Member

Reputation:

Groups: Member
Joined: 2/6/2009(UTC)
Posts: 55
Man
Location: Wroclaw

Hello,

Status field is filled corectly. I've check it in db. Only thing which is wrong is KlantId. This field gets value -1. When I change this value for real Customer Id it appears in Orders in SIENN. Some way SIENN doesn't add correct KlantId...
Certico Websolutions - www.certico.pl
bart  
#16 Posted : Monday, September 6, 2010 3:20:52 PM(UTC)
bart

Rank: Administration

Reputation:

Groups: Administration
Joined: 10/8/2008(UTC)
Posts: 190
Man

Was thanked: 1 time(s) in 1 post(s)
strange,

Is the customer still logged in after completing the order?

Of course you can add the following to stock adjustment

Code:

Query = "Update " & CID & "U_ShopOrders "
Query = Query & " Set KlantId=" & pbw.get_customerid_cookie(session)
Query = Query & " where id = " & Orderid
Dim Com As New SqlCommand(Query, Con)
Con.Open()
Com.ExecuteNonQuery()
Con.Close()


But this shouldn't be necessary
I think, when a customer orders something without logging in, he does't have a loginname.
Maybe, this field also had to be set, but I'm not sure.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.