Email Button in BuyProduct.aspx

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
euroluxantiques
Commander (CMDR)
Commander (CMDR)
Posts: 118
Joined: Sat Dec 20, 2008 11:27 pm

Email Button in BuyProduct.aspx

Post by euroluxantiques » Fri Mar 22, 2013 9:38 pm

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!

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Email Button in BuyProduct.aspx

Post by mazhar » Mon Mar 25, 2013 3:51 am

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

Code: Select all

mailMessage.Subject = "Feedback";
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.

euroluxantiques
Commander (CMDR)
Commander (CMDR)
Posts: 118
Joined: Sat Dec 20, 2008 11:27 pm

Re: Email Button in BuyProduct.aspx

Post by euroluxantiques » Mon Mar 25, 2013 3:01 pm

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.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Email Button in BuyProduct.aspx

Post by mazhar » Tue Mar 26, 2013 3:30 am

OK great! I just updated the above code snippet with missing statement that you mentioned.

Post Reply