Archive for the ‘WooCommerce’ category

SB Add WooCommerce Tabs – WordPress Plugin

March 30th, 2013

You have been asking for this so I wrote it for you. This plugin is a very simply way of adding a WYSIWYG controlled tab to your WooCommerce products. It does the legwork for you and all you need to do it edit 1 line in the plugin file to set the tab name and to determine how many tabs you want. I have even provided examples for you in the code.

I might eventually add a little admin system to this but for now you get the following:

$sb_awt_tabs = array(
    'New Tab 1'=>50
    , 'New Tab 2'=>60
    // , 'New Tab 3'=>50
    // , 'New Tab 4'=>50
);

You wil note two tabs are uncommented and two are commented. Simply change the part at the start for the name and the second part is the priority. Very simply put the higher the number the further right in your tab list it will be. If you need more than 4 tabs then simply duplicate a line as normal.

Once you activate the plugin you will notice a new Tiny MCE editor at the bottom of each edit products page. Simply fill it in if you want the tab to show or leave it blank to hide the tab. Nice and easy!

I should add that if you include any shortcodes in the tab editor then they will be read also.. ie a YouTube video or something.

Download

SB Add WooCommerce Tabs (1.26 kB)

Note

This plugin only works with WooCommerce Version 2 or newer. I have already written another post last year to show you how to add new tabs to older versions.

How to remove the WooCommerce 2.0+ Reviews tab

March 7th, 2013

woothemes-ninja3On the 6th of March (I think) the lovely guys at WooThemes graced us with a lovely new version of their fantastic WooCommerce plugin. They changed a lot of things, most of which I have yet to absorb. A couple of notable things though caught my eye. You may or may not be aware that I have written a few tutorials concerning the WooCommerce tab system. Adding new ones and, of course, removing the reviews tab. Since 2.0 the product tab API has been updated and is now somewhat slightly more elegant. » Read more: How to remove the WooCommerce 2.0+ Reviews tab

WooCommerce VoguePay, CashEnvoy and Eyowo plugins now written

February 10th, 2013

gatewaysSome background perhaps.. Nigeria, as a nation, has a huge amount of stigma around it after various different online scams and a general feel of corruption about it. In fact I am sorry to say that the people of Nigeria have it incredibly hard on the internet and to make money is especially difficult because the big reputable payment processors like PayPal are not available to them. This is rather frustrating because over the last few weeks I have met and worked with (even outsourced work to) various Nigerian people and I have not got a bad thing to say about any of them. It’s sad, in my opinion, that the lack of PayPal hinders international business the way it does.

Anyway, soap box aside, I have to say that, despite this hinderance, I have taken on and completed 5 or 6 different projects and am happy to tell you about three of them right now.

Ever since I wrote the WooCommerce Interswitch WebPay plugin a couple of months ago I have had a stream of communications with various Nigerian business people who are interested in having a variety of different gateways integrated for them. I am pleased to announce that I have now completed work on the following three plugins

  • WooCommerce VoguePay plugin
  • WooCommerce CashEnvoy plugin
  • WooCommerce Eyowo plugin

That’s the good news. The bad news is that they were written on commission and the source is not mine to distribute unlike with the Interswitch WebPay module. However, in the name of vanity, I am very pleased with my work on all of these plugins and am hoping that my name being attached to them will give the work a certain level of credibility. I will release the URLs where more information can be gathered about these modules when I receive work back from my clients.

If anyone has an interest in these or any other payment gateway integrations for WordPress or any platform then please do get in touch with me and I will gladly work with/for you to find the integration that is right for you.

SB WooCommerce Facebook Comments Plugin

February 5th, 2013

woocommerce_logoThis was requested by a commenter on a previous post on a similar subject. I have written in the past extensively about removing the WooCommerce reviews tab. It was suggested that Facebook comments might be an interesting addition and so I have written a very small plugin to add one.

The plugin simply removes the existing WooCommerce Reviews Tab and creates a new one called Reviews showing the Facebook comments system instead. Because the plugin is basic I have provided a few simple options in the code itself. You can configure the title of the tab, the width of the comment area and the number of comments to show.

Simply edit the PHP variables as follows:

$sb_fc_tab_title = 'Reviews';
$sb_fc_width = '600'; 
$sb_fc_comments = '50';

This is a tab called ‘Reviews’,  a width of 600 pixels and to show 50 comments. Edit to suit.

UPDATE: Updated my code for WooCommerce 2.0+.  Use the following link:

SB WooCommerce Facebook Comments for WooCommerce 2.0+ (693 bytes)

For PRE-WooCommerce 2.0 installations:

SB WooCommerce Facebook Comments (696 bytes)

Any comments or feedback by all means let me know

Adding your own WooCommerce Tabs simplified step by step

November 5th, 2012

woocommerce_logoMy original tutorial on WooCommerce product tab addition has gone down very well. However it has been brought to my attention that people who don’t know much PHP are struggling to follow it. This is ok.. we all need to start somewhere but for convenience I have put it all into a plugin and commented each line with instructions accordingly. The content of that plugin is directly pasted below with a download link at the bottom for you. It will work out of the box with no modification. You just need to add a custom field to your products which have additional information. If anyone is interested I shall write another tutorial on how to add a nice WYSIWYG editor to the product admin pages for that more integrated feel.

