Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › a popup is not workin in search results
This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko 7 years, 4 months ago.
- AuthorPosts
- December 1, 2016 at 12:14 am #11064
Hello there,
we have the Added to Cart Popup:
https://yithemes.com/themes/plugins/yith-woocommerce-added-to-cart-popup/
and your Ajax Search Pro installed in the production website
http://www.drele.com
but the development is on:
drele.philanthropy.gr
which we unlocked so you can have a look.By default, the search results do not have a buy now button -or a read more button.
We have added this code in the plugin (vertical.php), in order to show buttons, buy now or read more:<?php
$stock_status = get_post_meta( $r->id, ‘_stock’, true);
$p_sku = get_post_meta( $r->id, ‘_sku’, true);if ($stock_status > 0) {
?><div class=”cg-product-cta”>
id; ?>” data-quantity=”1″ data-product_id=”<?php echo $r->id; ?>” data-product_sku=”<?php echo $p_sku; ?>”>ΑΠΟΚΤΗΣΕ ΤΟ ΤΩΡΑ</div><?php }else { ?>
<div class=”cg-product-cta”>
link; ?>” class=”button cart-button product_type_simple”>ΔΙΑΒΑΣΤΕ ΠΕΡΙΣΣΟΤΕΡΑ
</div>
<?php }?>
The buttons have the same functionality like in the pages, but the Added to Cart Popup doesn’t show up within the search results. The popup works fine an all pages this code appears, except the search results!
Is this possible? Why doesn’t it work?
Do we need couple of lines of code to be added in the above code, in order to make work?I would greatly appreciate it if you can help us.
Kind regards
- This topic was modified 7 years, 4 months ago by Dimos Tzemanakis.
- This topic was modified 7 years, 4 months ago by Dimos Tzemanakis.
December 1, 2016 at 9:10 am #11071Hi!
It’s simply because the ajax handler for the add-to-cart buttons is not loaded for those buttons. You will have to load it manually with a custom script.
While customization is not part of the support, I may have found a solution for that for you. Put this code to the functions.php file in your active theme directory (from line 3 only):
https://gist.github.com/anag0/43ad32ec4a60ce50a27cbbcc312d9927
This will try to re-load the add to cart script to the ajax search elements as well.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 1, 2016 at 10:08 am #11072Thank you very much for your help. Indeed, this work! Have a nice day.
December 1, 2016 at 10:10 am #11073You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
The topic ‘a popup is not workin in search results’ is closed to new replies.