Jump to content

skins/deafult/templates/products.index,php


keat

Recommended Posts

I have a custom mod which requires a few lines of code adding around line 400 in skins/deafult/templates/products.index,php

<td align="center"><input type="checkbox" id="enable_member_{$option.set_member_id}" name="option_create[{$option.set_member_id}][set_enabled]" value="{$option.set_enabled}"></td>

However, this line appears to have changed in 6.1.5 to:

<td align="center"><input type="hidden" id="enable_member_{$option.set_member_id}" name="option_create[{$option.set_member_id}][set_enabled]" value="{$option.set_enabled}" class="toggle"></td>
                 

Not that I'll profess to understand why or what it actually does, but could anyone suggest in laymans terms why it changed and what it does please.

Maybe if I understand this, I'll understand if this is the reason why the mod no longer works.

Link to comment
Share on other sites

There is some javascript that looks for all hidden inputs with class="toggle". The javascript then adds HTML immediately after that to show one of two or three images.The value of these hidden inputs dictate whether the javascript adds a "ON" image, an "OFF" image, or some other image such as "Master" or "Main".

In CC5, these indicator images were a green checkmark or a red cross. Also, a yellow star.

In CC6, those images were changed to an image of a checked checkbox and an image of an unchecked checkbox. Also, a star.

The javascript also added an event monitor to the images so that when clicked, the value was updated (0, 1, and maybe 2) and the imaged swapped to match.

I believe the reason that the change from a real form element checkbox to a javascript powered image of a checkbox was to conform with the general approach to these types of form elements in admin. The use of this approach allows for more than a simple on/off value. For example, the "main" image for a product, plus secondary images being selected in the image picker. There are no other examples, but this allows for expanding into values of undefined limits, by using image indicators to show the value.

Link to comment
Share on other sites

I guess it's feasible that this could be the reason the mod isn't working as expected.

The mod involves a checkbox on the admin side, (on or off)

Whilst I'm able to apply the changes required in the admin side, the omission of the asscociated code, could render the checkbox useless.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...