logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
jeffr_ca  
#1 Posted : Wednesday, May 6, 2020 12:00:20 AM(UTC)
jeffr_ca

Rank: Advanced Member

Groups: Authorized User, Developers, Registered, HelpDesk
Joined: 1/7/2019(UTC)
Posts: 112

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Hello,

Wondering if we could easily create a separate widget for each of the Product Description and the Product More Details fields?

This would provide much versatility in multi-column or creative re-arrangements of the two product description fields on a product page. For example, we could place the Product Description widget beside the Product Image and then use the More Details widget lower down the page with some detailed product specifications, user instructions or embedded videos.

Being independent fields of data, there is no reason for them to be tied together on the page layouts.

Perhaps the existing widget could simply have toggles added to control visibility of each data field...we can already adjust each "DescriptionCaption" & "MoreDetailCaption" in the widget.

We could use the same widget in different locations on the product page, but turn on/off each field of data as desired.

Thanks!

-Jeff

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

shari  
#2 Posted : Wednesday, May 6, 2020 7:06:49 AM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 704

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
Hi Jeff,

You can create new separate widgets by implementing an AC plugin but if you have access to source code and want to update the existing widget you can add a widget setting to choose the display options.

To add a new widget setting in the existing code, you can do so by following these steps:

1- Open Website\Models\ProductModels.cs file and search

Code:
 public class ProductDescriptionParams : WidgetParams
    {
        public ProductDescriptionParams()
        {
            CssClass = "product-description";
            DescriptionCaption = "Description";
            MoreDetailCaption = "More Details";
        }

        [DisplayName("Css Class")]
        [DefaultValue("product-description")]
        [Description("Css Class for widget")]
        public override string CssClass { get; set; }

        [Browsable(true), DefaultValue("Description")]
        [Description("Caption for description")]
        public string DescriptionCaption { get; set; }

        [Browsable(true), DefaultValue("More Details")]
        [Description("Caption for detailed description")]
        public string MoreDetailCaption { get; set; }

        [Browsable(false), DefaultValue(false)]
        [Description("If true custom fields will be shown")]
        public bool ShowCustomFields { get; set; }
    }


and replace it with


Code:
public class ProductDescriptionParams : WidgetParams
    {
        public ProductDescriptionParams()
        {
            CssClass = "product-description";
            DescriptionCaption = "Description";
            MoreDetailCaption = "More Details";
            DisplayOptions = ProductDescriptionDisplayOptions.DisplayAll;
        }

        [DisplayName("Css Class")]
        [DefaultValue("product-description")]
        [Description("Css Class for widget")]
        public override string CssClass { get; set; }

        [Browsable(true), DefaultValue("Description")]
        [Description("Caption for description")]
        public string DescriptionCaption { get; set; }

        [Browsable(true), DefaultValue("More Details")]
        [Description("Caption for detailed description")]
        public string MoreDetailCaption { get; set; }

        [Browsable(false), DefaultValue(false)]
        [Description("If true custom fields will be shown")]
        public bool ShowCustomFields { get; set; }

        [DisplayName("Display Options")]
        [DefaultValue(ProductDescriptionDisplayOptions.DisplayAll)]
        [Description("Indicates the option to display product description.")]
        public ProductDescriptionDisplayOptions DisplayOptions { get; set; }
    }
    
    public enum ProductDescriptionDisplayOptions
    {
        DisplayAll,
        DisplayOnlyDescription,
        DisplayOnlyExtendedDescription
    }




2- Open Website\Views\Product\_ProductDescription.cshtml file and search

Code:
@if ((ViewBag.DisplayExtendedDescOnly == false))


and replace it with

Code:
@if ((ViewBag.DisplayExtendedDescOnly == false) && (ViewBag.parameters.DisplayOptions == ProductDescriptionDisplayOptions.DisplayAll || ViewBag.parameters.DisplayOptions == ProductDescriptionDisplayOptions.DisplayOnlyDescription))


3- Again in the same file search for

Code:
@if ((ViewBag.ShowPanelView == true && Model.HasMore) || (ViewBag.DisplayExtendedDescOnly == true))


and replace it with

Code:
@if (((ViewBag.ShowPanelView == true && Model.HasMore) || (ViewBag.DisplayExtendedDescOnly == true)) && (ViewBag.parameters.DisplayOptions == ProductDescriptionDisplayOptions.DisplayAll || ViewBag.parameters.DisplayOptions == ProductDescriptionDisplayOptions.DisplayOnlyExtendedDescription))


4- Build the project and now you can see a new widget setting "Display Options"

jeffr_ca  
#3 Posted : Wednesday, May 6, 2020 8:16:05 AM(UTC)
jeffr_ca

Rank: Advanced Member

Groups: Authorized User, Developers, Registered, HelpDesk
Joined: 1/7/2019(UTC)
Posts: 112

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Fantastic...thanks Shari, we'll give that a try.

Can we do the same with the Product Tabs Widget? It already has visibility options for additional tabs, but would be great if we could switch OFF the main Product Description, leaving the other auxilliary tabs visible.

Then we could use the Product Description Widget on one part of the page (without Extended Description) and then use the Product Tabs (without main Description) somewhere else on the page.

Total versatility!

Thanks!

-Jeff
Users browsing this topic
Guest (6)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.