![Check out Enfold](https://kriesi.at/wp-content/themes/kriesi/images/banner-enfold.jpg)
Tagged: ajax, javascript
-
AuthorPosts
-
April 24, 2020 at 9:30 am #1206749
Hi support,
I’m using ajax search for woocommerce on our website which gives the user different search results. One of them, the product result, shows the product in a preview layer next to the results list. Below the product image users can choose a quantity and put the product into their cart right out of this dialog.I assume there is a JavaScript function that converts standard quantity input to quantity in Enfold style with “plus” and “minus”, is that correct? How can we add those plus/minus buttons on the quantity field when we call woocommerce_quantity_input() in AJAX because Enfold doesn’t add it automatically?
Here’s the website, the search field ist directy below the top slider. Please try POLAR as search term and hover the results below the “PRODUKTE”. The single product view with quantity input opens on the right side:
Thank you very much in advance!
-
This topic was modified 4 years, 4 months ago by
lopinus.
May 1, 2020 at 12:23 pm #1208820Hey,
Sorry for the late reply!
Please try using avia_apply_quant_btn(); function which is located in enfold/config-woocommerce/woocommerce-mod.js
Best regards,
YigitxMay 7, 2020 at 5:11 pm #1210767Hi Yigit,
thank you very much for your help, this worked!
This script is not included in our production website yet, but there is another issue that appears independently from this:When you click on “add to cart” in single product view of the search results, a message appears right below the mini cart in the right top corner, like “product xy was added to your cart”. This product string is currently empty (” “) – is there a way to fix it?
Please type in search field “POLAR” as an example, then choose a single product and add it to cart.
May 7, 2020 at 7:55 pm #1210802Hi,
Could you please post a screenshot of the issue? I followed your instructions and it correctly displays “product xyz was added to your cart” message above single product page however there should not be such notification under mini cart by default.
Best regards,
YigitMay 7, 2020 at 8:11 pm #1210804Hi,
sorry for my bad English!The issue appears on home page when you use the search plugin right below the slider.
Typing i. e. “POLAR” into the search field will display the results in different categories. One of them is “PRODUKTE”. If you hover the results, single products will be displayed on the right side of search results layer. If you click “add to cart” no product name ist shown.Here’s a screenshot (hope it works)
May 7, 2020 at 9:48 pm #1210815Hi,
Thanks for the screenshot, I can now see the issue. But when I add a product from homepage, product name shows up fine. Could you please try using “update_cart_dropdown” function located in the same enfold/config-woocommerce/woocommerce-mod.js file as well?
Best regards,
YigitMay 8, 2020 at 3:00 pm #1211056Hi,
that doesn’t solve this issue. After adding a product to the cart form the search panel, the cart dropdown is updated. There is no need to call update_cart_dropdown(); again. Only the title and image are empty on the quick notice under the cart dropdown.Maybe you have any other suggestions?
Frank
May 8, 2020 at 4:14 pm #1211073Hi,
Following line in woocommerce-mod.js file displays the product name
template = jQuery("<div class='added_to_cart_notification'><span class='avia-arrow'></span><div class='added-product-text'><strong>\"" + product.name +"\"</strong> "+ msg_success+ "</div> " + product.image +"</div>").css( 'opacity', 0 );
But it does not get product name when adding to cart from search panel.
JS is not my strongest suit so I will ask my teammates to check.
Best regards,
YigitMay 19, 2020 at 10:39 am #1214274Hi Yigit,
thank you for this info – did you find the time to ask your team mates yet?
Frank
May 20, 2020 at 1:44 pm #1214657Hi Frank,
Yes, I have asked them the same day however our forums are a bit busy lately so apparently no one could come up with an easy solution.
If this is important for you, please consider to hire a freelance developer. The line I pointed out in my previous reply should help :)Best regards,
Yigit -
This topic was modified 4 years, 4 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.