Site structure
Version 7.x > Site structure > custom buy button View modes: 
User avatar
Member
Member
Edward-d - 11/16/2013 4:13:42 PM
   
custom buy button
Hello,

I need to create something like an alternative buy button but without shopping cart, and when people press it, they'l redirect to mailform. There i;ve should use one of the default templates, something like "E-commerce - Order status notification to administrator" , but i dont know how to transmit order details from product page. Or maybe i can make this easier?


Best regards,
Edward

User avatar
Kentico Consulting
Kentico Consulting
Kentico_RichardS - 11/17/2013 4:12:21 AM
   
RE:custom buy button
Hi,

Thank you for your message.

Can you please more elaborate on the issue? Basically you want to have a separate button next to "add to cart" which will be a link to some other page where you would have ...? (What do you mean by "E-commerce - Order status notification to administrator"?

What data you want to transfer? I think the transfering itself can be easy part - you can add a query string with e..g the product ID and then get this query string in the new page and from that get all information about the product.

Kind regards,
Richard Sustek

User avatar
Member
Member
Edward-d - 11/17/2013 8:20:06 AM
   
RE:custom buy button
Thank your for your answer!


Alright, i need to transfer some data (product name, price and selected options) to other page

should be looking like this - http://oi44.tinypic.com/eq9hch.jpg , after product submit redirect on formpage,

found some form samples, something like this one:
<html>
<head>
</head>
<body>
<p>Status of your order has changed.</p>
<table cellspacing="0" cellpadding="5" border="1" bordercolor="black" width="600px">
<tr>
<td colspan="2" valign="bottom" height="50">
<table width="100%" height="100%">
<tr>
<td style="text-align: left; vertical-align: bottom;"
<span style="font-size: 18pt">Your order</span>
</td>
<td style="text-align: center; vertical-align: middle;">
<span style="font-family: Garamond, Times, serif; font-size: 24pt; font-style: italic;">Company logo</span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="text-align: left">
<br />
<table width="100%">
<tr>
<td style="text-align: left;" valign="bottom">
<strong>Invoice number:</strong>
</td>
<td style="text-align: right; padding-right: 10px">
{%Order.OrderInvoiceNumber%}
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>


but can't find any samples how to add data to strings. " you can add a query string with e..g the product ID and then get this query string in the new page and from that get all information about the product." looking as what i need!! but im not sure how to realize

Best regards,
Edward

User avatar
Kentico Consulting
Kentico Consulting
Kentico_RichardS - 11/17/2013 8:34:20 AM
   
RE:custom buy button
Hi Edward,

So to clarify your goal -> You have a form in the same page that is your product or is it some completely different page?

I believe it is a different page. So in your product page where you are creating the link to the page with form you have to create the link to be something like this:

<a href="something?productid=1">My link</a>

then on your page you want to save the question and e-mail along with the product information? Is that your goal?

If so you would have to create a global event ( http://devnet.kentico.com/docs/devguide/index.html?event_handlers_overview.htm ) for a method which would fire whenever a new record of your form is created and then in this method you would get the query string from the previous page (productid) and then get the SKU bounded to this ID and get the information you need.

However this is quite complicated issue and we are not able to code this for you. There could be a simpler solution -> You could easily add a new field to your form such as "Product name" and the customer would need to fill the product name of which the question is about.

Kind regards,
Richard Sustek

User avatar
Member
Member
Edward-d - 11/17/2013 4:32:36 PM
   
RE:custom buy button
Yes, alright, Thanks alot for your answer! This looking really hard for beginner, so i gonna use your hint and add another formpage with new fields.

I know, u may be tired of us, but we have the last unresolved issue, maybe u can help us, Richard


switch (this.OptionCategory.CategorySelectionType)
{
case OptionCategorySelectionTypeEnum.Dropdownlist:

LocalizedDropDownList dropDown = (LocalizedDropDownList)this.SelectionControl;
foreach (ListItem item in dropDown.Items)
{
if (item != null)
{
SKUInfo sku = SKUInfoProvider.GetSKUInfo(ValidationHelper.GetInteger(item.Value, 0));

if (sku != null && !string.IsNullOrEmpty(sku.SKUImagePath))
{

item.Attributes.Add("onclick", "jQuery('.fancyboxProductImg').html('<img alt=\"" + sku.SKUName + "\" src=\"" + URLHelper.ResolveUrl(sku.SKUImagePath) + "\" width=\"240\" height=\"240\" />')");

}
}
}
break;
}

Why item.attributes not work in my dropdown menu? mean onclick /onchange methods? this working perfectly with other button types, thought I had made a mistake in adapting, but "item.Text +=" working properly
sorry for the question repeat .


Best regards,
Edward

User avatar
Kentico Consulting
Kentico Consulting
Kentico_RichardS - 11/20/2013 1:21:26 AM
   
RE:custom buy button
Hi,

Unfortunately I dont know what is the purpose of this code and where you are using it. This however seems to be a more general issue and I would suggest you try to look something like this on e.g. http://stackoverflow.com/

Kind regards,
Richard Sustek