Have A Copy of New User Welcome Message Sent to You (ASPDotNetStoreFront)
ASPDNSF Version: 9 (C# + MS SQL)
If you would like to have a copy of the new user welcome email message sent to you whenever a new user signsup to your shop, well you'd assume they would have this feature in the system already...but that's not the case. This feature is currently lacking in AspDotNetStorefront as of version 9 (ML).
No fear, Ben is here!
To enable this feature it will take a bit of C# work and some tinkering.
First, open up createaccount.aspx.cs using your favorite text editor. Then find the lines of code where the welcome message is sent to the new user...
if (AppLogic.AppConfigBool("SendWelcomeEmail") && EMailField.IndexOf("@") != -1)
{
// don't let a simple welcome stop checkout!
try
{
string body = AppLogic.RunXmlPackage(...
Now, add the following code after the try and catch...
try{
string body = AppLogic.RunXmlPackage(AppLogic.AppConfig("XmlPackage.WelcomeEmail"),
null,
ThisCustomer,
this.SkinID,
"",
"fullname=" + ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
false,
false,
this.EntityHelpers);
AppLogic.SendMail(AppLogic.GetString("createaccount.aspx.79", ThisCustomer.SkinID, ThisCustomer.LocaleSetting),
body,
true,
AppLogic.AppConfig("MailMe_FromAddress"),
AppLogic.AppConfig("MailMe_FromName"),
"youremail@yourdomain.com",
ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
"",
AppLogic.MailServer());
}catch{}
...being sure to change "youremail@yourdomain.com" to the email address where you want to receive the notifications.
Example:
if (AppLogic.AppConfigBool("SendWelcomeEmail") && EMailField.IndexOf("@") != -1)
{
// don't let a simple welcome stop checkout!
try
{
string body = AppLogic.RunXmlPackage(AppLogic.AppConfig("XmlPackage.WelcomeEmail"),
null,
ThisCustomer,
this.SkinID,
"",
"fullname=" + ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
false,
false,
this.EntityHelpers);
AppLogic.SendMail(AppLogic.GetString("createaccount.aspx.79", ThisCustomer.SkinID, ThisCustomer.LocaleSetting),
body,
true,
AppLogic.AppConfig("MailMe_FromAddress"),
AppLogic.AppConfig("MailMe_FromName"),
EMailField,
ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
"",
AppLogic.MailServer());
}
catch { }
// below added by Benjamin Eskew (Aug 25, 2010)
try{
string body = AppLogic.RunXmlPackage(AppLogic.AppConfig("XmlPackage.WelcomeEmail"),
null,
ThisCustomer,
this.SkinID,
"",
"fullname=" + ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
false,
false,
this.EntityHelpers);
AppLogic.SendMail(AppLogic.GetString("createaccount.aspx.79", ThisCustomer.SkinID, ThisCustomer.LocaleSetting),
body,
true,
AppLogic.AppConfig("MailMe_FromAddress"),
AppLogic.AppConfig("MailMe_FromName"),
"myemail@mydomain.com",
ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
"",
AppLogic.MailServer());
}catch{}
// the above added by Benjamin Eskew (Aug 25, 2010)
}
Now save the file and upload it to your server and that's that! Do realize that this is just a simple copy of the message, not a custom message sent to the administrator. In order to make something like that you'll have to create a custom XmlPackage to handle it and use that one in place of the current one in use (XmlPackage.WelcomeEmail).
As you can see from my current and previous posts, I've been working a lot with AspDotNetStorefront lately and have plans to continue posting information articles like this one here, so stay tuned!
Use Facebook “Like” Widget in product.SimpleProduct.xml XMLPackage in AspDotNetStorefront
ASPDNSF Version: 9 (C# + MS SQL)
It's very easy to embed the Facebook "Like" widget into an XMLPackage (like the product pages for example) within AspDotNetStorefront. Simply add the following code to your XMLPackage:
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.yoursite.com%2F(!PAGEURL!)&layout=button_count& show_faces=false&width=50&action=like&font=arial&colorscheme=light&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:21px;" allowTransparency="true"></iframe>
Of course, you should adjust the iframe variables to your liking.
Use Images as Add To Cart/Add To Wish List Buttons with AspDotNetStorefront
ASPDNSF Version: 9 (C# + MS SQL)
By default AspDotNetStorefront uses basic form buttons for the Add To Cart and Add To Wish List features in the design. If you'd like to use images as those buttons instead you will need to make some modifications.
First, make sure you have some good images to use and then upload/FTP them to the theme images directory "App_Themes/Your_Skin_Folder/images/". Now go to the AspDotNetStorefront back-end administration and go to "Configuration > Advanced > AppConfig Parameters" and find the config "AddToCart.AddToCartButton" and update it with the image you are going to use for the Add To Cart button. Then, find the config "AddToCart.AddToWishButton" and update it with the image you are going to use for the Add To Wish List button. Finally, find the config "AddToCart.UseImageButton" and change it to true. Your Add To Cart forms should now use your images as buttons.
Display MSRP in product.SimpleProduct.xml XMLPackage in AspDotNetStorefront
ASPDNSF Version: 9 (C# + MS SQL)
By default in AspDotNetStorefront the MSRP for products is not displayed or used within the product.SimpleProduct.xml XMLPackage, so if you would like to use or display it you will need to make some fine-tuned adjustments.
The Quick and Dirty Way (not as efficient):
In your product.SimpleProduct.xml XMLPackage find the lines where database queries are being made, like:
...
<query name="Products" rowElementName="Product" runif="edit">
<sql>
<![CDATA[
exec dbo.aspdnsf_EditOrderProduct @ShoppingCartRecID, @CustomerLevelID
]]>
</sql>
<queryparam paramname="@ShoppingCartRecID" paramtype="request" requestparamname="CartRecID" sqlDataType="int" defvalue="0" validationpattern="^\d{1,10}$" />
<queryparam paramname="@CustomerLevelID" paramtype="system" requestparamname="CustomerLevelID" sqlDataType="int" defvalue="0" validationpattern="" />
</query>
...
and add a new database query by adding the following after the last query:
<query name="Variant" rowElementName="Price" runif="showproduct">
<sql>
<![CDATA[
select MSRP from dbo.ProductVariant with(NOLOCK) where ProductID=@ProductID and IsDefault=1
]]>
</sql>
<queryparam paramname="@ProductID" paramtype="request" requestparamname="ProductID" sqlDataType="int" defvalue="0" validationpattern="^\d{1,10}$" />
</query>
ex.
...
<query name="Products" rowElementName="Product" runif="edit">
<sql>
<![CDATA[
exec dbo.aspdnsf_EditOrderProduct @ShoppingCartRecID, @CustomerLevelID
]]>
</sql>
<queryparam paramname="@ShoppingCartRecID" paramtype="request" requestparamname="CartRecID" sqlDataType="int" defvalue="0" validationpattern="^\d{1,10}$" />
<queryparam paramname="@CustomerLevelID" paramtype="system" requestparamname="CustomerLevelID" sqlDataType="int" defvalue="0" validationpattern="" />
</query>
<query name="Variant" rowElementName="Price" runif="showproduct">
<sql>
<![CDATA[
select MSRP from dbo.ProductVariant with(NOLOCK) where ProductID=@ProductID and IsDefault=1
]]>
</sql>
<queryparam paramname="@ProductID" paramtype="request" requestparamname="ProductID" sqlDataType="int" defvalue="0" validationpattern="^\d{1,10}$" />
</query>
...
Now, in your XMLPackage wherever you'd like to display the MSRP, simply add the following:
<xsl:value-of select="aspdnsf:FormatCurrency(/root/Variant/Price/MSRP)" disable-output-escaping="yes" />
The Efficient Way (MS SQL):
Using SQL Management Studio, open up the stored procedure and locate near the bottom where it reads:
...
SELECT
p.*,
pv.VariantID, pv.name VariantName, pv.Price, pv.Description VariantDescription, isnull(pv.SalePrice, 0) SalePrice, isnull(SkuSuffix, '') SkuSuffix, pv.Dimensions, pv.Weight, isnull(pv.Points, 0) Points, pv.Inventory, pv.ImageFilenameOverride VariantImageFilenameOverride, pv.isdefault, pv.CustomerEntersPrice, isnull(pv.colors, '') Colors, isnull(pv.sizes, '') Sizes,
...
simply add the MSRP table call to the select statement, like:
...
SELECT
p.*,
pv.VariantID, pv.name VariantName, pv.Price, pv.MSRP, pv.Description VariantDescription, isnull(pv.SalePrice, 0) SalePrice, isnull(SkuSuffix, '') SkuSuffix, pv.Dimensions, pv.Weight, isnull(pv.Points, 0) Points, pv.Inventory, pv.ImageFilenameOverride VariantImageFilenameOverride, pv.isdefault, pv.CustomerEntersPrice, isnull(pv.colors, '') Colors, isnull(pv.sizes, '') Sizes,
...
Now, execute the statement.
Finally, in your XMLPackage where you'd like to display the MSRP simply add the following:
<xsl:value-of select="aspdnsf:FormatCurrency(MSRP)" disable-output-escaping="yes" />
Or, if you're calling it from outside of the Product template, use the full xpath, like:
<xsl:value-of select="aspdnsf:FormatCurrency(/root/Products/Product/MSRP)" disable-output-escaping="yes" />
Display SKU in product.SimpleProduct.xml XMLPackage in AspDotNetStorefront
ASPDNSF Version: 9 (C# + MS SQL)
By default in AspDotNetStorefront the SKU for products is not displayed or used within the product.SimpleProduct.xml XMLPackage, so if you would like to use or display it you will need to make some fine-tuned adjustments.
First:
In your product.SimpleProduct.xml XMLPackage find the lines where the Product is being handled, namely the lines starting with:
...
<xsl:template match="Product">
<xsl:param name="pName" select="aspdnsf:GetMLValue(Name)"></xsl:param>
...
...
and add a new parameter call to the parameters by adding:
<xsl:param name="pSKU" select="aspdnsf:GetMLValue(SKU)"></xsl:param>
ex.
...
<xsl:template match="Product">
<xsl:param name="pName" select="aspdnsf:GetMLValue(Name)"></xsl:param>
<xsl:param name="pDescription" select="aspdnsf:GetMLValue(Description)"></xsl:param>
<xsl:param name="pSalesPromptName" select="aspdnsf:GetMLValue(SalesPromptName)"></xsl:param>
<xsl:param name="pSKU" select="aspdnsf:GetMLValue(SKU)"></xsl:param>
...
...
Now, in your XMLPackage wherever you'd like to display the SKU, simply add the following:
<xsl:value-of select="$pSKU" disable-output-escaping="yes"/>
Using this method you can call any field from the Product table including Variants, like if you simply wanted to get the ProductID so you can display it in the XMLPackage...
...set parameter for it:
<xsl:param name="pID" select="aspdnsf:GetMLValue(ProductID)"></xsl:param>
...use it:
...href="http://www.yoursite.com/EMailproduct.aspx?productid={$pID}"><img src="http://www.yoursite.com/App_Themes/Skin_1/images/Icon-Email.gif"...
Make Breadcrumbs in AspDotNetStorefront template.master
ASPDNSF Version: 9 (C# + MS SQL)
If you've not gone through every nook and cranny of the AspDotNetStorefront manual chances are that you haven't figured out how to properly create "breadcrumbs" with your navigation.
No fear, Ben is here.
In your template.master skin file, located at "App_Templates/Your_Skin_Folder/template.master", simply add the following immediately after the opening id="content" DIV:
<div id="breadcrumbs">
<a href="http://www.yoursite.com/default.aspx">HOME</a> ::
<asp:Literal ID="SectionTitle" runat="server" Text='' />
</div>
ex.
...
<div id="content">
<!-- CONTENTS START -->
<div id="breadcrumbs">
<a href="http://www.yoursite.com/default.aspx">HOME</a> ::
<asp:Literal ID="SectionTitle" runat="server" Text='' />
</div>
<asp:ContentPlaceHolder ID="PageContent" runat="server">
</asp:ContentPlaceHolder>
<!-- CONTENTS END -->
</div>
...
Although, you don't absolutely NEED to add it within the content DIV, I just placed it there because it's the top-most element within the content column in the layout. Technically, you can add it anywhere you'd like within the template.master file.
