HELP - How create a simple box on the left side bar

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 13 años
Hello,

On the left side bar appear different boxes (category ...)
I like to create another very simple.

I wanted to create a box that only contains an image, which opens when you click an external page (For example: www.google.com)

How?

Best Regards
Hace 13 años
luidgi wrote:
Hello,

On the left side bar appear different boxes (category ...)
I like to create another very simple.

I wanted to create a box that only contains an image, which opens when you click an external page (For example: www.google.com)

How?

Best Regards


I can help you with this, but could you please clarify the questions as it's very confusing.

1) You are using darkOrange theme ? or nopClassic Theme ?
I am asking about theme because boxes are only in darkOrange theme not nopClassic theme...

2) So you want to create a box just like Category or Manufacturers etc, right ?

3) In this new box you want to display an image right ? and when anyone will click on this image you want to user to navigate to a different location like ..www.google.com ,,right ?

4) What heading name you want to give to this new box ? Like category box has got heading name as "Categories , tags box has got heading name as "Popular tags ", just like these boxes what name you wanna give to this new box ?
Hace 13 años
Hello,

first of all thank you for your interest in helping.
I am Portuguese, and although some programming knowledge, I understand very little C #.

1) I'm using theme darkOrange
2) Right.
3) Right
4) The name Partners
    But its name may be implicit in the code, there is no need to be stored in the database.

To understand what I want, simply view (http://www.japastuff.com/).
In the bar right there is a box labeled "Receive Updates".

As you can see, only contains a single image by clicking opens new site.

It's what I want.
Hace 13 años
luidgi wrote:
Hello,

first of all thank you for your interest in helping.
I am Portuguese, and although some programming knowledge, I understand very little C #.

1) I'm using theme darkOrange
2) Right.
3) Right
4) The name Partners
    But its name may be implicit in the code, there is no need to be stored in the database.

To understand what I want, simply view (http://www.japastuff.com/).
In the bar right there is a box labeled "Receive Updates".

As you can see, only contains a single image by clicking opens new site.

It's what I want.


That's ok if you understand little c#, i will try my best to explain you everything step by step...( if you don't understand any step, let me know ok)

1)Open your nopCommerce solution in Visual Studio.

2) Run Your project > now can you see your public store ? > If yes, then go to admin section

3) In your admin section, go to >    Content Management   >   Localization  

4) Choose your language from drop down menu (english)

5) Now a list of many items will come, you will see a button on the right side : "Add New" > Click on this button

6) Fill those 2 textboxes with these values:

Resource name:   MyTopic.Partners  
Resource value:   Partners  

7) Save it

8) Now you can close your browser and go to your Visual Studio in the nopCommerce Code

You will see a folder: "Modules"

In this folder, add a new ascx file (name it as Partners.ascx)

9) Now in Partners.aspx

paste this:

<div class="block partners">
    <div class="title">
        <%=GetLocaleResourceString("MyTopic.Partners")%>
    </div>
    <div class="clear">
    </div>

<a href="http://www.facebook(Or whatever website you want to go to).com"><img src="http://www.SourceOfYourImageHere.jpg" alt="YourImage" width="100" height="40" target = "_blank"/></a>
    

<!--   <div class="listbox">
        
    </div> -->
</div>

10) Now save this page (and before saving don't forget to modify the image hyperlink code according to your requirment - see above in bold what you need to modify)

11) Now go to Partners.ascx.cs

You will see this few using namesspaces...

delete them all and paste this:

using System;
using System.Collections;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Text;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using NopSolutions.NopCommerce.BusinessLogic;
using NopSolutions.NopCommerce.BusinessLogic.Configuration.Settings;
using NopSolutions.NopCommerce.Common.Utils;

12) You will see this also:

public partial class Partners : WHATEVER IS WRITTEN HERE- Replace it with this -> BaseNopUserControl

It should look something like this:

public partial class Partners : BaseNopUserControl


13) Save your page now

14) Now go to App_Theme Folder > darkOrange > styles

FIND THIS:

.block-category-navigation, .block-manufacturer-navigation, .block-recently-viewed-products,
.block-info, .block-shoppingcart, .block-newsletter, .block-livechat, .block-popular-tags


now add this: .partners

now it should look like this:

.block-category-navigation, .block-manufacturer-navigation, .block-recently-viewed-products,
.block-info, .block-shoppingcart, .block-newsletter, .block-livechat, .block-popular-tags, .partners

15) SAVE IT

16) Go to your default.aspx and add this:

<% @ Register TagPrefix = "nopCommerce" TagName = "Partners" Src = "~ / Modules / Partners.ascx"%>



17) Now re-build your solution and run the solution, you will see a new box of Partner on your public store
Hace 13 años
Let me know if you face any problem....
Hace 13 años
Thank you, I did.

Just needed to add target = "_blank" so as to open a new page.

<a href="https://www.nopcommerce.com" target="_blank"> <img src = "images/nopcommerce.gif" alt = "yourimage" width = "100" height = "40 "/> </ a>

Then to see the box, open the file and added ThreeColumn.master

<% @ Register TagPrefix = "nopCommerce" TagName = "Partners" Src = "~ / Modules / Partners.ascx"%>

<nopCommerce:Partners ID="ctrlPartners" runat="server" />


Result: Very Good
Hace 13 años
luidgi wrote:
Thank you, I did.

Just needed to add target = "_blank" so as to open a new page.

<a href="https://www.nopcommerce.com" target="_blank"> <img src = "images/nopcommerce.gif" alt = "yourimage" width = "100" height = "40 "/> </ a>

Then to see the box, open the file and added ThreeColumn.master

<% @ Register TagPrefix = "nopCommerce" TagName = "Partners" Src = "~ / Modules / Partners.ascx"%>

<nopCommerce:Partners ID="ctrlPartners" runat="server" />


Result: Very Good


Your welcome and sorry i forgot to mention those things in the steps

I i am very happy that everything is working fine at your side...
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.