zen 2.1 and numinix product fields
I seem to be lucky/unlucky as everything is working as expected on zen 2.1 :cool:
With 1 small exception :censored:
so upgrade was complete and I could finally think about all the changes required to upgrade my ticketing module. The obvious one was that I only had an "event_date" so I wanted to create an "event_start_date" and an "event_end_date" so I could adjust everything to use the new fields and retire the less desirable field where i'd cram the end and start date together and later dissect the entry into appropriate format.
After using numinix product fields to create the additional fields i went to my admin page and seen them displaying nicely, next job was to ensure they used zencarts datepicker to ensure accurate date entry.
So i go and edit myadminfolder/includes/npf_includes/templates/event_start_date.php (and end date too) and save the files and reload the product listing page in admin to find that I now have a plain input field and the desired field with full date picker functionality.
I've tried myself a few times and tried chatgpt a few more and still not been able to figure out how to remove the plain inputs. if i tell the include that for each's the template files for the fields to skip event_start_date and end date files it just leaves the plain fields there.
I suspect it is either a module fault due to upgrade causing the plain field to also get triggered to echo or a fault in my code im not seeing?
to rule out the more likely of the two scenarios, my template file is as follows...
Code:
<?php
if (!defined('IS_ADMIN_FLAG')) die('Illegal Access');
?>
<div class="form-group">
<?php echo zen_draw_label(
TEXT_EVENT_DATE_START,
'event_date_start',
'class="col-sm-3 control-label"'
); ?>
<div class="col-sm-9 col-md-6">
<div class="date input-group" id="datepicker_event_date_start">
<span class="input-group-addon datepicker_icon">
<i class="fa-regular fa-calendar-days fa-lg"></i>
</span>
<?php echo zen_draw_input_field(
'event_date_start',
isset($pInfo->event_date_start) ? $pInfo->event_date_start : '',
'class="form-control datepicker" id="event_date_start" autocomplete="off"'
); ?>
</div>
<span class="help-block errorText">(<?php echo DATE_FORMAT_DATE_PICKER; ?>)</span>
</div>
</div>
<script>
jQuery(function(){
jQuery('#event_date_start').datepicker({
dateFormat: '<?php echo DATE_FORMAT_DATE_PICKER; ?>',
changeMonth: true,
changeYear: true,
showOtherMonths: true,
selectOtherMonths: true,
showButtonPanel: true
});
});
</script>
i did try to comment out this section thinking it was to blame...
Code:
<div class="form-group">
<?php echo zen_draw_label(
TEXT_EVENT_DATE_START,
'event_date_start',
'class="col-sm-3 control-label"'
); ?>
and a later div was removed to balance open/closes but it went "squinty looking" like i'd messed up the divs and both versions of the same field remained but went side by side. I reverted back to current as the input works, it just looks odd :laugh:
on my module i have managed to make a stand alone login ticket scanner suite with admin side manager to add and remove "operators" and assign them to events by product id (is also event id) and created an event calendar page that can fetch and display events. It can offer a link to buy a ticket if the customer has none or... if not logged in it gives a different message prompting to log in to view or buy tickets. When they have tickets it displays them on the event calendars pop up so they are easy to access on event day and cross selling is/can hopefully be achieved.
I also added structured data for events into my product_info_display which is being correctly picked up. I then manually added a bunch of fields to avoid the issue again of duplicate npf fields and tied them in earlier today so i get as much event structured data markup as possible. Thinking I may have to remove the npf fields i added and insert them manually if I cannot figure it out :yuck: