This topic has 22 replies, 6 voices, and was last updated 8 years, 1 months ago ago by Eva Kemp
Hello,
since a few updates, the popup that appears when I add a product to the cart only says “was successfully added to your cart”. Before, it always added the products title before that sentence. Firebug says that there is a h5 tag <h5 class=”emodal-title”></h5> but its empty. Please find my test environment in private content. I have ALL PLUGINS DISABLED, except woocommerce (version 2.6.4)
Many thanks in advance!
Hello,
You can change it in the /royal/js/etheme.js file.
You need to replace the similar line http://prntscr.com/c0obom to the following: productName = $('.meta-title span').first().text();
Also we recommended to make all changes in the Child Theme.
Regards,
Rose Tyler.
Dear Rose, thank you.
Will this be fixed in the next update?
I have a childtheme, but switched to parent theme to be sure this bug is not caused by my childtheme.
I dont see any difference between your screenshot and the code I should replace it by.
In line 1459, I’ve got:
productName = $('.product-information .product-name, .product_title').first().text();
modalWindow.eModal('endLoading')
.eModal('setTitle',productName)
.eModal('addImage', productImageSrc)
.eModal('addText', successfullyAdded)
.eModal('addBtn',{
title: contBtn,
href: 'javascript:void(0);',
cssClass: 'btn filled',
hideOnClick: true
})
Can you please give me some more advices?
Many thanks in advance!
Hello,
Yes, you should replace your line productName = $('.product-information .product-name, .product_title').first().text();
Regards,
Rose Tyler.
Ah ok, I misunderstood your answer, now I got it, thank you!
So will this be fixed in the next update?
And second question: How can I fix this in an update safe way for my childtheme?
Hello,
You’re welcome! This issue will be fixed in the next update.
Also, you need read these articles https://codex.wordpress.org/Child_Themes
https://www.8theme.com/demo/docs/royal/#!/2_child_theme
https://teamtreehouse.com/community/wordpress-how-to-enqueue-script-to-child-theme
Regards,
Rose Tyler.
Thank you. I thought maybe there is a way to copy the theme structure to childtheme and to override without having to enqueue scripts, like with woocommerce..
Hello,
Please, read WP documentation attentively. Unfortunately, it does not work for scripts. Follow the official WP documentation if you need to add custom scripts.
Hi, has this bug been taken care of in the newest update (2.7.3)?
The mentioned file already says
productName = $(‘.meta-title span’).first().text();
but the cart popup still doesn’t show the product name.
Hello,
As I see product title is shown http://storage3.static.itmages.com/i/16/0919/h_1474308532_8317666_fcf4fb797c.png
Please show a screenshot of the issue you mean.
Thank you.
Best regards,
Jack Richardson.
I am not the one who started this thread, so I’m guessing that you are looking at the wrong webshop.
See private info for my address.
Thanks!
Hello @marlinda,
Sorry for misunderstanding.
Unfortunately it wasn’t fixed in the 2.7.3 version.
Our developers will resolve it in the next update.
Please take our apologies.
Best regards,
Jack Richardson.
It’s still not fixed in version 2.8. Why??
Hello @Royalty,
It was fixed.
Clear browser cache and check again.
Best regards,
Jack Richardson.
Its definetly not fixed, it only works because I edited etheme.js! Please delete the screenshot of my page!
Hello @Royalty,
May we reupload theme files?
Please provide FTP credentials.
Regards,
Eva Kemp.
Hello Eva,
the screenshot Jack posted (and now deleted – thank you) was taken from my official page, where I still have version 2.7.3 enabled. I uploaded the new version 2.8. to a test environment. Before I give you FTP credentials, let me tell you what I changed to make it work:
In etheme.js line 1470, there is:
if ($('.product_title').first().text()) {
productName = $('.product_title').first().text();
} else {
productName = $('h1.title').first().text();
}
and I changed the code to:
if ($('.meta-title span').first().text()) {
productName = $('.meta-title span').first().text();
} else {
productName = $('h1.title').first().text();
}
Is it possible that the problem was only fixed for simple products? I have only variable products so I can not check it but maybe you can..
Hello @Royalty,
The problem was fixed both for variable and single products.
Please provide FTP and WP admin credentials.
Regards,
Eva Kemp.
Ok, I have an idea what could cause the problem. I will check and let you know.
Ok I could solve it. It’s too complicated to explain in detail but it had something to do with YOAST seo plugin and breadcrumbs (your modification in etheme grabs the product title from a part in breadcrumbs and not just from the product-title, that makes it a bit complicated when using custom breadcrumbs). Sorry that I thought it was not fixed!
Hello,
Thank you for the information.
Have a nice day.
Regards,
Eva Kemp.
The issue related to '‘Added to cart popup doesnt show product's name anymore’' has been successfully resolved, and the topic is now closed for further responses