Skip to content

Commit 02927a8

Browse files
authored
Add a continue shopping button on cart page in WooCommerce Add
1 parent f56e872 commit 02927a8

1 file changed

+27
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- This is a code snippets export file generated by the Code Snippets WordPress plugin. -->
3+
<!-- https://wordpress.org/plugins/code-snippets -->
4+
<!-- To import these snippets a WordPress site follow these steps: -->
5+
<!-- 1. Log in to that site as an administrator. -->
6+
<!-- 2. Install the Code Snippets plugin using the directions provided at the above link. -->
7+
<!-- 3. Go to 'Tools: Import' in the WordPress admin panel. -->
8+
<!-- 4. Click on the "Code Snippets" importer in the list -->
9+
<!-- 5. Upload this file using the form provided on that page. -->
10+
<!-- 6. Code Snippets will then import all of the snippets and associated information contained in this file into your site. -->
11+
<!-- 7. You will then have to visit the 'Snippets: All Snippets' admin menu and activate desired snippets. -->
12+
<!-- generator="Code Snippets/2.9.4" created="2017-10-10 20:35" -->
13+
<snippets>
14+
<snippet scope="2">
15+
<name>Add a continue shopping button on cart page in WooCommerce</name>
16+
<desc></desc>
17+
<tags>continue, shopping, cart, woocommerce</tags>
18+
<code>add_action( 'woocommerce_before_cart_table', 'wc_add_continue_shopping_button_to_cart' );&#13;
19+
function wc_add_continue_shopping_button_to_cart() {&#13;
20+
$shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) );&#13;
21+
&#13;
22+
echo '&lt;div class="woocommerce-message"&gt;';&#13;
23+
echo ' &lt;a href="'.$shop_page_url.'" class="button"&gt;Continue Shopping →&lt;/a&gt; Would you like some more goods?';&#13;
24+
echo '&lt;/div&gt;';&#13;
25+
}</code>
26+
</snippet>
27+
</snippets>

0 commit comments

Comments
 (0)