| Author |
Message |
scottfmorgan
Joined: 11 May 2009
Posts: 5
|
Posted: May 20, 2009 10:08pm Post subject: PHP variables |
|
|
Is there a list of PHP variables that are available to us?
I'm trying to highlight certain items in a list according to what category the user is currently in. I would prefer to do something like:
<LI class="<?php if ({CATEGORY-SID}==77) echo "selected"; ?>">
{CATEGORY-SID} would hopefully be replaced with a PHP variable that represents the current category SID.
Thanks![/code] |
|
dev71997

Joined: 09 Oct 2008
Posts: 4
|
Posted: May 21, 2009 11:51am Post subject: |
|
|
Hello,
| Quote: | | Is there a list of PHP variables that are available to us? |
Yes, a complete list of the different variables that can be used with the Modular Merchant software can be found in the Developer's Guide: http://www.modularmerchant.com/docs/Developers_Guide.pdf
Another good resource is the QuickCode Tag glossary: http://www.modularmerchant.com/quickcode_search.php This will list all of the QuickCode Tags that are available and a brief explanation as to what they do and how they can be used.
I hope this information was helpful. If you have any further questions, please let us know. |
|
scottfmorgan
Joined: 11 May 2009
Posts: 5
|
Posted: May 21, 2009 12:15pm Post subject: |
|
|
I have looked through both of these resouces, and I'm trying to write code for my product template. I would like to use PHP to reference a different CSS class according to what category (Category-SID) the current product is in. I don't believe that I can use a QuickCode Tag in a PHP call so I was hoping there was a PHP variable that would expose the current Category-SID for a page. The Developer's guide seemed to list variables focused on checkout. Here is a snippet that I was hoping to get working:
<LI class="<?php if ({CATEGORY-SID}==77) echo "selected"; ?>">
so if this product was in category sid of 77 the resulting HTML would look like:
<LI class="selected">
otherwise it would be:
<LI class="">
Thanks in advance for your help |
|
Mail Bag

Answering Your Questions Since... 9:30am
Joined: 28 Aug 2005
Posts: 198
|
Posted: May 22, 2009 08:44am Post subject: |
|
|
Hello,
It looks like the variable you're looking for is: $cat_arr['id']
Example: <LI class="<?php if ($cat_arr['id']==77) echo "selected"; ?>">
The QuickCode Tag Glossary definition for the {CATEGORY-SID} QuickCode Tag has also been updated with this information at: http://www.modularmerchant.com/quickcode_details.php?qcid=108
I hope this info helps point you in the right direction! _________________ Modular Merchant Mail Bag
Answering your questions, queries and puzzlers.
Modular Merchant shopping cart software, website hosting, and custom programming. |
|
|