Custom Template (Inventory question)

This is an archive of old posting to the User Forum

Custom Template (Inventory question)

Postby Andy » Mon Jul 15, 2002 11:11 pm

Hi, all, please forgive me if this was asked but...

In a custom product template anyone know the language to use for an if-else
statement that would be used in the following instance.

If available inventory is greater than 0, than display add to cart button
else insert text "send an email to join our waiting list"?

Is something like this possible?

Thanks!

Andy
Andy
 

Re: Custom Template (Inventory question)

Postby loren_d_c » Tue Jul 16, 2002 12:14 am

There is no greater than or less than compare for the custom template IF
tag. In fact, the string compare (basically an 'equals' function) for
the IF tag was added to the 6.1 release, previously the IF would always
return true if there was anything in the field it was checking.

To do what you are wanting would require using the CALL tag to pass the
Inventory Tracking values to an external program to do that kind
greater-than/less-than compare.

Since you don't want to have to create the order buttons in the external
script if the quantity available is OK (the script would be a lot
simpler if you leave the order button creating in the template), you
should probably do something like if there is product available, your
external script does nothing, but if there is not, output your out of
stock message/graphics and then an HTML comment tag that will comment
out the order buttons that follow immediately after in the template. And
then in the template after the order buttons, put another CALL to
another similar script to check the inventory again so that if you
commented out the order buttons, you can output the ending HTML comment
after the order buttons.

-Loren




Andy wrote:
Hi, all, please forgive me if this was asked but...

In a custom product template anyone know the language to use for an if-else
statement that would be used in the following instance.

If available inventory is greater than 0, than display add to cart button
else insert text "send an email to join our waiting list"?

Is something like this possible?

Thanks!

Andy
loren_d_c
 
Posts: 2571
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere


Return to User Forum Archive

Who is online

Users browsing this forum: No registered users and 35 guests