Option Menu Formatting

General ShopSite user discussion

Option Menu Formatting

Postby mactheweb » Thu Aug 30, 2007 3:04 pm

I have some products with 5 or 6 options for the shopper to select. I'm using Manager version 8.3. Is it possible to make the menus display vertically, each on a new line or paragraph, rather than in one horizontal line across the page?

Or it is possible to hand code the menus and send the results to the system?
mactheweb
 
Posts: 21
Joined: Mon Feb 12, 2007 11:08 am

Postby Jim » Thu Aug 30, 2007 3:20 pm

have you tried the tag

[-- Order_Option_Menu Column --]

instead of

[-- Order_Option_Menu line --]

Also using a "Call" and the tag [-- PRODUCT.OptionFiniteText --] you could pass the options to your own routine that will format them however you like.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby mactheweb » Thu Aug 30, 2007 3:33 pm

Thanks for the quick answer, Jim

Since I haven't used any tables in the layout do I need to put the
[-- Order_Option_Menu Column --]
inside of one?

I've tried to use a call before and never quite got it. Is there any documentation with a complete example?
mactheweb
 
Posts: 21
Joined: Mon Feb 12, 2007 11:08 am

Postby Jim » Fri Aug 31, 2007 8:57 am

Both [-- Order_Option_Menu line --] and [-- Order_Option_Menu column --] place the output in a complete table so you shouldn't have to create one for that.

For an example of the CALL tag, I used the code below to get the add to cart image before there was an option to get it directly

Code: Select all
 <input type=image [-- CALL inf.pl ( OUTPUT_DIRECTORY_PATH , PRODUCT.addtocartbutton ,strip) --]


the file inf.pl contains
Code: Select all
#!/usr/bin/perl

# This file will use the passed  directory path and image name to
#   display the ShopSite .inf file associated with the image.
#  i.e: [-- CALL inf.pl (OUTPUT_DIRECTORY_PATH, go.gif {,strip}) --]
# if the optional paramater "strip" is added then the <img and > are removed
# before the contents of the .inf file is displayed.

#print @ARGV;
#print "\n";

$filename = $ARGV[0] . "/media/.inf." .  $ARGV[1];

#print "$filename\n";

open(INPUT,$filename);
@input = <INPUT>;
if (($ARGV[2] =~ /strip/is))
{
  $coutput = $input[0];
  if (! ($coutput =~ /\<img.*\>/is))
  {
    print $coutput;
  }
  else
  {
    $coutput =~ s/.*\<\s*img(.*?)\>.*/$1/is;

   print $coutput;
  }

}
else
{
  print @input;
}
close (INPUT);

Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby mactheweb » Fri Aug 31, 2007 9:23 am

Hi Jim,

Thanks for the code and answer. I've used the Order_Option_Menu column successfully.

Your example helps me understand CALL better. I'll play with it and VAR a bit over the weekend. It's been nearly 10 years since I've used Perl so I'll have to get a bit more current with CGI. :?

best,
michael
mactheweb
 
Posts: 21
Joined: Mon Feb 12, 2007 11:08 am

Postby Jim » Fri Aug 31, 2007 9:32 am

You don't have to use perl, you can use what ever language you want, C, php, perl, any thing that can accept parameters and pass the information back.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby JeremeD » Sun Sep 02, 2007 6:21 am

Jim wrote:You don't have to use perl, you can use what ever language you want, C, php, perl, any thing that can accept parameters and pass the information back.


Jim,

I was unaware that PHP can be used with the call tag since it doesn't say this in the manual. This would have been extremely useful to me several times.

Does the call tag pass parameters to the script as if it were a function?

Should the script itself include opening and closing PHP tags?

I'm not familiar with PERL. Can you provide a simple example of how a php script looks that's receiving parameters from the call tag?
SD360.com
Certified ShopSite Designer
ShopSite Templates Available Now
JeremeD
 
Posts: 60
Joined: Sat Feb 10, 2007 4:20 pm
Location: Athens, GA


Return to User Forum

Who is online

Users browsing this forum: No registered users and 63 guests