View Single Post
  #444  
Old 08-12-2022, 09:07 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Re: X-Cart reBOOT (reDUX) Template

Quote:
@PHilJ how to add an extra field in a category, and display the content in H1, instead of the category name.
Follow these steps (make a full backup first)...

1) Patch the database with the new category field...
Code:
ALTER TABLE `xcart_categories` ADD `category_alt` VARCHAR(255) NOT NULL DEFAULT '';

2) Edit /include/func/func.category.php


After...
Code:
$to_search[] = 'node.seo';

Insert...
Code:
$to_search[] = 'node.category_alt';

3) Edit /admin/category_modify.php

After...
Code:
'seo' => $seo, // Reboot

Insert...
Code:
'category_alt' => $category_alt, // Reboot

4) Edit /skin/reboot/admin/main/category_modify.tpl

After...
Code:
{include file="main/clean_url_field.tpl" clean_url="" show_req_fields="Y" clean_urls_history=""} {/if}

Insert...
Code:
<tr> <td height="10" class="FormButton" nowrap="nowrap">{$lng.lbl_category} ALT:</td> <td width="10" height="10">&nbsp;</td> <td height="10"> <input type="text" name="category_alt" id="category_alt" maxlength="255" size="65" value="{$current_category.category_alt|escape:"html"}" /> </td> </tr>

5) In Admin > Tools > Maintenance, click "Rebuild category indexes".

6) In Admin > Tools > Maintenance, Clear the X-Cart cache.

After that you should be able to save the new category fields and be able to use {$category.category_alt} in the template.
__________________
xcartmods.co.uk
Reply With Quote