» Read more: Adding your own WooCommerce Tabs simplified step by step

Adding your own currency to WooCommerce

October 31st, 2012

woocommerce_logoI have been asked on a few occasions by people how to add a new currency to WooCommerce. It’s actually incredibly simple to do thanks to the excellent WooCommerce API. Simply add the following code to your theme functions.php file or to a plugin of your own for this to work. I used this same code in my recent Interswitch Payment Gateway integration for WooCommerce to add Nigerian Naira.

» Read more: Adding your own currency to WooCommerce

Adding your own tabs to Woocommerce and Woothemes

September 12th, 2012

Click for larger image

A short while ago I wrote about how to remove the reviews tab from Woocommerce themes like Wootique (See image to the right). As a reply I was asked how we can add our own tabs and panels with custom or fixed content inside so I thought I would write this quick follow up to explain all.

There are two actions we need to hook into to get our tabs to work.. firstly the tab top and secondly the tab content (or panel as they are known). The following code is a complete example for you to add a new tab and panel pair with hard coded content:

add_action( 'woocommerce_product_tabs', 'sb_woocommerce_new_tab', 40 );
add_action( 'woocommerce_product_tab_panels', 'sb_woocommerce_new_panel', 40 );
function sb_woocommerce_new_tab() {
 echo '<li><a href="#tab-new">' . __('New Tab', 'woocommerce') . '</a></li>';
}
function sb_woocommerce_new_panel() {
 echo '<div class="panel" id="tab-new">
 <h2>New Panel</h2>
 <p>Example content...</p>
 </div>';
}

If you put the above into your theme functions.php file you should see a new tab appear called test. When duplicating this be sure to make sure the anchor tag (<a>) has the correct link to the ID of the panel which should be unique. Woo use the format tab-[name] so best to stick to that really.

The question I had was to be able to put a contact form in there. The simplest method I have found for adding contact forms to WordPress is Contact Form 7. It’s a nicely written and presented plugin with few or no adverts and begging links to annoy their users. It has also been extended by others so has plenty of companion plugins to make it even better. For today though we just want to grab the shortcode from the Contact Form 7 admin page and put it a handy PHP function do_shortcode(‘[your_shortcode]‘); as follows.

function sb_woocommerce_new_panel() {
 echo '<div class="panel" id="tab-new">
 <h2>New Panel</h2>';

 echo do_shortcode('[your-shortcode]');

 echo '</div>';
}

In recent projects I have been clever and populated tabs from WordPress custom fields which can be done easily although without massive configuration possibility using the More Types plugin. This allows you to build little forms and attach them to custom post type item edit pages in custom meta boxes. Ideal for making a bespoke yet quick interface.
Assuming that made sense to you.. the following custom field code will come in handy for your panel. It pulls the tab content from the custom field called tab_content. In the event there is nothing in the custom field it won’t show the panel. Remember if you want to hide the panel when there is no content in the custom field then don’t forget to include the same code around the label output.

function sb_woocommerce_new_panel() {
 global $post;
if ($new = get_post_meta($post->ID, 'new_tab_content', true)) {
 echo '<div class="panel" id="tab-new">
 <h2>New Panel</h2>
 ' . $new . '
 </div>';
 }
}

Good luck and if there is ever anything you want me to write about then do let me know using my contact page.

Further Reading, my original post on the matter

WooCommerce removing the reviews tab

May 15th, 2012

UPDATE: If you are using WooCommerce 2.0+ then you need to read this blog post I wrote instead which explains the ‘new’ system for you.

Another quickie from me today. I have been using WooCommerce a lot recently but there are just some options that could do with making into options or filters I think. As I understand it’s a JigoShop rebadge with a bit of Woo goodness in there for luck and it seems to be paying off. I never want to use WP Ecommerce again at this rate.

Each WooCommerce installation will have the reviews tabs added to individual product pages. As I understand it it uses the WordPress comment system to hold review information (so says one forum, i’ve not bothered to check it out). I noted that people are wanting to know how to turn this functionality off as reviews don’t really apply to all products in all shops. Adding this code to your theme functions.php file will remove the reviews tab. If you want it back then just remove the lines.. simples.

remove_action( 'woocommerce_product_tabs', 'woocommerce_product_reviews_tab', 30);
remove_action( 'woocommerce_product_tab_panels', 'woocommerce_product_reviews_panel', 30);

Edit:

People have asked how to remove the product attributes tab and the additional description tab also. You can do so using the following code:
remove_action( 'woocommerce_product_tabs', 'woocommerce_product_description_tab', 10);
remove_action( 'woocommerce_product_tab_panels', 'woocommerce_product_description_panel', 10);
remove_action( 'woocommerce_product_tabs', 'woocommerce_product_attributes_tab', 20);
remove_action( 'woocommerce_product_tab_panels', 'woocommerce_product_attributes_panel', 20);

Also see my new tutorial in how to add a new tab to the WooCommerce product pages