Skip to content

Instantly share code, notes, and snippets.

View arulprabakaran's full-sized avatar
🏠
Working from home

Arul Prabakaran arulprabakaran

🏠
Working from home
View GitHub Profile
@rustyswayne
rustyswayne / gist:598049064a02fce1597c
Created October 27, 2014 16:54
Manually generating an order in Merchello
// Adding the shipmethod is typically done in the back office through the UI.
// Interested in the use case to dynamically add theses?
var key = Constants.ProviderKeys.Shipping.FixedRateShippingProviderKey;
var defaultCatalogKey = Constants.DefaultKeys.Warehouse.DefaultWarehouseCatalogKey;
// this would have to be done through the back office as it uses an internal service
var us = MerchelloContext.Current.Services.StoreSettingService.GetCountryByCode("US");
var usCountry = new ShipCountry(defaultCatalogKey, us);
((ServiceContext)MerchelloContext.Current.Services).ShipCountryService.Save(usCountry);
@primaryobjects
primaryobjects / gist:8442193
Last active January 13, 2022 09:49
MVC C# .NET: Passing data from a child partial view to the parent page via ViewContext.ViewBag. This example demonstrates how to set the page title from a child partial view.
// In your HTML helper class, include this function:
/// <summary>
/// Returns the ViewBag of the parent page. Allows a child view to access the parent view's ViewBag object. A child view may then set a property accessible by the parent page.
/// </summary>
/// <returns>ViewBag</returns>
public static dynamic GetPageViewBag(this HtmlHelper html)
{
if (html == null || html.ViewContext == null) //this means that the page is root or parial view
{
@lancejpollard
lancejpollard / meta-tags.md
Created March 5, 2012 13:54
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">