Page 1 of 1
Email Button in BuyProduct.aspx
Posted: Fri Mar 22, 2013 9:38 pm
by euroluxantiques
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
Posted: Mon Mar 25, 2013 3:51 am
by mazhar
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
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";
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.
Re: Email Button in BuyProduct.aspx
Posted: Mon Mar 25, 2013 3:01 pm
by euroluxantiques
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
Posted: Tue Mar 26, 2013 3:30 am
by mazhar
OK great! I just updated the above code snippet with missing statement that you mentioned.