Email Button in BuyProduct.aspx
-
- Commander (CMDR)
- Posts: 118
- Joined: Sat Dec 20, 2008 11:27 pm
Email Button in BuyProduct.aspx
How can I add an "Email Us" button in BuyProduct.aspx so a customer can email about an item and the subject line would contain the Sku and Name of the item? Thanks!
Re: Email Button in BuyProduct.aspx
We have feedback email form control available here viewtopic.php?f=47&t=17102
You can try to use the same control in product page along with your custom changes to put sku and name in the subject line.
All you will need is one small change to get the product name and sku. First edit the ContactUs.ascx.cs file and locate following line in it
and then replcae it with following code
Now if you place this control in product page or in BuyProductDialog it will be able to send the Name and sku in mail subject.
You can try to use the same control in product page along with your custom changes to put sku and name in the subject line.
All you will need is one small change to get the product name and sku. First edit the ContactUs.ascx.cs file and locate following line in it
Code: Select all
mailMessage.Subject = "Feedback";
Code: Select all
CommerceBuilder.Products.Product product = CommerceBuilder.Products.ProductDataSource.Load(AbleCommerce.Code.PageHelper.GetProductId());
if(product != null)
mailMessage.Subject = string.Format("Name: {0}, SKU: {1}", product.Name, product.Sku);
else
mailMessage.Subject = "Feedback";
-
- Commander (CMDR)
- Posts: 118
- Joined: Sat Dec 20, 2008 11:27 pm
Re: Email Button in BuyProduct.aspx
Thanks for this. I modified it and have it working. I had to add a using AbleCommerce.code statement to get the PageHelper to work.
Re: Email Button in BuyProduct.aspx
OK great! I just updated the above code snippet with missing statement that you mentioned.