WooCommerce reviews + tutorials

How to Create a Simple WooCommerce Payment Gateway

…y the “Success” result since the order was placed, and redirect the return URL for that order (so we display the correct information). public function process_payment( $order_id ) { $order = wc_get_order( $order_id ); // Mark as on-hold (we’re awaiting the payment) $order->update_status( ‘on-hold’, __( ‘Awaiting offline payment’, ‘wc-gateway-offline’ ) ); // Reduce stock levels $order->reduce_order_stock(); // Remove cart WC()->cart->empty_cart();…

Read More

SkyVerge WooCommerce Extensions

Add Member Area Links to the Sidebar with WooCommerce Memberships

…inks ); Each link is formatted like this: $link[ $id ] = array( ‘href’ => $url, ‘text’ => $text, ); So we’ll get the memberships for the user, and if there are some, we’ll output a link to the member area for each membership, showing the membership plan name in the link. The wc_memberships_get_members_area_url() function will be helpful here to get our link to the member area for a plan. /** * Add links to the member area for each active membershi…

Read More

Guide to Migrating Your Plugin to WooCommerce 2.0

…ON, “2.0.0” ) >= 0 ) { $style = ‘padding:5px 5px 5px 28px;background-image:url(‘ . $tab_icon . ‘);background-repeat:no-repeat;background-position:5px 7px;’; $active_style = ”; } else { $style = ‘padding:9px 9px 9px 34px;line-height:16px;border-bottom:1px solid #d5d5d5;text-shadow:0 1px 1px #fff;color:#555555;background-image:url(‘ . $tab_icon . ‘);background-repeat:no-repeat;background-position:9px 9px;’; $active_style = ‘#woocommerce-product-dat…

Read More

month in review

September in Review

…s from the account, an enhanced checkout form, and some other refinements. URL Coupons is getting better compatibility with CSV Import to make importing URL-type coupons easier, and will also have some improved error messages for when deferred coupons can be applied or not. Social Login has a large update in progress to move to a new authentication library (HybridAuth) that’s more actively maintained. As always, keep an eye out for announcement po…

Read More

SkyVerge WooCommerce Extensions

WooCommerce Memberships: Add “View Subscription” Action to My Memberships

…hip( $user_membership->get_id() ); $actions[‘view-subscription’] = array( ‘url‘ => $subscription->get_view_order_url(), ‘name’ => __( ‘View Billing’, ‘my-textdomain’ ), ); $actions[‘view’][‘name’] = __( ‘View Perks’, ‘my-textdomain’ ); } return $actions; } add_filter( ‘wc_memberships_members_area_my-memberships_actions’, ‘sv_wc_memberships_add_view_subscription_action’, 10, 2 ); You can adjust the text in this snippet for your action buttons as de…

Read More

Guide for Upgrading to WooCommerce 2.1

…ly and you can delete them. Instead, these pages will always have the same URL. For example, the “Lost Password” page will now always be located at www.mystore.com/my-account/lost-password/ unless you change the endpoint under the “Accounts” menu (other endpoints are under “Checkout”) or the name / URL of the “My Account” page. This improves stability and prevents the accidental deletion of important pages. You can also allow customers to register…

Read More

WordPress development tutorials

How to Create a Custom WordPress Post Type With Image Uploads

…mp_image”>’ + html + ‘</div>’); var img = $(‘#temp_image’).find(‘img’); imgurl = img.attr(‘src’); imgclass = img.attr(‘class’); imgid = parseInt(imgclass.replace(/D/g, ”), 10); $(‘#upload_image_id’).val(imgid); $(‘#remove-book-image’).show(); $(‘img#book_image’).attr(‘src’, imgurl); try{tb_remove();}catch(e){}; $(‘#temp_image’).remove(); window.send_to_editor = window.send_to_editor_default; } This function creates a temporary img tag with the se…

Read More

GitHub Repository Not Found Workaround

…that the repository in question is a private, rather than public repository. A member from the GitHub support staff responded to me with the following: That repo is private, ‘git://’ URLs don’t work with private repos. Try the ‘https://’ clone URL instead. So, there you have it, I guess it was actually a feature after all….

Read More

WooCommerce reviews + tutorials

Hooking into WooCommerce Actions

…ing.com/sale?amount=%s&ordernum=%s” height=”1″ width=”1″ border=”0″>’, esc_url( $order_total ), esc_url( $order_number ) ); } add_action( ‘woocommerce_thankyou’, ‘sv_tracking_script’ ); This will now be added on every “thank you” page that’s displayed in my shop, and will include the relevant order information. More Examples Our tutorial on adding information to product shop listings uses an action to add info about the products when viewed on sho…

Read More