Thursday, November 26, 2020

Configure Multiple Web store on (Live)

 1.Request license if not already created

Refer to the Configure Multiple Web store on (Beta) for more details


2.Request Certificate for the new webshop 

https://sanacommerce.visualstudio.com/Sana%20Hosting/_dashboards/dashboard/8dc80a0e-5113-49a4-bc3b-d813559d7d73


3. Create a new webshop 

eg: ChampionPowerCALive

 When you created a new webshop it required to have an NT popup because the site needs to be tested before granting access to the public users. (to Show NT popup Anonymous Authentication need to be Disabled).

 When we want to add a new webshop to Live, we do not directly bind the website URL to exist Live Web site (as we do in Beta sites).  we create the new webshop separately.


1.Authentication
2. Current Live Website

3.Newly created web site for With NT Popup



because IIS only provides one Authentication configuration (NT Popup) per site. (it does not support multiple NT Popup even we bind to different hostnames for one web site)

if the current shop is already on Live, Then its Anonymous Authentication is Enabled (NT popup is been disabled ).

As a solution for this, we create a new Webshop on IIS (ChampionPowerCALiveand set it's NT popup Enabled. to enable the NT Popup, we set as following (Image: 3.Newly created web site for With NT Popup)

Anonymous Authentication - Disable 

Basic Auth - Enabled.


 4. Add new licenses to the Live environment.

 add to bin folder/ backup old


5. Select new SSL certificate

right click your Live site > site Binding > Edit > SSL certificate > select the correct / new license file.

 


6. Run the script and add new web store to live > restart a pool





7. Need to change the app pool of the newly created site

for this example, we set  "ChampionPowerCALive" to the Original Live site app pool.

web site ChampionPowerLive and ChampionPowerCALive both use ChampionPowerLive app pool

else it will get an error on the new webshop.




8. Then go to the new webshop and the popup need to be displayed.

 




created ticket for New SSL Certificate for Champion Power Equipment.

https://sanacommerce.visualstudio.com/Sana%20Hosting/_workitems/edit/77686?src=WorkItemMention&src-action=artifact_link


Set after testing

after testing, we don't need an additional webshop with NT popup,

then add domain url of additional shop to live bindings



















Configure Multiple Web store on (Beta)

shared by Sana. 

https://help.sana-commerce.com/sana-commerce-93/how_tos/multiple_domains_and_websites/configure_multiple_websites

--------------------------------------------------------------------------------------------------------

For this example, I will use the Champion Power project.

To Configure the webshop basically, we need the following details.

1. Website Id, 2. Web site Name, 3.Domain(URL). 

if  Project Lead request to create a domain URL as a placeholder like normal sana store domains,

Follow these steps.   

1 Create a new beta URL with the current beta URL,(If new URL not provided)

current webshop URL: https://championpower-beta.sanastores.net/

new webshop URL: https://championpower-ca-beta.sanastores.net/


2. If you create a new webshop URL you need to map it on the server.

* Create an Azure DevOps ticket and request to map the new URL to the server.

Ticket as following, 

https://sanacommerce.visualstudio.com/Sana%20Hosting/_workitems/edit/76731

Please create a URL as following and map that URL to (your Projects server) 

URL: https://championpower-ca-beta.sanastores.net/

server IP: 40.118.191.64 can find from the Start site password section


Server IP details can get from the Password section of the starter site.

https://start.intranet.sana-commerce.com/Pages/Project/PasswordList.aspx


3. Request new Licence for webshop

Go to Sana community and navigate to the License page: 

https://community.sana-commerce.com/MySana/Licensepage.aspx

search the project and open the latest License in a separate tab. (last updated License )

create a new license and copy all the details from the last updated License.

update the Amount of webstores 

 Webstore domains sections:  add new beta and live URLs 

eg: 

old license Amount of webstores: 1

new  license Amount of webstores: 2

 


* Check the newly created license details with senior team members.
* After license creation need to get approval from the Project Manager

* After approving the license, go to Beta RDP ,keep a backup of the current license, and replace it with the new license.

* Make sure the beta site is Still working without any issue.


4. * If the license is updated only run the script else current webshop also will get an error (regarding license) 



5 Run the script

you can get the web store creation script by the following link

https://help.sana-commerce.com/sana-commerce-93/how_tos/multiple_domains_and_websites/configure_multiple_websites


NewWebsiteID: SanaStoreCA

New Website Name: SanaStoreCA

Domainhttps://championpower-ca-beta.sanastores.net/


6. Go to IIS> Bind the new URL to the Beta site

after the refresh app pool you will see the newly created web store on the dev/beta admin section.

open the new site link, it should open.



7. Update ERP connections details.

when you try to run indexes if getting any errors from ERP then need to check the test connection.


8. Check new Webshop name has been configured from the ERP side. by run Test connection.

else inform to customer. 

eg:

Hi XXXX, 

We have successfully created a new beta shop (SanaStoreCA). It seems the new webshop has not been configured from the ERP side.

Can you please check on this issue. 




-----------------------------------------------------------------------------------------





Configure Multiple Web store (DEV)

 Add web store to existing shop (DEV) 


1. Add web store by script

https://help.sana-commerce.com/sana-commerce-93/how_tos/multiple_domains_and_websites/configure_multiple_websites

For this example, I will use the Intergriah Project

To Configure the webshop basically, we need the following details.

1. Website Id, 2. Web site Name, 3.Domain(URL)


SET @newWebsiteId = N'SANASTORENZ'; -- set a new website ID instead of 'NewWebsiteID'
SET @newWebsiteName = N'NZ STORE'; -- set the name of the new website instead of 'New Website Name'
SET @newWebsiteDomain = N'integriah-dev-nz.corp.ism.nl'; -- set the domain for new website instead of 'localhost'
SELECT @defaultLanguage = Id FROM [Languages] WHERE [IsDefault] = 1;

make sure your domain looks line following (match with license file domains)

eg: integriah-dev-nz.corp.ism.nl

 <string>*.corp.ism.nl</string>
 <string>localhost</string>
 <string>*.local</string>



2. Add license. 
you may need to add the license file. but no need to request a new one,
you can use the existing one using for Multiple webshop related projects 

Eg: Diversey  Project
you will find it from the Bin folder

sanaprojects_dev.license 

else it will give an invalid Licence error.










 

3. Add Web site to IIS

Site > Add Website




4. Add binding to IIS

right-click Web site > Edit Bindings




 5.Update host file
    C:\Windows\System32\drivers\etc\host

127.0.0.1 integriah-dev-nz.corp.ism.nl
127.0.0.1 integriah-dev.corp.ism.nl


6.Update Visual Studio Server settings



6.1 right click your Project Startersite > Properties >select Web tab 
Go to server section > Change to Local IIS >
update Project URL with Sana store url

if the current sanastore URL is localhost give a proper name for it 
eg  localhost  --> integriah-dev.corp.ism.nl






6.Update ERP connections



----------------------------------------------------------------------------------------------------
script used to create new web shop

DECLARE @newWebsiteId nvarchar(50);
DECLARE @newWebsiteName nvarchar(50);
DECLARE @newWebsiteDomain nvarchar(50);
DECLARE @defaultLanguage int;
DECLARE @homePageId nvarchar(max);
DECLARE @customerServicePageId nvarchar(max);

SET @newWebsiteId = N'NewWebsiteID'; -- set a new website ID instead of 'NewWebsiteID'
SET @newWebsiteName = N'New Website Name'; -- set the name of the new website instead of 'New Website Name'
SET @newWebsiteDomain = N'localhost'; -- set the domain for new website instead of 'localhost'
SELECT @defaultLanguage = Id FROM [Languages] WHERE [IsDefault] = 1;

-- basic website info
INSERT INTO [Websites] ([Id], [Name], [DefaultLanguageId]) VALUES (@newWebsiteId, @newWebsiteName, @defaultLanguage);
INSERT INTO [WebsiteLanguages] ([WebsiteId], [LanguageId]) VALUES (@newWebsiteId, @defaultLanguage);
INSERT INTO [WebsiteDomains] ([Id], [WebsiteId], [Domain], [IsDefault]) VALUES (NEWID(), @newWebsiteId, @newWebsiteDomain, 1);
UPDATE users SET Fields.modify('insert <string>{sql:variable("@newWebsiteId")}</string> into (//field[@name="Websites"]/ArrayOfString)[1]')
FROM [AdminUsers] users JOIN [AdminUsersRoles] usersRoles ON users.Id = usersRoles.AdminUserId 
WHERE usersRoles.AdminRoleId = 'FE0072B6-70AA-4C53-8716-1FD9515E4998' and users.Fields.exist('//field[@name="Websites"]/ArrayOfString/string[text()=sql:variable("@newWebsiteId")]') = 0;

-- create Home page
SET @homePageId = CAST(NewId() AS nvarchar(50)) 
INSERT [dbo].[FlexiPages] ([Id], [WebsiteId], [Title], [CreatedDate], [ModifiedDate], [Fields], [Url]) VALUES (@homePageId, @newWebsiteId, N'Home', GETDATE(), GETDATE(), N'<FieldsDictionary><field name="MetaDescription" type="Null" /><field name="MetaTitle" type="Null" /><field name="Content" type="Sana.Commerce.Content.ContentBlockCollection, Sana.Commerce"><ContentBlocks><MainBanner><Id>1423653167815</Id><ImagePath>/content/files/images/Homepage-banner.jpg</ImagePath><Link /></MainBanner><Html><Id>87265895-2884-4A2F-92D4-EFE5239D0135</Id><Content>&lt;br&gt;This is a Flexi-page. On a Flexi page, you are free to use blocks of text and images, to make the pages look just the way you want them to look. You can easily change the images and text of the Flexi-pages in the “Web pages” section in the Sana Admin. You can also use the In-site editor to change the content of the webstore while looking at it.</Content></Html><ImageTiles><Id>68520105-5903-4D6D-9B72-666AF48435AF</Id><Tiles><ImageTile><ImagePath>/content/files/images/place holder 3.jpg</ImagePath><AltText>Block 1 image</AltText><Link /></ImageTile><ImageTile><ImagePath>/content/files/images/place holder 3.jpg</ImagePath><AltText>Block 2 image</AltText><Link /></ImageTile><ImageTile><ImagePath>/content/files/images/place holder 3.jpg</ImagePath><AltText>Block 3 image</AltText><Link /></ImageTile><ImageTile><Link /></ImageTile></Tiles></ImageTiles></ContentBlocks></field></FieldsDictionary>', N'home')

-- create Customer service page
SET @customerServicePageId = CAST(NewId() AS nvarchar(50))
INSERT [dbo].[FlexiPages] ([Id], [WebsiteId], [Title], [CreatedDate], [ModifiedDate], [Fields], [Url]) VALUES (@customerServicePageId, @newWebsiteId, N'Customer service', GETDATE(), GETDATE(), N'<FieldsDictionary><field name="Content" type="Sana.Commerce.Content.ContentBlockCollection, Sana.Commerce"><ContentBlocks><Html><Content>&lt;h1&gt;Customer service&lt;/h1&gt;
&lt;p&gt;&lt;br /&gt;
&lt;/p&gt;
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis nibh neque, egestas et, aliquet a, fermentum at, nunc. In aliquam. Maecenas metus dui, laoreet in, euismod id, iaculis sit amet, felis. Suspendisse consectetuer odio nec est. Sed blandit mauris vel neque. Pellentesque at orci vitae elit iaculis imperdiet. Sed est turpis, blandit vitae, euismod eget, feugiat ac, arcu.&lt;br /&gt;
Duis nisl. Etiam quam ligula, dapibus sed, faucibus eget, volutpat sed, est. Mauris quis sem. Donec iaculis dui fermentum eros. Pellentesque eget libero vitae sapien interdum ullamcorper. Aenean at nulla in velit tristique venenatis. Duis malesuada metus a dolor. Sed ante. Integer mi mi, sodales vitae, adipiscing a, luctus nec, diam.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
Maecenas aliquam aliquet massa. Donec ut purus. Maecenas volutpat, ipsum at consectetuer pretium, urna lorem tempor mi, vitae pellentesque mauris felis eget lorem. Nam ut lectus quis sem placerat venenatis. Nam et nisi non magna pulvinar dignissim. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Phasellus volutpat. Integer suscipit. Mauris egestas accumsan eros. Nunc et massa. Aliquam erat volutpat.
&lt;div style="text-align: center;"&gt;&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;
&lt;/p&gt;</Content><Id>0641C81A-ADDF-4A95-BFB8-6E4CC1793011</Id></Html></ContentBlocks></field></FieldsDictionary>', N'service')

-- create General settings
INSERT [dbo].[Settings] ([Fields], [WebsiteId], [Key], [CreatedDate], [ModifiedDate]) VALUES (N'<FieldsDictionary><field name="DefaultCurrency" type="System.String, mscorlib" storeWithEntity="False"><string>EUR</string></field><field name="DropdownVariants" type="System.Boolean, mscorlib" storeWithEntity="False"><boolean>true</boolean></field><field name="CheckStock" type="System.Boolean, mscorlib" storeWithEntity="False"><boolean>false</boolean></field><field name="RedirectOnAddToBasket" type="System.Boolean, mscorlib" storeWithEntity="False"><boolean>false</boolean></field>
<field name="ShowProgressIndicator" type="System.Boolean, mscorlib" storeWithEntity="False"><boolean>true</boolean></field><field name="ShopEmailAddress" type="System.String, mscorlib" storeWithEntity="False"><string>scdemo@sana-commerce.com</string></field><field name="ShowOrderAmountInBasketMiniature" type="System.Boolean, mscorlib" storeWithEntity="False"><boolean>false</boolean></field><field name="ReferenceNoVisibility" type="System.String, mscorlib" storeWithEntity="False"><string>SalesAgentAndB2BCustomer</string></field><field name="OrderCommentsVisibility" type="System.String, mscorlib" storeWithEntity="False">
<string>SalesAgentAndB2BCustomer</string></field><field name="AdministrationMailList" type="System.String, mscorlib" storeWithEntity="False"><string>scdemo@sana-commerce.com</string></field><field name="PlaceOrderType" type="System.String, mscorlib" storeWithEntity="False"><string>Order</string></field><field name="RequestedDeliveryDateVisibility" type="System.String, mscorlib" storeWithEntity="False"><string>SalesAgentAndB2BCustomer</string></field><field name="EnableNewsletterSubscription" type="System.Boolean, mscorlib" storeWithEntity="False"><boolean>true</boolean></field>
<field name="AnalyticsAccountId" type="System.String, mscorlib" storeWithEntity="False"><string /></field><field name="EnableActionPrices" type="System.Boolean, mscorlib" storeWithEntity="False"><boolean>true</boolean></field><field name="EditOrder" type="System.String, mscorlib" storeWithEntity="False"><string>SalesAgentAndB2BCustomer</string></field><field name="EnableLastViewedProducts" type="System.Boolean, mscorlib" storeWithEntity="False"><boolean>true</boolean></field><field name="CheckoutOfferings" type="System.String, mscorlib" storeWithEntity="False"><string /></field>
<field name="ShowTellaFriend" type="System.Boolean, mscorlib" storeWithEntity="False"><boolean>true</boolean></field><field name="ConfigurableShippingAddress" type="System.String, mscorlib" storeWithEntity="False"><string>SalesAgentAndB2BCustomer</string></field><field name="EnableWishList" type="System.Boolean, mscorlib" storeWithEntity="False"><boolean>true</boolean></field><field name="EnableRatingsAndReviews" type="System.Boolean, mscorlib" storeWithEntity="False"><boolean>true</boolean></field><field name="ShippingCostVatRateId" type="System.String, mscorlib" storeWithEntity="False">
<string /></field><field name="PaymentCostVatRateId" type="System.String, mscorlib" storeWithEntity="False"><string /></field><field name="EnablePromotionCodes" type="System.Boolean, mscorlib" storeWithEntity="False"><boolean>true</boolean></field><field name="ShopName" type="System.String, mscorlib" storeWithEntity="False"><string>Sana Store</string></field><field name="ShopPhoneNumber" type="System.String, mscorlib" storeWithEntity="False"><string>010-1112233</string></field><field name="FromEmailAddress" type="System.String, mscorlib" storeWithEntity="False"><string>scdemo@sana-commerce.com</string>
</field><field name="BccEmailAddresses" type="System.String, mscorlib" storeWithEntity="False"><string /></field><field name="StockPresentation" type="System.String, mscorlib" storeWithEntity="False"><string>ShowIndicator</string></field><field name="HomePageUrl" type="Sana.Commerce.Web.Links.LinkData, Sana.Commerce" storeWithEntity="False"><LinkData><Type>FlexiPage</Type><InternalUrlData>' + @homePageId + '</InternalUrlData></LinkData></field><field name="EnableCreateProspect" type="System.Boolean, mscorlib" storeWithEntity="False"><boolean>true</boolean></field><field name="ShowOrderShippingStatus" type="System.Boolean, mscorlib" storeWithEntity="False">
<boolean>true</boolean></field><field name="MenuDropdownType" type="System.String, mscorlib" storeWithEntity="False"><string>Dropdown</string></field><field name="BreadcrumbVisible" type="System.Boolean, mscorlib" storeWithEntity="False"><boolean>true</boolean></field><field name="WebServiceEnabled" type="System.Boolean, mscorlib" storeWithEntity="False"><boolean>false</boolean></field><field name="ReorderVisibility" type="System.String, mscorlib" storeWithEntity="False"><string>All</string></field><field name="MobileProductSetsIds" type="System.Collections.Generic.List`1[[System.String, mscorlib]], mscorlib" storeWithEntity="False">
<ArrayOfString /></field><field name="EstimatedShippingCosts" type="Sana.Commerce.Shop.CostInfoCollection, Sana.Commerce"><ArrayOfCostInfo /></field><field name="CustomerServicePage" type="Sana.Commerce.Web.Links.LinkData, Sana.Commerce" storeWithEntity="False"><LinkData><Type>FlexiPage</Type><InternalUrlData>' + @customerServicePageId + '</InternalUrlData></LinkData></field><field name="ClosedShop" type="System.Boolean, mscorlib" storeWithEntity="False"><boolean>false</boolean></field><field name="OrderConfirmationEmailBehavior" type="System.String, mscorlib" storeWithEntity="False"><string>AlwaysSend</string>
</field><field name="EnableCustomersOrderMail" type="System.Boolean, mscorlib" storeWithEntity="False"><boolean>false</boolean></field><field name="SendMailToReportAddresses" type="System.Boolean, mscorlib" storeWithEntity="False"><boolean>false</boolean></field><field name="ReportAddresses" type="Null" storeWithEntity="False" /></FieldsDictionary>', @newWebsiteId, N'General', GETDATE(), GETDATE())

-- create PageLayout settings
INSERT [dbo].[Settings] ([Fields], [WebsiteId], [Key], [CreatedDate], [ModifiedDate]) VALUES (N'<FieldsDictionary><field name="B2CCustomer_ProductListPage" type="System.String, mscorlib" storeWithEntity="False"><string>List</string></field><field name="B2CCustomer_ProductDetailsPage" type="System.String, mscorlib" storeWithEntity="False"><string>DetailsB2C</string></field><field name="B2CCustomer_SearchResultPage" type="System.String, mscorlib" storeWithEntity="False"><string>Search</string></field><field name="B2CCustomer_BasketPage" type="System.String, mscorlib" storeWithEntity="False">
<string>Consumer</string></field><field name="B2BCustomer_ProductListPage" type="System.String, mscorlib" storeWithEntity="False"><string>ListB2B</string></field><field name="B2BCustomer_ProductDetailsPage" type="System.String, mscorlib" storeWithEntity="False"><string>DetailsB2B</string></field><field name="B2BCustomer_SearchResultPage" type="System.String, mscorlib" storeWithEntity="False"><string>SearchB2B</string></field><field name="B2BCustomer_BasketPage" type="System.String, mscorlib" storeWithEntity="False"><string>Business</string></field>
<field name="SalesAgent_ProductListPage" type="System.String, mscorlib" storeWithEntity="False"><string>ListB2B</string></field><field name="SalesAgent_ProductDetailsPage" type="System.String, mscorlib" storeWithEntity="False"><string>DetailsB2BWithMatrix</string></field><field name="SalesAgent_SearchResultPage" type="System.String, mscorlib" storeWithEntity="False"><string>Search</string></field><field name="SalesAgent_BasketPage" type="System.String, mscorlib" storeWithEntity="False"><string>Business</string></field>
<field name="B2CCustomer_SearchResultsPage" type="System.String, mscorlib" storeWithEntity="False"><string>Search</string></field><field name="B2BCustomer_SearchResultsPage" type="System.String, mscorlib" storeWithEntity="False"><string>SearchB2B</string></field><field name="SalesAgent_SearchResultsPage" type="System.String, mscorlib" storeWithEntity="False"><string>SearchB2B</string></field></FieldsDictionary>', @newWebsiteId, N'PageLayout', GETDATE(), GETDATE())

UPDATE [Settings] SET Fields.modify('replace value of (//field[@name="ShopName"]/string/text())[1] with sql:variable("@newWebsiteName")')
WHERE [Key] = 'General' AND [WebsiteId] = @newWebsiteId;

commit


_varient drop down manualy select Holzpitcher Project

  on Customization user able to click view  _variantDropdown @model  ProductViewModel @ using  Sana . Commerce . Catalog; @ using  Sana . C...