MOREINFOINVENTORYACTUAL in conditional statement

Questions and answers about ShopSite Custom Templates

MOREINFOINVENTORYACTUAL in conditional statement

Postby Bsummerlin » Thu Jun 07, 2012 5:08 pm

I'm attempting to use the new tag MOREINFOINVENTORYACTUAL in a conditional statement. The reason behind this is that not all of my items are inventory items, but are custom made to order. I generally put "100" qty for these type items. My intention was to continue to use the PRODUCT.Field1 to display a range of time delays (some items take 1-2 weeks, some 3-4, etc...).

Now that I've introduced the new tag MOREINFOINVENTORYACTUAL into the mix, it will render on the page regardless of what the PRODUCT.Field1 is stating.

Here's the code:
Code: Select all
<!-- availability -->
[-- IF PRODUCT.Subproduct --]
# do not show availability for Master Product
[-- ELSE --]
    <b>Availability: </b>
    [-- IF PRODUCT.Field1 "1" --][-- MOREINFOINVENTORYACTUAL --]
    [-- ELSE_IF PRODUCT.Field1 "2" --]Ships approx 1 to 2 Weeks after placing order
    [-- ELSE_IF PRODUCT.Field1 "3" --]Ships approx 2 to 3 Weeks after placing order
    [-- ELSE_IF PRODUCT.Field1 "4" --]Ships approx 3 to 4 Weeks after placing order
    [-- END_IF --]   
[-- END_IF --]
<!-- end availability -->


Also, how do you add MOREINFOINVENTORYACTUAL to the product option pull down menu code?

Thanks!
Brant

Btw, Lexiconn rocks! Best service period.
Bsummerlin
 
Posts: 18
Joined: Mon Mar 01, 2010 1:27 pm
Location: Louisiana

Re: MOREINFOINVENTORYACTUAL in conditional statement

Postby Jim » Thu Jun 07, 2012 8:22 pm

Does the code work? It looks like it should, provided that that is on the moreinfo page, the tag won't work on a regular page.

The moreinfoinventoryactual does not work with the order options. Instead if you have the advance options with the Cascading menus enabled and and the quantity fields being used, Items that are out of stock will not display at all , Other items will display the quantity available or a message depending on how you have configured the Preferences > Inventory Tracking > More Info Page 3 fields for Instock, Out of Stock or Low stock values.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: MOREINFOINVENTORYACTUAL in conditional statement

Postby Bsummerlin » Fri Jun 08, 2012 6:53 am

