Showing posts with label Wordpress. Show all posts
Showing posts with label Wordpress. Show all posts

Tuesday, 23 June 2015

How to increase the size of the shopping cart icon in WooCommerce

I found the default size of the WooCommerce shopping cart icon (in the Storefront theme) was a bit on the small size.

The icon is textual and comes from Font Awesome. Normally, this would be an easy change by adding fa-2x or something similar to the style declaration. Inspecting the CSS in Chrome didn’t offer me such an option (I’m new to Font Awesome) so I added this CSS to the custom CSS in my Storefront child theme:

/* Increase size of shopping cart icon */
    .site-header-cart .cart-contents:after
    {
        font-size: 1.25em !important;
    }
The 1.25em increased the size of the cart icon to better reflect the size of the menu text and stand out better.

Woocommerce Shopping Cart Icon

Tuesday, 9 June 2015

WooCommerce tax not displaying ($0)

Had an annoying little problem with taxes not showing in WooCommerce recently. Despite my best efforts to configure the Tax pages correctly, all I was getting was $0 for taxes. I had specified an address in the checkout but the tax amount would consistently come back as $0. This was on two separate, new installs of Wordpress v4.2.4 + WooCommerce v2.3.10 and I had no other tax plugins installed.

Thankfully, a response to my post to the Wordpress support forums got me back on track. It was suggested I may be missing the wp_woocommerce_tax_rate_locations table in the database, and sure enough, upon inspection I had no such table.

I created the table using the following SQL from another post describing an identical problem:

CREATE TABLE wp_woocommerce_tax_rate_locations (
location_id bigint(20) NOT NULL,
location_code varchar(255) NOT NULL,
tax_rate_id bigint(20) NOT NULL,
location_type varchar(40) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Next, I clicked Save on the WooCommerce/Settings/Tax/Tax Options screen before taxes would show.

Thanks lorro! Read the full thread here: https://wordpress.org/support/topic/tax-displays-as-0

Sunday, 7 June 2015

How to set a product as a featured product in WooCommerce

If you want to mark a product as “featured” in WooCommerce (so it will display in the Featured Products widget, for example), you’ll soon find it’s nearly impossible to figure out how to do so.

There are two ways to set a product as a featured product in your WordPress admin screen:

  1. From the products list
  2. From the edit product page

Products List

Most forum posts, etc will suggest you can toggle a product as featured or not featured in the Products list by clicking the empty or filled star icon for each product. This is easy enough—especially for setting multiple products quickly—but requires you to drop out of the product edit page.

Featured Product Star

Edit Product Page

If you’re setting up a new product you may want to set it as a featured product from within the edit product page. To do so, expand (edit)  the Catalog visibility: section in the Publish widget. The last option is a checkbox to flag the product as a featured product.

Expand Catalog VisibilityFeaured Product Checkbox

You may also want to read the Adding and managing products documentation from WooThemes for more information.

Wednesday, 3 June 2015

Can’t access Wordpress wp-admin after changing the site URL

I’m in the process of pointing a domain root to a Wordpress install that resides in a /wordpress folder below the root. I’m following these instructions—or rather trying to!

I first modified the Site address (URL) from https://store.mydomain.com to https://store/mydomain.com/wordpress, moved (instead of copying) the /wordpress/.htaccess and index.php files to the root, cleaned up those files how they should have been in the first place (!), and then promptly lost access to wp-admin.

I backed up the site content before starting all of this but, naturally, elected not to back up the Wordpress database. Which was a bit silly.

Fortunately, I was able to roll back to the start—without access to wp-admin, by modifying the value of the siteurl row in the wp_options table (in the MySQL database via phpMyAdmin).

This article also has some great options to get you up and running again without modifying the database: http://codex.wordpress.org/Changing_The_Site_URL

Saturday, 30 May 2015

Wordpress SSL causes 404 for images

After installing first a self-signed SSL certificate (replaced with a free Comodo SSL certificate in order to troubleshoot this problem) I installed Wordpress and started building a WooCommerce-based store. Because I'd installed Wordpress on the https:// site, the Settings > General screen automatically configured the site address as https://

All was going well apart from a niggling problem with images not displaying on the site itself (anonymously) or logged into the WP dashboard. Inspecting the image HTML in Chrome allowed me to extract the full problem URL and I found I could load the image successfully in its own window. Chrome also allowed flagged the 404 response for images when loaded through the Wordpress page. Weird.

Apart from images I uploaded to the Media library, other images being served locally from my Wordpress installation (e.g. theme thumbnails) were also failing to load.

I found that by changing the site address (again in WP > Settings > General) to http:// (not https://) the images would display so I came to believe the problem was somehow related to SSL. Interestingly, after changing this setting, the images appeared when I browsed to either the http:// or https:// site. Images on the http:// site using absolute image references to the https:// site also worked.

After a bit of head scratching and a bit of searching around (this problem doesn't seem to be particularly common), I came across this page which suggests hotlink protection can cause problems for the SSL protocol. Apparently "HTTPS is configured correctly when resources that are available via HTTP are also available via HTTPS." As far I could tell, my images were available through both HTTP and HTTPS but I had enabled hotlink protection on the site before installing Wordpress.

Sure enough, disabling hotlink protection solved the problem.