Close

Profile: embryo

Avatar

User posts

11 years ago

Doh...nevermind....I figured it out..

I was editing the MegaMenu.cshtml in the MegaMenu/Views root...instead of the one in the MegaMenu/Themes/Alfresco/Views/ folder...

11 years ago

I've had no trouble adding additional links to the megamenu in the past, but it seems a little different with version 3.10.

I have a topic page with a systemname of "Learn", and I added this following code to my megamenu.cshtml expecting a new menu item to appear saying "Learn."


    @{
        MvcHtmlString learnTopicBlock = Html.Action("TopicBlock", "MegaMenu", new { systemName = "Learn" });
     }
<li>@learnTopicBlock</li>


It does not.

As a test, I nested my code inside the megamenutopic if/then section, and enabled the megamenutopic in the megamenu settings. It still did not appear.

I even tried just changing it to be a direct link to the topic page instead of dropping down, and it still didn't appear:
<li><a href="@Url.RouteUrl("Topic", new { SystemName = "Learn" })">@T("Learn")</a></li>


It's as if the systemname is incorrect, but it is not.

As another test, I just added the following:
right below this line:

<ul class="mega-menu">

I added this list item

<li><a href="http://www.mysite.com">Test</a></li>

It doesn't even appear....

Clues?

12 years ago

embryo wrote:

I'm using Nopcommerce version 2.65, with version 2.65 of the 7spikes Electronics theme.
I found a post on the nopcommerce forum which showed me how to edit the ProductTemplate.VariantsInGrid.cshtml and the _ProductVariantAddToCart.cshtml
views to display the variants in a drop down box, and I relocated it within the layout to appear just below the short description... and that works great...however... still no joy....very frustrating...
http://64.239.149.249/p/342/3pp-toe-loops


UPDATE:
I've got the drop down appearing on products that do have more than one variant, but I'm trying to code the page so that products with only one variant are displayed with just the quantity label/input and add item button..and any tier pricing if set up for that product.

Examples here:

This is a product with more than one variant - drop down appears "Available Options" ...when an option is chosen, the add item button and quantity input appear, just like i want...

this is a product with only one variant -  grid appears with tier pricing, but WHERE is the quantity input and Add Item button??

My code:
ProductTemplate.VariantsInGrid
changed:

<div class="product-variant-list">         @foreach (var variant in Model.ProductVariantModels)            {               dataDictVariant.TemplateInfo.HtmlFieldPrefix = string.Format("variant_{0}", variant.Id);               @Html.Partial("_ProductVariantLine", variant, dataDictVariant)            }   </div>

to:

