Boyko,
Thanks!
Adam
Boyko,
Thank you for responding so quickly.
What I am trying to achieve is this.
When a product has more than one image, I want to be able to choose which image appears on the site in the different places these images are displayed.
So, for example, the first image would appear in the carousel (I can't change the carousel, so the first, default image will appear there) but in a product panel on the home page (I'm using your Alfresco theme btw) I want another image.
So, to achieve this, I think the simplest way is to use the display order which can be applied to product images. This gives administrators the ability to choose which image appears in each location (although the display number probably needs to be hard coded in the places where this feature is used).
This can be done by passing the display order number to the controller from the view that will display the images
So, for example, on the home page, we have the line:
@Html.Action("HomepageProducts", "Catalog")
This is the default, and will display the first image.
I want to use this instead:
@Html.Action("HomepageProducts", "Catalog", new { productPictureNumber = 2 })
The controller action then looks like this:
protected IEnumerable<ProductOverviewModel> PrepareProductOverviewModels(IEnumerable<Product> products,
bool preparePriceModel = true, bool preparePictureModel = true,
int? productThumbPictureSize = null, bool prepareSpecificationAttributes = false,
bool forceRedirectionAfterAddingToCart = false, int productPictureNumber = 0)
{ ... }
This number is passed to the PictureService.GetPicturesByProductId method which will use it to select the correct image (\WebProject\Libraries\Nop.Services\Media\PictureService.cs line 688)
This should be a simple change to make and would solve my problem.
This additional value would not affect the carousel - it would still get its images.
I don't want to have to create an entirely new action in the catalog controller, and then go through the app and call it whenever I want to use this feature - that's extra work, and would entail maintaining two copies of the action in the controller. One of the major features of modern code like MVC is code reuse, and having to duplicate a method to add an additional OPTIONAL parameter breaks this concept.
So, How do I work around this restriction?
Also, out of curiosity, how do you even do this, force a method to keep the same signature? All the other places that call this controller action are quite happy with it - they do not break at run time, so this 'feature' must have been explicitly encoded. How is this done?
I've got a bit of a deadline to work to here, so I'd really appreciate a quick solution to this.
Thanks & Regards
Adam
Hi,
I've just been looking for where I change these values, and it doesn't seem possible.
SevenSpikes.Themes.Alfresco.Common.CompanyInfo
SevenSpikes.Themes.Alfresco.Common.CustomerServices
SevenSpikes.Themes.Alfresco.Common.FAQ
SevenSpikes.Themes.Alfresco.Common.Help
SevenSpikes.Themes.Alfresco.Common.OurOffers
SevenSpikes.Themes.Alfresco.Common.Search
SevenSpikes.Themes.Alfresco.Common.MenuTitle
SevenSpikes.Themes.Alfresco.Common.Phone
SevenSpikes.Themes.Alfresco.Common.EmailName
SevenSpikes.Themes.Alfresco.Common.EmailDomain
They are not included on the theme's Widget Config page, which is where I'd expect them to be.
Regards
Adam
Having just installed jCarousel, I tested it on different size screens as I'm using the responsive Alfresco theme.
It works fine in full size, max-width 980 and 768 but breaks a bit in the smallest size, max-width 480
What happens is the the two left and right arrows, instead of overlaying the right-hand image, move above the carousel.
I had put the carousel in the 'home_page_top' zone.
At this small size, the left/right arrows are half overlayed over the main Menu. This looks very odd.
The solution is simple though - copy the CSS rules from the next largest size into the max-width 480px section. Here are the changes I made:
@media screen and (max-width: 480px) {
.nop-jcarousel .carousel-title {
margin: 0 5px 60px;
}
.nop-jcarousel .jcarousel-prev-horizontal, .nop-jcarousel .jcarousel-next-horizontal {
/*bottom: 244px;
top: inherit;*/
padding: 6px;
}
.nop-jcarousel .jcarousel-prev-horizontal {
right: 61px; /* New rule */
/*left: 43%;
margin-left: -20px;*/
}
.nop-jcarousel .jcarousel-next-horizontal {
/*right: 43%;
margin-right: -20px;*/
}
.nop-jcarousel .item-info {
display: none !important;
}
}
Hi,
I've just added jCarousel to my site (which is still under development so it's not publicly visible)
I used the 'Home Page Featured Products' as the data source type, and it's fully populated with products, and it scrolls correctly most of the time. So far so good.
When I mouse over a product, a grey panel slides up with the name of the product, the price and a 'Details' button
If I click the 'Details' button, I'm taken off to the correct product page
However, if I click anywhere else in the grey panel, it takes me off to a page called /undefined, with the resultant 404 message
How can I make the URL of the grey panel point to the same place as the 'Details' button.
I'm using nopCommerce 3.10 with the Alfresco theme and the plugins that came with that theme.
Thanks