
-
AuthorPosts
-
January 31, 2023 at 8:53 am #1395990
Hi there,
I am using the avia_product_slider product grid layout for my search results page as per:
https://kriesi.at/support/topic/search-results-page-grid-layout/ and https://kriesi.at/support/topic/incorrect-counting-in-search-results/I get the following error:
Fatal error: Uncaught Error: Call to a member function get_style_tag() on null in /home2/patiowarehouse3z/public_html/wp-content/themes/enfold/config-templatebuilder/avia-shortcode-helpers/class-avia-product-slider.php:269 Stack trace: #0 /home2/patiowarehouse3z/public_html/wp-content/themes/enfold-child/search.php(72): avia_product_slider->html() #1 /home2/patiowarehouse3z/public_html/wp-includes/template-loader.php(106): include(‘/home2/patiowar…’) #2 /home2/patiowarehouse3z/public_html/wp-blog-header.php(19): require_once(‘/home2/patiowar…’) #3 /home2/patiowarehouse3z/public_html/index.php(17): require(‘/home2/patiowar…’) #4 {main} thrown in /home2/patiowarehouse3z/public_html/wp-content/themes/enfold/config-templatebuilder/avia-shortcode-helpers/class-avia-product-slider.php on line 269.
I am using the latest version of enfold 5.4.
Please advise how I can resolve the error.
February 2, 2023 at 4:43 am #1396327Hey!
Thank you for the inquiry.
In the modified search.php file, please look for this line.
$blog = new avia_product_slider($atts);
Below, add this code.
$blog->get_element_styles(["element_id" => $blog['element_id'], "element_styling" => $blog['element_styling']]);
Let us know if the modification helps.
Best regards,
IsmaelFebruary 2, 2023 at 7:09 am #1396335Hi,
I added the code, but now there is a new error:
Fatal error: Uncaught Error: Cannot use object of type avia_product_slider as array in /home2/patiowarehouse3z/public_html/wp-content/themes/enfold-child/search.php:73 Stack trace: #0 /home2/patiowarehouse3z/public_html/wp-includes/template-loader.php(106): include() #1 /home2/patiowarehouse3z/public_html/wp-blog-header.php(19): require_once(‘/home2/patiowar…’) #2 /home2/patiowarehouse3z/public_html/index.php(17): require(‘/home2/patiowar…’) #3 {main} thrown in /home2/patiowarehouse3z/public_html/wp-content/themes/enfold-child/search.php on line 73
February 3, 2023 at 3:54 am #1396472Hi!
This is working correctly on our end. Please try to replace the line with the following code.
$blog->get_element_styles(["element_id" => $blog->element_id, "element_styling" => $blog->element_styling]);
Please make sure to copy the code directly from the forum.
Cheers!
IsmaelFebruary 3, 2023 at 8:05 am #1396501Hi,
I copied the above code from the forum and it is still not working on my end. The below is the latest error:
Fatal error: Uncaught Error: Cannot access protected property avia_product_slider::$element_id in /home2/patiowarehouse3z/public_html/wp-content/themes/enfold-child/search.php:73 Stack trace: #0 /home2/patiowarehouse3z/public_html/wp-includes/template-loader.php(106): include() #1 /home2/patiowarehouse3z/public_html/wp-blog-header.php(19): require_once(‘/home2/patiowar…’) #2 /home2/patiowarehouse3z/public_html/index.php(17): require(‘/home2/patiowar…’) #3 {main} thrown in /home2/patiowarehouse3z/public_html/wp-content/themes/enfold-child/search.php on line 73
Please advise if there is maybe something else I need to do?
February 7, 2023 at 9:15 am #1396948Hi,
Do you have any update on the above issue?
I have tried the code on 2 other sites and the issue is still the same: Fatal error: Uncaught Error: Cannot access protected property avia_product_slider::$element_id
Kindly assist.
February 10, 2023 at 8:38 am #1397400Hi,
Sorry for the delay. We managed to fix the issue with the search template but for some reason none of the products are displaying. The same modification works correctly on our end as shown in the screenshot below.
Screenshot: https://1drv.ms/u/s!AjjTfXSRbKTvz2RkDmcEIw-atJYX?e=hXoklz
Please try to deactivate the plugins temporarily and see if any of the extension is causing the issue.
Best regards,
IsmaelFebruary 13, 2023 at 7:50 am #1397708Thanks Ismael,
The issue seems to be coming from the following plugin: Relevanssi Premium. However, I understand Relevanssi is compatible with Enfold.
When I remove or comment the following line, I get the results for products and everything works as needed:
$blog->query_entries();
Is this something you are able to check out on your side? Or should I send a support ticket to Relevanssi support about this?-
This reply was modified 3 months, 3 weeks ago by
Rustum.
February 13, 2023 at 7:58 am #1397710Hi there,
I have also noticed that the pagination doesn’t work anymore. It always returns to Page 1.: https://www.patiowarehouse.co.za/?s=amalfi&avia-element-paging=2I am not sure if it is somehow related to one of my older posts on the same topic, but I know this was fixed on a later version of enfold: https://kriesi.at/support/topic/pagination-not-working-on-avia_product_slider-in-search-php/#post-1319492
Please check and advise how this can be solved?
February 20, 2023 at 4:38 am #1398575Hi,
The issue seems to be coming from the following plugin: Relevanssi Premium.
You may need to contact the plugin developers for more info about this issue. For the meantime, you may need to revert back to the default search template without the modification.
Best regards,
IsmaelFebruary 24, 2023 at 8:41 am #1399098Hi Ismael,
I finally resolved the issue via some support from Relevanssi. You may want to add it to your documentation as well. *On the below filter, the following line just needed to be added: $query[‘relevanssi’] = true;
add_filter(‘avia_product_slide_query’, ‘avia_product_slide_query_mod’, 10, 2);
function avia_product_slide_query_mod($query, $params) {
if(is_search()) {
$query[‘s’] = $_GET[‘s’];
$query[‘relevanssi’] = true;
}return $query;
}The query and pagination on the custom avia product slider/search grid now works as needed.
Thanks.
February 24, 2023 at 12:09 pm #1399140Hi,
Thank you for sharing the solution.
I added it to our compatibility class Avia_Relevanssi for next release 5.5
In case you want to check it please replace enfold\config-relevanssi\class-avia-relevanssi.php with
Best regards,
Günter -
This reply was modified 3 months, 3 weeks ago by
-
AuthorPosts
- You must be logged in to reply to this topic.