X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Adding "Extra Field" to product template (https://forum.x-cart.com/showthread.php?t=71121)

jriggins911 02-04-2015 12:19 PM

Adding "Extra Field" to product template
Can anyone point me in the right direction here?

I'm attempting to add an extra field, using XC4 terminology, to all products in XC 5.1.10.

I've gone through the process of creating a module, turning the module on and am at the point where the new field entry has been adding the xc_products sql table and is displaying on the admin side.

My question is, do I now need to modify a "product" tpl in order to get it show on the front end?

I would sure would appreciate someone pointing me in the right direction. I've explored modifying a template in order to have it included but not sure what needs to be modified and how. I'd like the new field to display around the general area where the Weight and SKU are displayed, however, it appears those items have a specific attribute.weight.tpl and atrribute.sku.tpl file for each. Do I need to create similar tpl file for my new field?

I'm trying to give XC5 a chance but is seems overly convoluted to make minor additions? Is there a better way I'm missing here?

I've looked at using the custom skin module but I believe it keeps leading me back to the original issue, what tpl do I need to modify to display the new field and do I need to add a specific attribute tpl file similar to weight and sku?

Most of the knowledge base entries on topic, at least I can find, do not quite cover this particular issue and does not seem to provide enough information across the tutorials to be able to figure it out.

qualiteam 02-05-2015 03:03 AM

Re: Adding "Extra Field" to product template

I believe you don't need a custom module as you can create "extra fields" with the attributes feature built into X-Cart 5.

Just add a "global" attribute when editing a product, and it will appear for all products. Or you can create a "class" attribute that will show up for products having that class selected on the Attributes tab.

Here is an article on this feature:

Is it what you are looking for?

jriggins911 02-05-2015 06:11 AM

Re: Adding "Extra Field" to product template
I tried that route initially but ran into problems. Everytime I created an attribute, for instance a textarea. I would be able to associate it with the product (either globally or product specific) I could not get the field to show unless I clicked the "editable" check box. If the box was left unchecked, the field never showed. When checked, it would display.

I abandoned that route because having the information show in a expandable box was not what I was looking for.

All times are GMT -8. The time now is 11:06 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.