Forum OpenACS Q&A: Custom fields in ecommerce

Collapse
Posted by Richard Hamilton on
Does anyone know if the functionality to display custom product fields already exists in OpenACS 4.6 or do I need to write a tcl function to be included in a product display template that retrieves the fields?

I cannot find guidance in the docs and have searched for a parameter to set or a function to use to no avail.

I have uploaded the ec_custom_product_field_values using the .csv product extras upload function. The fields appear fine in the admin pages but I cannot find where to switch them to display in the public (non admin) pages. By the way if you are using postgres you will need to modify extras-upload-2.tcl to replace sysdate with current_timestamp.
Thanks
Richard
Collapse
Posted by Bart Teeuwisse on
Richard,

you will have to modify the product template accordingly. While it would be possible to include the custom fields in the default template, I'm of the opinion that in most -if not all- cases you would want to customize the layout of the eCommerce pages when you add custom fields.

Feel free to submit a patch is you prefer to include custom pages in the user web pages.

/Bart

Collapse
Posted by Richard Hamilton on
Thanks Bart, I'll get templating!

Oh, there's another little gem for us with the ecommerce system - how to integrate the templating system with ACS Templating!

Regards Richard

Collapse
Posted by Bart Teeuwisse on
Richard,

integration of the eCommerce Templating System (ETS) with the ACS Templating System (ATS) would require a rewrite of (part of) the ecommerce package. I agree with you that it is desirable to replace the ETS with the ATS. Yet, there are many other things in the eCommerce package that could/should be refactured. The product categories for one, or the user classes, or the eCommerce mailing list.

My preference would be to phase the current eCommerce package out in favor of several smaller modular packages held together by service contracts. A core of eCatalog, eCart, eCharge and eShip would replace 80% of today's eCommerce package. I think that replacing the eCommerce package would procude a better more flexible solution.

In addition, other packages could use some of the packages too. Like the events packages, which currently requires the entire eCommerce packages, just to accept payments for events that come at a cost. The events package doesn't need or uses the on-line catalog or allows customer reviews. A combination of eCart and eCharge would suffice.

Anyhow, the ETS uses the standard ADP for it's templates. A template gets parsed and is inserted into the ATS template as a chunk of HTML.

/Bart

Collapse
Posted by Richard Hamilton on
Seperate modules definitely sounds very sensible. It would be more flexible, more concise from an operational point of view and more reusable.

This would of course mean a substantial re-write with much of the code having to be re-engineered to 'modularise' it, support the interactions between the modules, eliminate deprecated functions (of which there are many), support the new acs templating model and accommodate new SQL for the new data model.

A very big project but I am sure worthwhile.

Regards
Richard