| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Can anyone help in simple Javascript | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Can anyone help in simple Javascript
I want to change
product_details.tpl to display the content something like this, product details below all the code would be held in the Detailed description: and where the (see more) bit is would call the labels for the extra text that's required. ------------------------------------------------------------- Sample full description We make blah blah blah This product is a wonderful unit. It works very well see more... The range of colours you can get see more... you can get this from the uK see more... --------------------------------------------------------------- Now where the see more... bit is would be Javascript. I want it to work just like the admin maintenance ( see sample below) but all it has to do is just add more text. Check database integrity http://localhost/store/skin/common_files/images/spacer.gif This tool allows you to improve the consistency and quality of data structures in your MySQL database. more... My product details has HTML in it and works well I hope I have made myself clear. Can anyone help Peter
__________________
Version 4.7.2 |
|||||||||
#2
|
|||||||||
|
|||||||||
Re: Can anyone help in simple Javascript
Untested but this might at least point you in the right direction.
HTML Code:
PHP Code:
|
|||||||||
|
#3
|
|||||||||
|
|||||||||
Re: Can anyone help in simple Javascript
Thank you so much Cherie, but my heads spining becuase I have never done Java. Let me show you whats happing
http://kingquick.co.uk/peters_files/forum/java_problem/main_prod_desc.jpg As you will see I have sort of got there, but honestly no idea what I am doing I put the code here http://kingquick.co.uk/peters_files/forum/java_problem/product_details.jpg The result I got http://kingquick.co.uk/peters_files/forum/java_problem/full_product.jpg I am not sure about the "#" sign going in the scrip because I can see the java scrips adds the "#" to the ID Hope you can see better whats happing Very kind regards and thank you Peter
__________________
Version 4.7.2 |
|||||||||
#4
|
|||||||||
|
|||||||||
Re: Can anyone help in simple Javascript
The # in the address at the bottom is normal in this case.
It looks like you are putting the Smarty code directly in the product description and I don't think that's going to work. I recommend leaving descriptions as just descriptions and put the code in the template where you want it to appear. Your onclick link does not look correct. It needs to call the toggle() function with the id it should reveal, such as "moreDescr". |
|||||||||
#5
|
|||||||||
|
|||||||||
Re: Can anyone help in simple Javascript
Cherie
Still cant get this to work, let me explain I have a varable called {$lng.txt_simpletext} and in there is says: This is a simple extra test and the $product.descr says: This is the full description held in prod file So I have to printout the description and as you can see it alows HTML code in it <td class="descr">{eval var=$product.fulldescr|default:$product.descr} Now this is where I cannot get it to work, I changed the "#" to javascript, still no luck. It look as if I am nearly there (see pic) <a href="javascript:" onclick="toggle({$lng.txt_simpletext})">see more</a> <div id={$lng.txt_simpletext}> </div> <script type="text/javascript"> function toggle(id) { $("#"+id).toggle(); return false; } </script> As you can see the {$lng.txt_simpletext} is coming out before I click the "see more" http://kingquick.co.uk/peters_files/forum/java_problem/full_product2.jpg Hope you can help, if you could cut and paste the javascript and fill it in where the varables should go, it would be a great help. I am very greatful for your help. Kind regards Peter
__________________
Version 4.7.2 |
|||||||||
#6
|
|||||||||
|
|||||||||
Re: Can anyone help in simple Javascript
There's no need to change "#". I tested the code in my first post above and made some slight adjustments.
|
|||||||||
#7
|
|||||||||
|
|||||||||
Re: Can anyone help in simple Javascript
http://kingquick.co.uk/peters_files/forum/java_problem/finished.jpg
Look Cherie, looking just as I want it, also I have been able to put the coding in the product description BRILLIANT Thank you so much for your time in helping me, most greatful Kind regards Peter
__________________
Version 4.7.2 |
|||||||||
|
|||
X-Cart forums © 2001-2020
|