| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Age Calculation | ||||
|
|
Thread Tools | Search this Thread |
#31
|
|||||||
|
|||||||
Re: Age Calculation
Code:
There you go. There is no forms in that and it's text based. You can customize what it says at the bottom. Anything between the <span></span> tags are from the script so you can change anything outside of that. You'll probably need to change the order for which the age is though. At the top with the smarty variables, I have it as 1 0 2. If that works, you'll want to put the script in an actual external .js file so the browser can cache it. Faster load times and less bandwith. The " He is <span id="dAge">5 months</span> old" shouldn't be in a .js file though. |
|||||||
#32
|
|||||||
|
|||||||
Re: Age Calculation
THANKS TAL!!! That's awesome!!! I'm extremely grateful!!!
__________________
X-Cart 4.3 Joomla Among other things |
|||||||
#33
|
|||||||
|
|||||||
Re: Age Calculation
TAL,
I was wondering about making it say "Sku" is <span id="dAge">5 months</span> old" Here's what I was trying, but I got nothing. <span id="product.productid"></span> is <span id="dAge">5 months</span> old
__________________
X-Cart 4.3 Joomla Among other things |
|||||||
#34
|
|||||||
|
|||||||
Re: Age Calculation
the spanId is simply used to let the script know where to replace text.
Code:
As you can see, it has dAge in there. So everything in the dAge ID will be replaced by the output of the script, which happens to be the age. If it can't get a value, it'll just say as "5 months". If you want to show something like "Junior (SKU name) is X old" then it would be this as the HTML/smarty part: Code:
If you wish to style the name of the puppy you can add its own class/id such as this: Code:
Then you just need to add something like this in your css: Code:
|
|||||||
#35
|
|||||||
|
|||||||
Re: Age Calculation
Thanks Tal.
I was trying to input some logic in the final calc. His puppies are often after less than a year old, so it's not necessary to include the year calc. I was trying the following, but it's not working right Code:
__________________
X-Cart 4.3 Joomla Among other things |
|||||||
#36
|
|||||||
|
|||||||
Re: Age Calculation
That's a bit confusing.
Your first statement is checking the years, then your second is checking the months. It's also not an ifelse statement which would be more logical. In any case... Code:
Tested and works. |
|||||||
#37
|
|||||||
|
|||||||
Re: Age Calculation
Awesome Tal!!
So now I'm trying to put the age on the products_list.tpl I just inserted: Code:
Below: Code:
However it only shows " Junior is 5 months old" And does the same for all dogs, except the name is different. http://littlepuppiesonline.msidesigns.com/home.php?cat=10
__________________
X-Cart 4.3 Joomla Among other things |
|||||||
#38
|
|||||||
|
|||||||
Re: Age Calculation
Quote:
That's because the extra field variables are not available in the category display. You'll have to have someone else help you with that. |
|||||||
|
|||
X-Cart forums © 2001-2020
|