Remove the lone price/label/quantity class in grouped template

Closes #18542
This commit is contained in:
Mike Jolley 2018-01-22 14:27:46 +00:00
parent 62c4cbb0c8
commit b9a4a342e6
4 changed files with 13 additions and 15 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -477,7 +477,7 @@ p.demo_store,
} }
.group_table { .group_table {
td.label { td.woocommerce-grouped-product-list-item__label {
padding-right: 1em; padding-right: 1em;
padding-left: 1em; padding-left: 1em;
} }

View File

@ -11,14 +11,11 @@
* the readme will list any important changes. * the readme will list any important changes.
* *
* @see https://docs.woocommerce.com/document/template-structure/ * @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates * @package WooCommerce/Templates
* @version 3.3.0 * @version 3.3.0
*/ */
if ( ! defined( 'ABSPATH' ) ) { defined( 'ABSPATH' ) || exit;
exit;
}
global $product, $post; global $product, $post;
@ -39,8 +36,8 @@ do_action( 'woocommerce_before_add_to_cart_form' ); ?>
foreach ( $grouped_products as $grouped_product ) { foreach ( $grouped_products as $grouped_product ) {
$post_object = get_post( $grouped_product->get_id() ); $post_object = get_post( $grouped_product->get_id() );
$quantites_required = $quantites_required || ( $grouped_product->is_purchasable() && ! $grouped_product->has_options() ); $quantites_required = $quantites_required || ( $grouped_product->is_purchasable() && ! $grouped_product->has_options() );
$post = $post_object; // WPCS: override ok.
setup_postdata( $post = $post_object ); // WPCS: override ok. setup_postdata( $post );
echo '<tr id="product-' . esc_attr( get_the_ID() ) . '" class="woocommerce-grouped-product-list-item ' . esc_attr( implode( ' ', get_post_class() ) ) . '">'; echo '<tr id="product-' . esc_attr( get_the_ID() ) . '" class="woocommerce-grouped-product-list-item ' . esc_attr( implode( ' ', get_post_class() ) ) . '">';
@ -49,7 +46,7 @@ do_action( 'woocommerce_before_add_to_cart_form' ); ?>
do_action( 'woocommerce_grouped_product_list_before_' . $column_id, $grouped_product ); do_action( 'woocommerce_grouped_product_list_before_' . $column_id, $grouped_product );
switch ( $column_id ) { switch ( $column_id ) {
case 'quantity' : case 'quantity':
ob_start(); ob_start();
if ( ! $grouped_product->is_purchasable() || $grouped_product->has_options() || ! $grouped_product->is_in_stock() ) { if ( ! $grouped_product->is_purchasable() || $grouped_product->has_options() || ! $grouped_product->is_in_stock() ) {
@ -71,27 +68,28 @@ do_action( 'woocommerce_before_add_to_cart_form' ); ?>
$value = ob_get_clean(); $value = ob_get_clean();
break; break;
case 'label' : case 'label':
$value = '<label for="product-' . esc_attr( $grouped_product->get_id() ) . '">'; $value = '<label for="product-' . esc_attr( $grouped_product->get_id() ) . '">';
$value .= $grouped_product->is_visible() ? '<a href="' . esc_url( apply_filters( 'woocommerce_grouped_product_list_link', get_permalink( $grouped_product->get_id() ), $grouped_product->get_id() ) ) . '">' . $grouped_product->get_name() . '</a>' : $grouped_product->get_name(); $value .= $grouped_product->is_visible() ? '<a href="' . esc_url( apply_filters( 'woocommerce_grouped_product_list_link', get_permalink( $grouped_product->get_id() ), $grouped_product->get_id() ) ) . '">' . $grouped_product->get_name() . '</a>' : $grouped_product->get_name();
$value .= '</label>'; $value .= '</label>';
break; break;
case 'price' : case 'price':
$value = $grouped_product->get_price_html() . wc_get_stock_html( $grouped_product ); $value = $grouped_product->get_price_html() . wc_get_stock_html( $grouped_product );
break; break;
default : default:
$value = ''; $value = '';
break; break;
} }
echo '<td class="woocommerce-grouped-product-list-item__' . esc_attr( $column_id ) . ' ' . esc_attr( $column_id ) . '">' . apply_filters( 'woocommerce_grouped_product_list_column_' . $column_id, $value, $grouped_product ) . '</td>'; // WPCS: XSS ok. echo '<td class="woocommerce-grouped-product-list-item__' . esc_attr( $column_id ) . '">' . apply_filters( 'woocommerce_grouped_product_list_column_' . $column_id, $value, $grouped_product ) . '</td>'; // WPCS: XSS ok.
do_action( 'woocommerce_grouped_product_list_after_' . $column_id, $grouped_product ); do_action( 'woocommerce_grouped_product_list_after_' . $column_id, $grouped_product );
} }
echo '</tr>'; echo '</tr>';
} }
setup_postdata( $post = $previous_post ); // WPCS: override ok. $post = $previous_post; // WPCS: override ok.
setup_postdata( $post );
?> ?>
</tbody> </tbody>
</table> </table>