Within Yahoo Store RTML Template, this operator is showing as:
The purpose of this operator is to take an argument and convert it (if possible) to a numerical type.
The argument in this example starts with “$”, where “$” is not a numerical character and therefore the AS-NUMBER returns 0
AS-NUMBER “10.44 20 30”
This example returns 10.44 because AS-NUMBER stops at the not numerical blank character.
In the previous “Custom Availability” post we explained how to use the Custom Availability property together with the system Availability property. This method requires basic RTML knowledge.
Next, we will show you how to implement a “Custom availability” text field instead of using the pre-defined property Availability. This method is simpler than the previous one.
First, open a list of store Templates. Then find custom Item-order template.
Click on it to open.
Find the RTML expression WHEN @availability.
Click on @availability.
Click the “New” button and create a NONEMPTY operator. Then click “Replace”. As a result, the NONEMPTY RTML operator will replace the original @availability expression.
Click the “EDIT” button and set the value of NONEMPTY operator to @custom-availability
WHEN NONEMPTY @custom-availability
Find the RTML expression STRING-APPEND:
TEXT STRING-APPEND GRAB TAG tag "em" TEXT "Availability: " @availability
We have to replace @availability property with @custom-availability. For this purpose click on the STRING-APPEND operator and then click the EDIT button. Change @availability to @custom-availability and click update:
WHEN NONEMPTY @custom-availability DIV class "itemavailable" TEXT STRING-APPEND GRAB TAG tag "em" TEXT "Availability: " @custom-availability
Finally, define the custom property @custom-availability (type text) at the item page or at the item type and fulfill it with its necessary value.
In an RTML Template the “APPEND” operator looks like:
This operator joins all sequences pasted within.
NOTE You cannot paste a text string within APPEND operator because it will result in RTML error.
WITH= variable bestsellers-ids-together value APPEND @local-bestsellers-ids @global-bestsellers-ids TEXT bestsellers-ids-together
In this example, we combine two ID sequences. Then we write the resulting sequence into the text spot.
In an RTML Template the “ACTION” operator looks like:
This operator returns a special Yahoo Store URL that will perform a certain action. The possible arguments are :
:email (returns argument mailto: and the e-mail address from the email global variable),
:help (returns http://stores.yahoo.com/help.html),
:search (returns search page URL), and
:show-order (returns Yahoo basket URL).
FORM destination ACTION :show-order method "post"
In the Yahoo Store RTML Template a newly created “>=” operator looks like:
This operator compares two numbers. If the first argument is greater or equal to the second one, then the operator returns “true”.
In this example the operator “>=” checks a loop property “pos”. The loop continues to work as long as the “pos” value is greater or equal to zero.
In a Yahoo Store RTML Template a newly created “<=” operator looks like:
This operator compares two numbers. If the first argument is less than or equal to the second one, then operator returns “true”.
This operator could be used in combination with “IF“, “FOR” and “WHEN” operators.
In this example, the operator “<=” checks a loop property “pos“. The loop continues its work as long as the “pos” value is less or equal to 10.
By default, the Yahoo store system does not include a quantity box on its store pages. After a few changes in the RTML template it will be possible to apply this feature, and customers will then have the possibility to order more than one item.
First, make sure you have editable copies of your store RTML templates.
Find the template that corresponds to adding the items to the shopping cart. Because it is a copy of a default template called add-to-cart, it will be named something such as, your-store-add-to-cart. Click and open it.
Now you will see the template content. At this point, we recommend you make a copy of your existing template by clicking the Copy Template button (just in case if you need to restore it).
At the top of the template content click the operator “IF”. It will become active (not linked, black colored).
Click the button [NEW] at the toolbar. There you will see a selection field called “Complex”, scroll within it to find the operator “INPUT”.
Click the button [CREATE]
The newly created operator will appear in the “basement” area, below the template content. We need to place it before the recent operator IF.
Now, “IF” is active. “INPUT” is in the basement. Click the button [Replace] in the toolbar. These operators will then rotate their places: “IF” will go to the basement area, “INPUT” will become the first operator (active). Now click the button [Paste After] and then “IF” will be replaced after the “INPUT”.
The last step is to customize the operator “INPUT”.
Click it to make it active. Click the button [EDIT] in the top toolbar. Define the following values:
Name – :vwquantity
type – :text
value – 1
maxlength – 3
size – 3
All done. The quantity box will now appear at your store item pages.