@if  (Model.ProductVariantModels.Count > 1)
{
         /*display drop down with variants*/

<div class="product-variant-list">
   @Html.DropDownList("ddlProductVariants",        new SelectList((from variant in Model.ProductVariantModels                       select new { IdValue = variant.Id, TextValue

= variant.Name + " - " + variant.ProductVariantPrice.Price }),"IdValue", "TextValue"),        "Available Options",        new { @onchange = "$('div.add-to-cart').hide();var

e=document.getElementById('ddlProductVariants');var idValue = e.options[e.selectedIndex].value;$('div[id=addtocart_'+idValue+']').show();" })   @foreach (var variant in

Model.ProductVariantModels)       {           var dataDictAddToCart = new ViewDataDictionary();           dataDictAddToCart.TemplateInfo.HtmlFieldPrefix =

string.Format("addtocart_{0}", variant.Id);           @Html.Partial("_ProductVariantAddToCart", variant.AddToCart, dataDictAddToCart)       }   </div>

}
    else
                /* just display quantity input and add item button*/
{
        
           <div class="product-variant-list">
                @foreach (var variant in Model.ProductVariantModels)
                {
                    var dataDictVariant = new ViewDataDictionary();
                    dataDictVariant.TemplateInfo.HtmlFieldPrefix = string.Format("variant_{0}", variant.Id);
                    @Html.Partial("_ProductVariantLine", variant, dataDictVariant)
                }
            </div>
}

...and I moved it up the page so that it would appear to the right of the product photo and underneath the short description...
_ProductVariantAddToCart.cshtml
changed:
<div class="add-to-cart">

to:
<div class="add-to-cart" id="@string.Format("addtocart_{0}", Model.ProductVariantId)" style="display: none">

12 years ago

IvanStoyanov wrote:
Hello-

I've looked through the megamenu plugin folder and don't see any javascripts controlling the drop down behavior, so I am assuming that it is all done within the dll.

What I'd like to do is cause a delay in the menu drop down so that it requires the cursor be over the menu for at least one second before expanding. If I cannot accomplish that, would it be possible to change to use an onclick type event rather than the onmouseover it does by default?

Thanks,
Steve

Hi Steve,

The MegaMenu is pure css and C#. There is no javascritp. If you want to delay the menu dropdown you can do it by using css e.g:
Add the following code to the droprown class in the css file for the MegaMenu
-moz-transition: display 1s linear;
-webkit-transition: display 1s linear;


Another option is to use javascript. You can write some and include it in the MegaMenu.cshtml view.

Have a great day.

Ivan Stoyanov


Hello Ivan-

Using the css transition property isn't working...I thought maybe it was JUST not working in IE, but it doesn't seem to work in Chrome or Firefox either,so I think your code above was not the correct syntax.

I've now tried this, though it is not supported in IE9 or under:

  transition-delay: 2s;   /* IE 10 */
  -moz-transition-delay: 2s; /* Firefox 4 */
  -webkit-transition-delay: 2s; /* Safari and Chrome */
  -o-transition-delay: 2s; /* Opera */

...and it still doesn't work in either browser.....and I'm not sure how to use Javascript as you mentioned...

Ideas?

12 years ago

IvanStoyanov wrote:
Hello-

I've looked through the megamenu plugin folder and don't see any javascripts controlling the drop down behavior, so I am assuming that it is all done within the dll.

What I'd like to do is cause a delay in the menu drop down so that it requires the cursor be over the menu for at least one second before expanding. If I cannot accomplish that, would it be possible to change to use an onclick type event rather than the onmouseover it does by default?

Thanks,
Steve

Hi Steve,

The MegaMenu is pure css and C#. There is no javascritp. If you want to delay the menu dropdown you can do it by using css e.g:
Add the following code to the droprown class in the css file for the MegaMenu
-moz-transition: display 1s linear;
-webkit-transition: display 1s linear;


Another option is to use javascript. You can write some and include it in the MegaMenu.cshtml view.

Have a great day.

Ivan Stoyanov


Hello Ivan-

Using the css transition property isn't working...I thought maybe it was JUST not working in IE, but it doesn't seem to work in Chrome or Firefox either,so I think your code above was not the correct syntax.

I've now tried this, though it is not supported in IE9 or under:

  transition-delay: 2s;   /* IE 10 */
  -moz-transition-delay: 2s; /* Firefox 4 */
  -webkit-transition-delay: 2s; /* Safari and Chrome */
  -o-transition-delay: 2s; /* Opera */

...and it still doesn't work in either browser.....and I'm not sure how to use Javascript as you mentioned...

Ideas?

12 years ago

Hello-

I've looked through the megamenu plugin folder and don't see any javascripts controlling the drop down behavior, so I am assuming that it is all done within the dll.

What I'd like to do is cause a delay in the menu drop down so that it requires the cursor be over the menu for at least one second before expanding. If I cannot accomplish that, would it be possible to change to use an onclick type event rather than the onmouseover it does by default?

Thanks,
Steve

12 years ago

embryo wrote:
I have created a version of this similar to your needs...I can post the solution here if you like.  What version of nopCommerce are you using?

Hello-

I'm using Nopcommerce version 2.65, with version 2.65 of the 7spikes Electronics theme.

I found a post on the nopcommerce forum which showed me how to edit the ProductTemplate.VariantsInGrid.cshtml and the _ProductVariantAddToCart.cshtml
views to display the variants in a drop down box, and I relocated it within the layout to appear just below the short description... and that works great...however...

On the Electronics theme, all the classes for ".add-to-cart" seem to have been changed to ".add-info", and as a result, my Add item and Wish list buttons do not appear at all! I think I've changed all the references in those views to refer to the .add-info div class, but still no joy....very frustrating...
http://64.239.149.249/p/342/3pp-toe-loops


Yes, I'd be interested in any code that works with the electronics theme!

Thanks,
Steve


Hey 7spikes guys.....
Just out of curiosity...why did you guys change that class name to "add-info" from "add-to-cart" ???

This is very confusing to noobs like me.

12 years ago

mwoffenden wrote:
I have created a version of this similar to your needs...I can post the solution here if you like.  What version of nopCommerce are you using?


OK....stop teasing me....can you please post your solution?!?

Steve

12 years ago

mwoffenden wrote:
I have created a version of this similar to your needs...I can post the solution here if you like.  What version of nopCommerce are you using?


Hello-

I'm using Nopcommerce version 2.65, with version 2.65 of the 7spikes Electronics theme.

I found a post on the nopcommerce forum which showed me how to edit the ProductTemplate.VariantsInGrid.cshtml and the _ProductVariantAddToCart.cshtml
views to display the variants in a drop down box, and I relocated it within the layout to appear just below the short description... and that works great...however...

On the Electronics theme, all the classes for ".add-to-cart" seem to have been changed to ".add-info", and as a result, my Add item and Wish list buttons do not appear at all! I think I've changed all the references in those views to refer to the .add-info div class, but still no joy....very frustrating...
http://64.239.149.249/p/342/3pp-toe-loops


Yes, I'd be interested in any code that works with the electronics theme!

Thanks,
Steve

12 years ago

Hello-

I am wondering if anyone else has needed to modify the way that products with multiple variants are displayed on the catalog product pages.

When I have a product that is available in 4 different colors, and each of those colors is available in 12 different sizes, and I set the product to use the VariantsinGrid template...the length of the page is REDICULOUS due to the amount of space that each variant takes up.

Ideally, I'd like to use the SingleVariant template because I like where the add item button is located on the page...but I'd also like to display two drop down boxes..one for color and one for size...with all of the possible options in those drop downs.

Does something like this already exist?...Is it even possible to achieve?... If so....where/how??

Thanks!
Steve