Show Available Slots to Anonymous

Created on 28 November 2015, over 9 years ago
Updated 28 February 2025, about 2 months ago

Hello,

I would like to limit register access to authenticated users only, but still show the number of available slots to anonymous users.

file commerce_registration.module, line 365 prevents showing the number of available slots if the user does not have registration access. Is it possible to add a field settings to allow view of available slots even if the user does not have register access?

      case "hidden":
        $product = commerce_product_load($form['product_id']['#value']);
        $settings = registration_entity_settings('commerce_product', $form['product_id']['#value']);
        if (commerce_registration_product_has_registration_field($product->product_id)
            && !empty($settings)
            && registration_status('commerce_product', $form['product_id']['#value'], TRUE)

// -->  This line prevents showing slots available if user does not have registration access, ie by Anonymous 
            && registration_register_page_access('commerce_product', $product)) {
// --<
          $fieldsettings = field_extra_fields_get_display('commerce_product', $product->type, 'default');
          $showavail = isset($fieldsettings['registration_available'])
            && isset($fieldsettings['registration_available']['visible'])
            && $fieldsettings['registration_available']['visible'];
✨ Feature request
Status

Closed: outdated

Version

2.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States aj2

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024