Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Adjust markup on Products loop
- remove_action( 'jigoshop_after_shop_loop_item', 'jigoshop_template_loop_add_to_cart', 10, 2);
- function jigoshop_template_loop_add_to_cart_new( $post, $_product ) {
- // do not show "add to cart" button if product's price isn't announced
- if( $_product->get_price() === '' AND ! ($_product->is_type('variable') OR $_product->is_type('grouped')) ) return;
- // TODO: this could use refactoring / cleaning up
- if( $_product->is_type('variable') OR $_product->is_type('grouped') ) {
- echo '<a href="'. get_permalink($_product->id).'" class="button">'.__('Shop now', 'jigoshop').'</a>';
- return;
- }
- ?><a href="<?php echo $_product->add_to_cart_url(); ?>" class="button"><?php _e('Add to cart', 'jigoshop'); ?></a><?php
- }
- add_action( 'jigoshop_after_shop_loop_item', 'jigoshop_template_loop_add_to_cart_new', 10, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement