Support » Plugin: WooCommerce - Gift Cards » Add class to div surrounding fields on product page

  • Hi there,

    I would like to style the fields that display on the product page (Name, Email and note).

    But the div that’s around the fields doesn’t have a class so it makes it a bit difficult to target that with CSS.

    Could you perhaps just add a class on that div called for example “giftcard-product-fiels”

    gift-cards-for-woocommerce/includes/giftcard-product.php

    
    do_action( 'rpgc_before_all_giftcard_fields', $post );
    		
    		$rpgc_to 		= ( isset( $_POST['rpgc_to'] ) ? sanitize_text_field( $_POST['rpgc_to'] ) : "" );
    		$rpgc_to_email 	= ( isset( $_POST['rpgc_to_email'] ) ? sanitize_text_field( $_POST['rpgc_to_email'] ) : "" );
    		$rpgc_note		= ( isset( $_POST['rpgc_note'] ) ? sanitize_text_field( $_POST['rpgc_note'] ) : ""  );
    
    		$rpw_to_check 		= ( get_option( 'woocommerce_giftcard_to' ) <> NULL ? get_option( 'woocommerce_giftcard_to' ) : __('To', 'rpgiftcards' ) );
    		$rpw_toEmail_check 	= ( get_option( 'woocommerce_giftcard_toEmail' ) <> NULL ? get_option( 'woocommerce_giftcard_toEmail' ) : __('To Email', 'rpgiftcards' )  );
    		$rpw_note_check		= ( get_option( 'woocommerce_giftcard_note' ) <> NULL ? get_option( 'woocommerce_giftcard_note' ) : __('Note', 'rpgiftcards' )  );
    
    		?>
    
    		<div class="ADD CLASS HERE!">
    			<?php if ( $is_required_field_giftcard == "yes" ) { ?>
    				<div class="rpw_product_message"><?php _e('All fields below are required', 'rpgiftcards' ); ?></div>
    			<?php } else { ?>
    				<div class="rpw_product_message"><?php _e('All fields below are optional', 'rpgiftcards' ); ?></div>
    			<?php } ?>
    
  • The topic ‘Add class to div surrounding fields on product page’ is closed to new replies.