- Mar 3, 2019
- 227
- 249
- 43
I'm trying to display message for customer for a date or schedule that's available in the near future in the product loop woocommerce.(Category, Archive, Shop)
I use this plugin Woocommerce Appointment for booking, and l want show this Settings on the backend for availability auto select and try to show on product loop.
I'm try to write some code and add to function.php, but there seems to be something wrong here.
I use
to display it from here (found this on plugin)
But I don't know how to do it to display it properly in product loop...
Any help is much appreciated, thx.
Plugin for i'm testing.
I use this plugin Woocommerce Appointment for booking, and l want show this Settings on the backend for availability auto select and try to show on product loop.
I'm try to write some code and add to function.php, but there seems to be something wrong here.
add_action( 'woocommerce_after_shop_loop_item', 'wc_shop_page_product_date', 100 );
function wc_shop_page_product_date() {
$single_product_obj = get_wc_product_appointment( $single_product->post->ID );
echo '<span class="product">AVAILABLE at: ' . get_wc_product_appointment('d-m-Y', $single_product->post->ID) . '</span>';
}
I use
get_wc_product_appointment
to display it from here (found this on plugin)
-<wpml-config>
-<custom-types>
<custom-type translate="0">wc_appointment</custom-type>
</custom-types>
-<custom-fields>
<custom-field action="copy">_wc_appointment_availability</custom-field>
<custom-field action="copy">_wc_appointment_availability_autoselect</custom-field>
<custom-field action="copy">_wc_appointment_availability_span</custom-field>
<custom-field action="copy">_wc_appointment_cal_color</custom-field>
<custom-field action="copy">_wc_appointment_cancel_limit</custom-field>
<custom-field action="copy">_wc_appointment_cancel_limit_unit</custom-field>
<custom-field action="copy">_wc_appointment_duration</custom-field>
<custom-field action="copy">_wc_appointment_duration_unit</custom-field>
<custom-field action="copy">_wc_appointment_has_price_label</custom-field>
<custom-field action="translate">_wc_appointment_price_label</custom-field>
<custom-field action="copy">_wc_appointment_has_pricing</custom-field>
<custom-field action="copy">_wc_appointment_interval</custom-field>
<custom-field action="copy">_wc_appointment_interval_unit</custom-field>
<custom-field action="copy">_wc_appointment_max_date</custom-field>
<custom-field action="copy">_wc_appointment_max_date_unit</custom-field>
<custom-field action="copy">_wc_appointment_min_date</custom-field>
<custom-field action="copy">_wc_appointment_min_date_unit</custom-field>
<custom-field action="copy">_wc_appointment_padding_duration</custom-field>
<custom-field action="copy">_wc_appointment_padding_duration_unit</custom-field>
<custom-field action="translate">_wc_appointment_price_label</custom-field>
<custom-field action="copy">_wc_appointment_pricing</custom-field>
<custom-field action="copy">_wc_appointment_has_restricted_days</custom-field>
<custom-field action="copy">_wc_appointment_restricted_days</custom-field>
<custom-field action="copy">_wc_appointment_qty</custom-field>
<custom-field action="copy">_wc_appointment_qty_min</custom-field>
<custom-field action="copy">_wc_appointment_qty_max</custom-field>
<custom-field action="copy">_wc_appointment_requires_confirmation</custom-field>
<custom-field action="copy">_wc_appointment_staff_assignment</custom-field>
<custom-field action="translate">_wc_appointment_staff_label</custom-field>
<custom-field action="copy">_wc_appointment_user_can_cancel</custom-field>
<custom-field action="copy">_wc_appointment_customer_timezones</custom-field>
</custom-fields>
</wpml-config>
But I don't know how to do it to display it properly in product loop...
Any help is much appreciated, thx.
Plugin for i'm testing.