Guest Posted September 24, 2009 Posted September 24, 2009 Hi, Thank you thank you for this contrib! Its wonderful! I was wondering if anyone would help me to modify the index.php code of this script so that the restrict dropdowns only show if. For example... I have a category of games and a category of movies. I would like the restrict fields to only show if they are used in the category. I dont want the the movies category to show the restrict feilds or labels for game options. I want it to work as the manufacturer and category product list filter, as i see a few lines above in the index.php file. so heres what im messing with. catalog/index.php <!-- begin extra product fields --> <tr> <td class="main" align="left" colspan="2"> <?php $epf_list = array(); foreach ($epf as $e) { if ($e['restrict']) $epf_list[] = $e['field']; } echo tep_draw_form('epf_restrict', FILENAME_DEFAULT, 'get'); if (is_array($HTTP_GET_VARS) && (sizeof($HTTP_GET_VARS) > 0)) { reset($HTTP_GET_VARS); while (list($key, $value) = each($HTTP_GET_VARS)) { if ( (strlen($value) > 0) && ($key != tep_session_name()) && (!in_array($key, $epf_list)) ) { echo tep_draw_hidden_field($key, $value); } } } foreach ($epf as $e) { if ($e['restrict']) { echo sprintf(TEXT_RESTRICT_TO, $e['label'], tep_draw_pull_down_menu($e['field'], tep_build_epf_pulldown($e['id'], $languages_id, array(array('id' => '', 'text' => TEXT_ANY_VALUE))),'', 'onchange="this.form.submit()"')) . '<br>'; } } ?> </form> </td> </tr> <!-- end extra product fields --> and i see how its done here in product_listing.php // begin extra product fields $extra = ''; foreach ($epf as $e) { if ($e['listing']) { $mt = ($e['uses_list'] ? ($listing[$e['field']] == 0) : !tep_not_null($listing[$e['field']])); if (!$mt) { // only list fields that aren't empty $extra .= '<br><b>' . $e['label'] . ': </b>'; if ($e['uses_list']) { $extra .= tep_get_extra_field_list_value($listing[$e['field']],$e['show_chain'] == 1); } else { $extra .= $listing[$e['field']]; } } } } // end extra product fields in then $extra is called in the next get vars line. I am a novice that would greatly appreciate any help. Thanks! Chad Quote
AshMavrik Posted October 27, 2009 Posted October 27, 2009 Hello I have added extra product fields. I am creating a bookshop, and would like to add extra description boxes such as ISBN, Page no, etc. opposed to drop down boxes How would I do that? Thank you First Noor Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.