Show Garage Dropdown only
-
Hey, there. Any way to show just the garage option (not the other select inputs)? Would like to show the “selected vehicle” constantly throughout the header.
Would also love an easy way to add a field. I know others have asked about this and seems like it would be a nice feature if we the settings had an option to add an additional field (vehicle type – standard/premium/4×4) or whatever.
Thanks for making this!
-
Hello,
> to show the “selected vehicle” constantly throughout the header
There is no a modification for it now.
But it is possible to create a custom template “garage.php” file that will contain only the “selected vehicle” code.
Then upload it to:
wp-content/plugins/ymm-search/view/frontend/templates/garage.phpAnd then call it with a shortcode like this:
[ymm_selector template=”garage.php”]
Or insert it in a PHP template file as:
<?php echo do_shortcode(‘[ymm_selector template=”garage.php”]’); ?>
The original template file that contains the “selected vehicle” code is located in:
wp-content/plugins/ymm-search/view/frontend/templates/selector.php> an easy way to add a field
Not an easy but possible way:
You can use the “Make Model Year Engine” version of this plugin:
https://hottons.com/ymm_modificationsThen rename “Engine” to “Vehicle Type” in the files:
wp-content/plugins/ymm-search/etc/config.php
wp-content/plugins/ymm-search/view/frontend/templates/product/view/tabs/restriction.phpStanislav
Ok great I’ll give that a shot. Thanks.
Just noticed something else. It appears that the selected vehicle will be saved and stay set if you’re on the shop page, but if you navigate to another page, the searched YMM are not reset. You can see this in your demo as well. Any ideas if this is a bug? I’d like to be able to keep that latest garage search data set while the user is on any page throughout the site if possible.
Seems like a caching issue. Any way to prevent those select options from being cached so when a user clicks around a site in real-time they see the current garage YMM?
Hello,
> to prevent those select options from being cached
Try to apply the modification:
“To make drop-downs not preselected”
https://hottons.com/ymm_modificationsAlso you can apply the modification:
“Automatically filter category pages”
https://hottons.com/ymm_modificationsSo that it will not only display the selected vehicle but will also filter the current category page.
Stanislav
Ok, I’ll look into that as well. Would be cool if you could make it so we could add the modifications to a /ymm/templates directory within the theme so any plugin updates wouldn’t break the customizations. Sort of like customizing Woocommerce templates by placing files in a templates folder within the theme vs. modifying directly in the plugin itself.
Hello,
Many people use this plugin modified.
So they will not be able to update it and they know it.
It is the idea of this plugin to keep the base version unchanged as long as possible.
And to provide extra features as modifications:
https://hottons.com/ymm_modificationsIf there is an update I will tell which line of code to change to make it compatible. To not update the entire plugin.
Stanislav
Understandable. Just thinking of the situation where I (the developer) pass this on to a client and they see updates in the future. Would you be able to make the mods as additional plugins? Or a way for us to make them as add-on plugins as to not impact the core plugin? I know you don’t plan to change the plugin but it of course does happen with Woo or WP updates needing compatibility updates etc.
Hello,
> to a client and they see updates in the future
You can rename the plugin. The “update” link does not appears for renamed plugins because it cannot check the source.
Or you can disable autoupdates for this plugin:
https://stackoverflow.com/questions/17897044/wordpress-how-to-disable-plugin-update/39217270#39217270> Would you be able to make the mods as additional plugins
I don’t provide such a service now.> to make them as add-on plugins as to not impact the core plugin?
This plugin does not have extendable hooks or actions.> Woo or WP updates
Then you should not use this plugin for your client.
Because it will be difficult for you to contact him and then to change the code manually for the latest WordPress version.I can create another version of this plugin with extendable hooks and actions.
The problem is that there are just few people per year that need this plugin for such serious cases. It will not be enough to support it.Stanislav
Wanted to circle back on this. I’ve integrated the mods to add the “engine” but changed to “submodel” for my purposes. Also seems that the year gets moved to the first position with your modification file which is great (I wanted to do that anyways).
The problem can be seen here: https://soapbox.wistia.com/videos/Gu5LPIQp4w
I think (but am not 100%) that the issue occurs when there are no results that match. So if the user has set their car and begun search, if they search a category or sub-category that does not have a product that matches that vehicle, then all products for that category or sub-category are displayed and the fields that do not match in the select options reset.
Happy to share files etc. if that will be more helpful.
Thank you! Loving the plugin.
Hello,
This plugin filters drop-down options on category pages.
So only the options that have products for the current category are displayed.Try to disable it by replacing the code:
$whereProducts = ''; if ($categoryId > 0){ $productIds = $this->getProductIdsOfCategory($categoryId); if (count($productIds) > 0){ $whereProducts = ' AND product_id IN ('.implode(',', $productIds).')'; } }
with:
$whereProducts = ''; /* if ($categoryId > 0){ $productIds = $this->getProductIdsOfCategory($categoryId); if (count($productIds) > 0){ $whereProducts = ' AND product_id IN ('.implode(',', $productIds).')'; } } */
in the file:
wp-content/plugins/ymm-search/Model/Db.phpStanislav
-
This reply was modified 3 years, 1 month ago by
Pektsekye.
This does seem to keep the select options selected, but the results are showing all products rather than just products that apply to the set vehicle. If there are no results for that vehicle, then the results should just show “no results” rather than all products.
Wondering if there’s also a way to update the number of products in a category / sub-category based on the set vehicle just so to give a good visual that the sort is working properly.
Hello,
> but the results are showing all products
Try to apply the “Automatically filter category pages” modification:
https://hottons.com/ymm_modificationsStanislav
Whoa, nice! I think that’s working great. I’ll play around with it a bit more but seems to be 100%. Thank you!
How can I get the current set vehicle values outside of the plugin? If I want to use them elsewhere? So, if I want to get the _year, _make, _model. I was thinking I could use $_GET[‘_year’] etc. but that won’t work unless the variables exist in the URL string.
-
This reply was modified 3 years, 1 month ago by
- The topic ‘Show Garage Dropdown only’ is closed to new replies.