Tagged: x
-
AuthorPosts
-
February 16, 2017 at 3:52 am #1373303
194rocParticipant
WP 4.7.2
renew child xtheme 4.6.4Hello there,
how could I add a “back to shop” link when a product has been added to the cart ?
Here following a screenshot where, I believe the link should be inserted.Thank you very much for your help.
Best regards,
Roberto
February 16, 2017 at 3:53 am #1373306
194rocParticipantThis reply has been marked as private.February 16, 2017 at 9:08 am #1373599
LelyModeratorHello Roberto,
Thank you for your credentials. Please add the following code on your child theme functions.php file:
add_filter( 'wc_add_to_cart_message', 'custom_add_to_cart_message' ); function custom_add_to_cart_message($products, $show_qty = false) { global $woocommerce; // Output success messages if (get_option('woocommerce_cart_redirect_after_add')=='yes') : $return_to = get_permalink(woocommerce_get_page_id('shop')); $message = sprintf('<a href="%s" class="button">%s</a> %s', $return_to, __('Continue Shopping →', 'woocommerce'), __('Product successfully added to your cart.', 'woocommerce') ); else : $message = sprintf('<a href="%s" class="button">%s</a> %s', get_permalink(woocommerce_get_page_id('cart')), __('View Cart', 'woocommerce'), __('Product successfully added to your cart.', 'woocommerce') ); $message .= '<a href="'.$return_to.'" class="button">Torna al negozio</a>'; endif; return $message; }Feel free to adjust the messages.
Further customizations from here would be getting into custom development, which is outside the scope of support we can offer. If you need more in depth changes, you may wish to consult with a developer. X is quite extensible with child themes, so there are plenty of possibilities. Thanks for understanding.February 17, 2017 at 2:49 am #1374717
194rocParticipantIt works just great.
Excellent support, thank you very much.
Best regards,
Roberto
February 17, 2017 at 6:06 am #1374846
Paul RModeratorYou’re welcome! 🙂
March 7, 2017 at 1:16 pm #1398146
194rocParticipantHello there,
sorry to bother you again, but it could be possible that after adding the given code I lost some translation ?
In the following images I am pointing to the text that I believe was in Italian before and was some thing like:
“Articolo aggiunto al carrello.”Thanks for the help,
Roberto
March 7, 2017 at 11:52 pm #1398659
RupokMemberHi Roberto,
You can write the text in your language within the code.
Cheers!
March 8, 2017 at 1:42 am #1398747
194rocParticipantSorry about the last.
I didn’t realize that the that text was inside the given code.
Forgive me,
Best regards,
Roberto
March 8, 2017 at 6:12 am #1398952
ThaiModeratorIf you need anything else please let us know.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1373303 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
