I have set up a Magento website where simple products are shown in the category listings and the configurable products for these items are in a hidden category. I need to add some functionality so when a customer clicks on 1 of these simple products it redirects them to the associated configurable product.
I tried making an extension as found in this link but it didn't work: How to redirect simple products to configurable product URL with options preselected in Magento 2.1
Then I tried the suggestion on this link: Redirect from simple product to parent product
This worked but it caused a bug where the images and choices wouldn't load on the configurable product page until the customer refreshed.
Does anyone know how to do this properly? Optimally I want the customer to be rerouted directly to the configurable product with no errors or bugs. Maybe this can be done by changing the links in the category product list?
Website Specs:
- Magento 2.2.5
- PHP 7.0.30
- MYSQL 10.0.34-MariaDB