Miva Merchant 5 Module FAQs » Order Status 5.x (BROK_ORDERSTATUS5)


{docurl}

I am integrating the reorder ability in Order Status mod for Merchant5. The only thing I can't get to work is the conditional for disallowing inactive products. I am using:

%begin_if|Products.d.active|%
%quantity|001|%
%addtobasket%
%end_if%
%begin_if|NOT Products.d.active|%
NOT AVAIL
%end_if%
It is always showing NOT AVAIL even if the product is active.

The problem with the %begin_if not working has to do with the way Merchant 5x works. In 4.x once the Products database was open and pointing to the correct database you could access the data directly with the database fields. In 5.x Merchant opens the databases only long enough to read the data once, then closes them. To counter this I have loaded the product data into a structure g.StatusProduct that can be accessed in the %begin_if code. Basically, in your code, replace Products.d. with g.StatusProduct:.

eg. your code becomes:

%begin_if|Pg.StatusProduct:active|%
%quantity|001|%
%addtobasket%
%end_if%
%begin_if|NOT g.StatusProduct:active|%
NOT AVAIL
%end_if%



Last update: 2007-03-29 09:57
Author: Thor
Revision: 1.0

Print this record Send FAQ to a friend Show this as PDF file
Please rate this FAQ:

Average rating: 3.5 out of 5 (2 Votes )

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry