• Hi

    I have another feature request.

    Maybe its only important for my site, but it would be great to have an option in the backend where i can choose wether the user can select multiple categories on the catalogue pages (the default) or only one category at a time (thats what i need).

    Or can you tell me the lines of code i should change? This would work as a first workaround.

    Best,
    Thomas

    https://www.ads-software.com/plugins/ultimate-product-catalogue/

Viewing 15 replies - 1 through 15 (of 17 total)
  • Hi Thomy,

    Thank you for the feature request. This would require the filtering to behave as radio buttons instead of checkboxes. We will look into the possibility of adding something like this in a future update.

    Thread Starter Thomymaster

    (@thomymaster)

    Hi

    Do you know a timeframe of the implementation of this feature?

    Best,
    Thomy

    Thread Starter Thomymaster

    (@thomymaster)

    Hi

    You suggested that i should use tags instead of categories.

    One problem that i’m facing is that with tags i am unable to setup a category/subcategory view, as tags cannot be indented in the catalogue (thumbnail view).

    Additionally, there is no option in the backend that restricts that only on tag at a time can be selected.

    Hi Thomy,

    The front-end filtering for the tags functions in the same manner as that for the categories and sub-categories, so I’m not sure why or where we would’ve suggested that as a way for you to do what you mentioned above. We may have suggested tags as a way of assigning multiple tags (“categories”) to one product, but that’s different than what you described at the beginning of this thread.

    That would be nice if i can choose in backend that people can filter multiple categories or only one. If they click on new category then it shows only that.

    Thread Starter Thomymaster

    (@thomymaster)

    Hi

    I want to use categories and not tags, however im still having the problem that users can select multiple categories.
    It would be really nice if you can add a switch in the backend where you can set the filtering in the frontend to “one category” or “multiple categories”.

    Hi Thomy,

    Line 112 of the file ultimate-product-catalogue/html/CatalogueDetails.php, is what you would have to change to have the desired change. You may change the checkbox to radio buttons by changing by changing your current 112 with the following code:

    echo "<li><label class='menu-item-title'><input type='radio' class='menu-item-checkbox' name='categories[]' value='" . $Category->Category_ID ."' /> " . $Category->Category_Name . "</label></li>";

    This ultimately changes the input type from the checkbox to the radio button. Please note that upon updates, you would have to go back into that file and change the proper line again.

    Best,

    Thread Starter Thomymaster

    (@thomymaster)

    Hi

    I tried but it doesn’t work, i now have the following line:

    echo "<li><label class='menu-item-title'><input type='radio' class='menu-item-checkbox' name='categories[]' value='" . $Category->Category_ID ."' /> " . $Category->Category_Name . "</label></li>";

    Best,
    Thomas

    Hi Thomas,

    In that case, you can undo those previous changes and then try changing the input type from checkbox to radio on lines 1378, 1400, 1430, 1454 and 1477 of the Shortcodes.php file in the Functions folder.

    Thread Starter Thomymaster

    (@thomymaster)

    Hi,

    I just tried, now theere are radio buttons but the categories can still be multiply-selected.
    There must be another way…

    Best,
    Thomas

    Hi Thomas,

    There is indeed most likely a better way to implement such a functionality. The methods we’ve proposed are workarounds, suggestions as to how you might be able to achieve your desired effect, given that this isn’t currently possible with our plugin. With some small tweaks, you could probably get it all the way there. Hopefully, at some point, we’ll be able to implement a full working solution for this feature suggestion. However, until then, the suggestions we’ve provided should offer a good jumping off point for someone who really needs this and would want to expand on it.

    Thread Starter Thomymaster

    (@thomymaster)

    Hmm i cannot believe that you don’t know how to solve this issue. I mean you developed this plugin and… you know ??

    I’d donate some money if you can fix this issue. I’m not the only customer who is demanding this feature.

    Hi Thomy,

    Thank you for the offer, but this isn’t an issue. Nothing’s broken and there’s nothing to “fix”. What you’re asking for is a new feature. And, unfortunately, as we’ve mentioned before, we have limited resources and need to manage resolving actual issues and making time for developing new features accordingly, which means that we aren’t able to implement this functionality at this time. Nevertheless, we’ve spent a considerable amount of time offering suggestions for how you might be able to rework your setup to get your desired outcome. With that in mind, until we’re able to fully implement this functionality, the information we’ve already provided here is more than enough for someone to be able to work on and develop this functionality further.

    I encountered similar problem. And using the knowledge from Etoile i changed the shortcodes file in mentioned lines as :

    Every line mentioned commented and added new one as :

    $CategoriesString .= "<a href=\"?categories=" . $Category->Category_ID . "\">";

    Additionally commenting the line
    //if (in_array($Category->Category_ID, $category)) {$CategoriesString .= "checked=checked";}
    and deleting the “>” sign in the next line.

    For example my line 1380 looks like that:

    //$CategoriesString .= "<input type='checkbox' name='Category" . $Category->Category_ID . "' value='" . $Category->Category_ID . "' onclick='UPCP_DisplayPage(\"1\"); UPCPHighlight(this, \"" . $Color . "\");' id='cat-". $Category->Category_ID ."' class='jquery-prod-cat-value'";
    				$CategoriesString .= "<a href=\"?categories=" . $Category->Category_ID . "\">";
    				//if (in_array($Category->Category_ID, $category)) {$CategoriesString .= "checked=checked";}
    				$CategoriesString .= "<label class='upcp-label' for='cat-". $Category->Category_ID ."'> <span>" . $Category->Category_Name . " (" . $ProdCats[$Category->Category_ID] . ")</span>" ;
    Thread Starter Thomymaster

    (@thomymaster)

    I don’t understand, can you please just post the lines you changed (the new content) ??

    Best,
    Thomas

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘feature request: categories selection only one or multiple categories’ is closed to new replies.