New text area not showing
-
Hi,
I created a news tab in the Store Details area called ‘Buoni spesa’. It is a textarea and I would want it to show in the listing area.
It’s not working with this code. I thing there’s something wrong in the frontend code, but I cant find out what’s wrong.
Could you please help me?/*tab buono spesa in wpsl*/
/*backend php*/
add_filter( ‘wpsl_meta_box_fields’, ‘custom_meta_box_fields’ );function custom_meta_box_fields( $meta_fields ) {
$meta_fields[__( ‘Buono spesa’, ‘wpsl’ )] = array(
‘buono-spesa_textarea’ => array(
‘label’ => __( ‘Buono spesa’, ‘wpsl’ )
)
);return $meta_fields;
}
/*backend json*/
add_filter( ‘wpsl_frontend_meta_fields’, ‘custom_frontend_meta_fields’ );function custom_frontend_meta_fields( $store_fields ) {
$store_fields[‘wpsl_buono-spesa_textarea’] = array(
‘name’ => ‘buono-spesa_textarea’,
‘type’ => ‘textarea’
);return $store_fields;
}
/*frontend*/
add_filter( ‘wpsl_listing_template’, ‘custom_listing_template’ );function custom_listing_template() {
global $wpsl_settings;
$listing_template = ‘<li data-store-id=”<%= id %>”>’ . “\r\n”;
$listing_template .= “\t\t” . ‘<div>’ . “\r\n”;
$listing_template .= “\t\t\t” . ‘<p><%= thumb %>’ . “\r\n”;
$listing_template .= “\t\t\t\t” . wpsl_store_header_template( ‘listing’ ) . “\r\n”;
$listing_template .= “\t\t\t\t” . ‘<span class=”wpsl-street”><%= address %></span>’ . “\r\n”;
$listing_template .= “\t\t\t\t” . ‘<% if ( address2 ) { %>’ . “\r\n”;
$listing_template .= “\t\t\t\t” . ‘<span class=”wpsl-street”><%= address2 %></span>’ . “\r\n”;
$listing_template .= “\t\t\t\t” . ‘<% } %>’ . “\r\n”;
$listing_template .= “\t\t\t\t” . ‘<span>’ . wpsl_address_format_placeholders() . ‘</span>’ . “\r\n”;
$listing_template .= “\t\t\t\t” . ‘<span class=”wpsl-country”><%= country %></span>’ . “\r\n”;
$listing_template .= “\t\t\t” . ‘</p>’ . “\r\n”;// Check if the ‘buono-spesa_textarea’ contains data before including it.
$listing_template .= “\t\t\t” . ‘<% if ( buono-spesa_textarea ) { %>’ . “\r\n”;
$listing_template .= “\t\t\t” . ‘<p>“>’ . __( ‘Buono spesa’, ‘wpsl’ ) . ‘</p>’ . “\r\n”;
$listing_template .= “\t\t\t” . ‘<% } %>’ . “\r\n”;$listing_template .= “\t\t” . ‘</div>’ . “\r\n”;
// Check if we need to show the distance.
if ( !$wpsl_settings[‘hide_distance’] ) {
$listing_template .= “\t\t” . ‘<%= distance %> ‘ . esc_html( $wpsl_settings[‘distance_unit’] ) . ” . “\r\n”;
}$listing_template .= “\t\t” . ‘<%= createDirectionUrl() %>’ . “\r\n”;
$listing_template .= “\t” . ‘‘ . “\r\n”;return $listing_template;
}
- The topic ‘New text area not showing’ is closed to new replies.