jigoshop/jigoshop — pull request #1009 by dubaaron (2014-12-04 07:33:45+00:00)
Title: Update jigoshop_template_functions.php

In function jigoshop_template_loop_add_to_cart() ...

The way it's written, the action 'jigoshop_after_add_to_cart_button' is not firing if the product doesn't have a price set; this is a problem for me (and could be for others) if we bind anything to 'jigoshop_before_add_to_cart_button' ... for example, I'm opening a div in the 'before' action and closing it in the 'after' action, and if there's no price on the product, the opening div is output but not the closing one, which breaks my layout.

So instead of just "return"-ing after checking if there's a price set, I put it in an if/else that just does nothing if it evaluates to true, so that it will continue and fire the 'after' action (as well as the 'apply_filters' ... but I wasn't 100% sure on that part)