Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Could someone check my code?


JemCraft

Recommended Posts

Please couldsomeone check the code below for meand see where I am going wrong?

 

I am trying to get the words 'Pink Koala also available' to show up blue in the first instance, then red when someone clicks on it, then purple to show it's been clicked.

 

<a href=\"http://jemcraftmemories.com/shop/product_info.php?cPath=21_29&products_id=31&osCsid=fe8f2b3cb5cec43769d455ac434588ae/\"><font size=4><b><body text=#000000 link=#0066FF vlink=#FF0000 alink=#663300>Pink Koala also available.<b></font></a>

 

Any help gratefully received.

Thanks

Jemma

Link to comment
Share on other sites

Please couldsomeone check the code below for meand see where I am going wrong?

 

I am trying to get the words 'Pink Koala also available' to show up blue in the first instance, then red when someone clicks on it, then purple to show it's been clicked.

 

Hi there

 

I was under the impression that if you set it in the stylesheet, it would do this for you on all products.

Link to comment
Share on other sites

Yes, this should be handled via the stylesheet. Add a class for this link, or all links if you prefer, and make set the colors there:

a.yourLink {
 color: #000000;
 text-decoration: none;
}

a:visited.yourLink {
 color: #00ff00;
 text-decoration: none;
} 
a:hover.yourLink { 
 color: #ff0000;
 text-decoration: none;
}

then use it as

<a class="yourLink" href=\"http://jemcraftmemories.com/shop/product_info.php?cPath=21_29&products_id=31">Pink Koala also available.</a>

BTW, you shouldn't include SID's in links or your code will not always work. Also, the above code is not the proper way to make a link to a page on your site (for the same reason). Use something like

<?php echo '<a class="yourLink" href="' . tep_href_link('product_info.php', 'cPath=21&osCsid=c31', 'NONSSL') . '">' . 'Pink Koala also available' . '</a>'; ?>

Change yourLink to whatever name you wish. Add bold, color and text choices to the class as you like.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hmm, I thought I sort of understood, so tried the following:

 

A {

color: #0066FF;

text-decoration: underline;

}

 

A:hover {

color: #FF0000;

text-decoration: underline;

}

 

V {

color: #663300;

text-decoration: underline;

}

 

 

I'm obviously going wrong somewhere .... but where???

 

Thanks

Jemma

Link to comment
Share on other sites

Yes, this should be handled via the stylesheet.  Add a class for this link, or all links if you prefer, and make set the colors there:
a.yourLink {
?color: #000000;
?text-decoration: none;
}

a:visited.yourLink {
?color: #00ff00;
?text-decoration: none;
} 
a:hover.yourLink { 
?color: #ff0000;
?text-decoration: none;
}

then use it as

<a class="yourLink" href=\"http://jemcraftmemories.com/shop/product_info.php?cPath=21_29&products_id=31">Pink Koala also available.</a>

BTW, you shouldn't include SID's in links or your code will not always work.  Also, the above code is not the proper way to make a link to a page on your site (for the same reason). Use something like

<?php echo '<a class="yourLink" href="' . tep_href_link('product_info.php', 'cPath=21&osCsid=c31', 'NONSSL') . '">' . 'Pink Koala also available' . '</a>'; ?>

Change yourLink to whatever name you wish. Add bold, color and text choices to the class as you like.

 

Jack

 

 

Err, thinkhavemade another mistake! Changed the bit in stylesheet to code below, will that work?

 

a: {
color: #0066FF;
text-decoration: underline;
}

a:visited {
color: #FF0000;
text-decoration: underline;
} 
a:hover { 
color: #663300;
text-decoration: underline;
}

 

Also don't quite understand the code you gave me to put in the description box for the item.

 

<?php echo '<a class="yourLink" href="' . tep_href_link('product_info.php', 'cPath=21&osCsid=c31', 'NONSSL') . '">' . 'Pink Koala also available' . '</a>'; ?>

 

Pasted this code as is onto the description page and nothing appeared on the preview page. Changed the "yourLink" to Pink Koala also available, still nothing appeared. Which bit should I be adding the words to in order for them to appear???

 

As you can see am very new at this and head bout to explode!!!

 

Thanks

Jemma

Link to comment
Share on other sites

 

When you are using a standard html link like the above there is no need to start it with a backslash in front of the double inverted commas, as in \"http:// just write <a class="yourLink" href="http://jemcraftmemories.com/shop/product_info.php?cPath=21_29&products_id=31">Pink Koala also available.</a>

 

Vger

Link to comment
Share on other sites

Hmm, I thought I sort of understood, so tried the following:

 

A {

  color: #0066FF;

  text-decoration: underline;

}

 

A:hover {

  color: #FF0000;

  text-decoration: underline;

}

 

V {

color: #663300;

text-decoration: underline;

}

I'm obviously going wrong somewhere .... but where???

 

Thanks

Jemma

What is the V class for?

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Err, thinkhavemade another mistake!  Changed the bit in stylesheet to code below, will that work?

 

a: {
color: #0066FF;
text-decoration: underline;
}

a:visited {
color: #FF0000;
text-decoration: underline;
} 
a:hover { 
color: #663300;
text-decoration: underline;
}

 

Also don't quite understand the code you gave me to put in the description box for the item.

Pasted this code as is onto the description page and nothing appeared on the preview page.  Changed the "yourLink" to Pink Koala also available, still nothing appeared.  Which bit should I be adding the words to in order for them to appear???

 

As you can see am very new at this and head bout to explode!!!

 

Thanks

Jemma

No, the way I had it is correct. When you changed it, you changed the class for all of the anchors in your shop. That's fine if that is what you want but I thought you just wanted it changed for this one item. In that case, you need to do as I suggested. As for the link, if you are placing right into the page, place it in a cell:

<tr><td><?php echo '<a class="yourLink" href="' . tep_href_link('product_info.php', 'cPath=21&osCsid=c31', 'NONSSL') . '">' . 'Pink Koala also available' . '</a>'; ?></td></tr>

Don't use the standard html link since it will not work properly and cause you to lose session ID's. The above will work. If not, paste your code here (the whole page) so I can see in context what you are trying to do.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

When you are using a standard html link like the above there is no need to start it with a backslash in front of the double inverted commas, as in \"http://      just write <a class="yourLink" href="http://jemcraftmemories.com/shop/product_info.php?cPath=21_29&products_id=31">Pink Koala also available.</a>

 

Vger

 

Could you tell me how I would find out the 'products_id' for different products, in case I wish to use this again? Would it just be the product_id number that would need to change?

 

Thanks

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...