Tagged: x
-
AuthorPosts
-
December 4, 2016 at 7:55 am #1280451
SWH_LayoutParticipantI would like to share the code but it will not submit correctly. I’ll try again.
add_action(‘woocommerce_after_add_to_cart_button’,’cmk_additional_button’);
function cmk_additional_button() {$shop_page_url = get_permalink( woocommerce_get_page_id( ‘shop’ ) );
echo ‘Change me please‘;
}/Staffan
December 4, 2016 at 7:57 am #1280452
SWH_LayoutParticipantHow do I submit the code so the echo string is not deleted?
/Staffan
December 4, 2016 at 10:30 am #1280561
SWH_LayoutParticipantHi again,
Another question if it’s ok?
I would like to add this button to the cart page, efter the apply coupon button and on the check out page efter the place order button in the bottom. How do I adjust the code so it finds these buttons?Thanks
/StaffanHeres the code hope it submits correctly this time.
add_action(‘woocommerce_after_add_to_cart_button’,’cmk_additional_button’);
function cmk_additional_button() {$shop_page_url = get_permalink( woocommerce_get_page_id( ‘shop’ ) );
echo ‘Return to shop‘;December 4, 2016 at 10:45 am #1280569
SWH_LayoutParticipantDecember 4, 2016 at 3:09 pm #1280715
RadModeratorHi there,
Please remove that, that adds another set of link within link.
Thanks!
December 4, 2016 at 11:39 pm #1281172
SWH_LayoutParticipantHi,
I’m sorry I don’t quite understand what I’m supposed to remove.
If you mean what I added in the code, it did’nt link to the shop until I added that.
If there is some place in the updated code that, Christopher provided, where the shop URL should be added please advise because it only linked back to the same page.Thanks
/StaffanDecember 5, 2016 at 2:03 am #1281250
Rue NelModeratorHello There,
I made several modifications to the codes like this:
add_filter( 'woocommerce_continue_shopping_redirect', 'change_return_shop_url', 50 ); add_filter( 'woocommerce_return_to_shop_redirect', 'change_return_shop_url', 50 ); function change_return_shop_url(){ return '#'; } add_action('woocommerce_after_add_to_cart_button','cmk_additional_button', 50); function cmk_additional_button() { $shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) ); echo '<a href="'.$shop_page_url.'" class="button alt this is it">Fortsätt handla</a>'; }Regretfully none of the changes did not reflect in your site. It could be that there are other settings or a conflict.
You could try testing for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.December 5, 2016 at 12:29 pm #1281920
SWH_LayoutParticipantThis reply has been marked as private.December 5, 2016 at 11:58 pm #1282623
Paul RModeratorHi,
You just need to change the hook(woocommerce_after_add_to_cart_button).
You can add this in your child theme’s functions.php
add_action( 'woocommerce_after_cart_table', 'woo_add_button_to_cart' ); function woo_add_button_to_cart() { $shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) ); echo '<a href="'.$shop_page_url.'" class="button alt this is it">Fortsätt handla</a>'; } add_action( 'woocommerce_after_checkout_form', 'woo_add_button_to_checkout' ); function woo_add_button_to_checkout() { $shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) ); echo '<a href="'.$shop_page_url.'" class="button alt this is it">Fortsätt handla</a>'; }You may refer ot the link below for your guide.
https://docs.woocommerce.com/wc-apidocs/hook-docs.html
Hope that helps.
December 6, 2016 at 1:24 pm #1283535
SWH_LayoutParticipantHi,
Gosh, we’re there. Just what I wanted. Many thanks. 🙂Just one, I promise, last question.
If I want the two last buttons to show up after the other buttons and not below, what do I add to the code?Thanks again for your patience and help!
/Staffan
December 6, 2016 at 11:06 pm #1284071
LelyModeratorHello Staffan,
Are you still referring to that cart page? Please do give us a screenshot on how the you want to button to display so we can give you exact recommendation.
December 6, 2016 at 11:31 pm #1284084
SWH_LayoutParticipantHi,
The cart and the checkout page now looks like Checkout 1.
I would like them to look Checkout 2.Thanks
/StaffanDecember 7, 2016 at 2:03 am #1284206
ChristopherModeratorHi there,
What you’re trying to achieve could be possible with custom development but it would be outside the scope of our support.
We could help you to add some margin to this button.Please add following code in Customize -> Custom -> Global CSS :
a.button.alt.this.is.it { margin-top: 10px; }Hope it helps.
December 7, 2016 at 8:56 am #1284654
SWH_LayoutParticipantHi,
I understand. Thanks for all your help. I has been much appreciated. You guys are doing a great job!/Staffan
December 7, 2016 at 2:31 pm #1285063
RadModeratorYou’re so much welcome!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1264310 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
