Forum OpenACS Q&A: Ecommerce - Newbie question

Collapse
Posted by Lachlan Myers on
This is probably a trivial misunderstanding on my part.

I'm trying to add a thumbnail to the product listing in the subcategory browsers.

When I edit the category-browse-subcategory.tcl, and add p.dirname to

db_foreach get_regular_product_list "
    select p.product_id, p.product_name, p.one_line_description, p.dirname, o.offer_code
    from $product_map($sub) m, ec_products_searchable p left outer join ec_user_session_offer_codes o on (p.product_id = o.product_id and user_session_id = :user_session_id)
    where p.product_id = m.product_id
    and m.${sub}category_id = :${sub}category_id
    $exclude_subproducts
    order by p.product_name" {
There is no problem, but when I try to reference it as $dirname in the bit that generates the @products@ HTML
append products " .... (dots representing HTML that can't be sent)
          ....
.....
     .....         
[ec_linked_thumbnail_if_it_exists $dirname]
...... 

I get an error (can't read "dirname": no such variable)

Any suggestions?

Thanks

Collapse
Posted by Dave Bauer on
You need to edit the XQL file for the database you are using or the generic XQL file. In this case category-browse-subcategory.xql.

When you do that you'll also need to visit acs-admin/apm/ and reload the ecommerce package to update the copy of the query the server is using. A reload link next to the ecommerce listing will be shown if any tcl or xql files have changed since the server was started.

Collapse
Posted by Lachlan Myers on
Thanks - perfect!