This item:
http://www.grimmbrothershalloween.com/pasusie-the-possessed-ghoul-silicone-mask.php
- has ProductField1 set to 5 (which is for a new entry I've made since last) for "4 to 5 weeks".
After publish, the availability is output as "Availability: In stock Ships approx 4 to 5 Weeks after placing order "

It should just show "Availability: Ships in approx 4 to 5 weeks after placing order".

In stock is output by MOREINVENTORYACTUAL, when it shouldn't be showing at all, that I can tell anyway. I don't want customers to think a made to order item is in stock. I'd hoped the conditional trigger would remove the ajaxed inventory call altogether on products where it wasn't required.

Here's another example but a little different:
http://www.grimmbrothershalloween.com/fantastic-tooth-and-nail.php
- has an empty ProductField1 and is a Master Product with assigned subproducts. Even though there are subproducts, and the ProductField1 is empty, the conditional statement seems to be disregarded completely and the MOREINVENTORYACTUAL code is still written to the page to be processed.

If the QOH for the Master Product is set to "0", output is "This Product is on back order", whereas if QOH is empty, there is no output. There is no text placeholder for "This Product is on back order" to be edited that I could find either. Looking at the code for the template above, if the Master Product is showing that it has assigned subitems, it shouldn't be writing the MOREINVENTORYACTUAL code to the page at all, should it?

I'm stumped.
B
Bsummerlin
 
Posts: 18
Joined: Mon Mar 01, 2010 1:27 pm
Location: Louisiana

Re: MOREINFOINVENTORYACTUAL in conditional statement

Postby Bsummerlin » Sun Jun 10, 2012 11:54 am

Anything?
B
Bsummerlin
 
Posts: 18
Joined: Mon Mar 01, 2010 1:27 pm
Location: Louisiana

Re: MOREINFOINVENTORYACTUAL in conditional statement

Postby Jim » Sun Jun 10, 2012 9:52 pm

What does the Quantity on Hand for the product have? That is what determines what will be output by the MoreInfoInventoryActual.
Is the product a subproduct?
What value do you actually have in product field1? 1 or "1", 2 or "2" etc.

Try debugging the code by putting in some print statements to see what settings are set to at various locations.

Code: Select all
<!-- availability -->
<br> what is product field 1 ?  -  [-- product.field1 --]<br>
Quantity on hand is -- [-- PRODUCT.QuantityOnHand --]
[-- IF PRODUCT.Subproduct --]
<br> If this prints the if product.subproduct is true.<br>Quantity on hand is -- [-- PRODUCT.QuantityOnHand --]<br>
# do not show availability for Master Product
[-- ELSE --]
<br> If this prints the if product.subproduct is false.<br>
Quantity on hand is -- [-- PRODUCT.QuantityOnHand --]
    <b>Availability: </b>
    [-- IF PRODUCT.Field1 "1" --]<br> product.field1 is [-- product.field1 --]<br>[-- MOREINFOINVENTORYACTUAL --]
    [-- ELSE_IF PRODUCT.Field1 "2" --]Ships approx 1 to 2 Weeks after placing order
  <br> else_if for 2 product.field1 is  [-- product.field1 --]
    [-- ELSE_IF PRODUCT.Field1 "3" --]Ships approx 2 to 3 Weeks after placing order
 <br> else_if for 3 product.field1 is [-- product.field1 --]
    [-- ELSE_IF PRODUCT.Field1 "4" --]Ships approx 3 to 4 Weeks after placing order
 <br> else_if for 4 product.field1 is [-- product.field1 --]
[-- ELSE_IF PRODUCT.Field1 "5" --]Ships approx 3 to 4 Weeks after placing order
 <br> else_if for 5 product.field1 is [-- product.field1 --]
    [-- END_IF --]   
[-- END_IF --]
<!-- end availability -->


Try something like that to see what various values are set to and to see what code is actually being executed.
Publish the page and see what is being displayed. both on the page and the html source.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: MOREINFOINVENTORYACTUAL in conditional statement

Postby Bsummerlin » Mon Jun 11, 2012 6:47 am

Based on the information here:
http://www.grimmbrothershalloween.com/pasusie-the-possessed-ghoul-silicone-mask.php
Item is NOT a subproduct. It definitely has a ProductQOH of 100, the ProductField1 set to 5 for "4 to 5 weeks".
After publish, the availability is output as "Availability: In stock Ships approx 4 to 5 Weeks after placing order "
It should just show "Availability: Ships in approx 4 to 5 weeks after placing order".

Based on this code,
Code: Select all
<!-- availability -->
[-- IF PRODUCT.Subproduct --]
# do not show availability for Master Product
[-- ELSE --]
    <b>Availability: </b>
    [-- IF PRODUCT.Field1 "1" --][-- MOREINFOINVENTORYACTUAL --]
    [-- ELSE_IF PRODUCT.Field1 "2" --]Ships approx 1 to 2 Weeks after placing order
    [-- ELSE_IF PRODUCT.Field1 "3" --]Ships approx 2 to 3 Weeks after placing order
    [-- ELSE_IF PRODUCT.Field1 "4" --]Ships approx 3 to 4 Weeks after placing order
    [-- ELSE_IF PRODUCT.Field1 "5" --]Ships approx 4 to 5 Weeks after placing order
    [-- END_IF --]   
[-- END_IF --]
<!-- end availability -->

why would the MOREINFOINVENTORYACTUAL output be written to this product's page when the PRODUCT.Field1 is clearly not 1? It shouldn't matter if the QOH is empty, 0, or 10,000. Unless PRODUCT.Field1 is set to 1, the MOREINFOINVENTORYACTUAL tag shouldn't execute, right? Is this a bug? I can throw any number of conditions at it (and am), but it still writes the ajax code to check inventory and displays the output regardless of where MOREINFOINVENTORYACTUAL is being called in the process.

I use a variety of IF/THEN to display to display product details like this for different products and have never run into this and that leads me to believe that it could be a bug during publish. Any chance you could try it on the demo store and see if it works conditionally on another setup?

Brant
Bsummerlin
 
Posts: 18
Joined: Mon Mar 01, 2010 1:27 pm
Location: Louisiana

Re: MOREINFOINVENTORYACTUAL in conditional statement

Postby ShopSite Lauren » Mon Jun 11, 2012 10:14 am

Brant,

I was able to recreate the problem; I am not sure why the MOREINFOINVENTORYACTUAL tag is being processed even when it is in an IF statement that is not true. However, I was able to get around it by putting just the MOREINFOINVENTORYACTUAL tag in an include file. I created an include file called "Inventory" then placed only that tag in it. Then in your product more information page template, the code would look like the following:

<!-- availability -->
[-- IF PRODUCT.Subproduct --]
# do not show availability for Master Product
[-- ELSE --]
<b>Availability: </b>
[-- IF PRODUCT.Field1 "1" --][-- INCLUDE Inventory PROCESS --]
[-- ELSE_IF PRODUCT.Field1 "2" --]Ships approx 1 to 2 Weeks after placing order
[-- ELSE_IF PRODUCT.Field1 "3" --]Ships approx 2 to 3 Weeks after placing order
[-- ELSE_IF PRODUCT.Field1 "4" --]Ships approx 3 to 4 Weeks after placing order
[-- END_IF --]
[-- END_IF --]
<!-- end availability -->

-Lauren
- ShopSite Lauren
Contact me for help with any of your
custom ShopSite template questions.
ShopSite Lauren
 
Posts: 887
Joined: Fri Aug 11, 2006 1:35 pm
Location: Orem, UT

Re: MOREINFOINVENTORYACTUAL in conditional statement

Postby Bsummerlin » Mon Jun 11, 2012 10:49 am

Worked like a charm! Thanks soooooo much Lauren!
Brant
Bsummerlin
 
Posts: 18
Joined: Mon Mar 01, 2010 1:27 pm
Location: Louisiana


Return to Custom Template Questions

Who is online

Users browsing this forum: No registered users and 105 guests