Help with jquery to modify SCC - Page 2

User 187934 Photo


Senior Advisor
20,181 posts
Online Now

After looking at your page ever item has the scs_stocksold class in it.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2062767 Photo


Registered User
166 posts

No it doesn't, only the 1st & last. The 2nd has a "scs_viewdetails_wrapper" class.
www.heylisflorist.co.uk - My Florist Shop.
www.woodentopstoys.co.uk - My Wooden Toy Shop.

I use CoffeeCup HTML Editor, WIS, Direct ftp, Sitemapper, Website Insite & RED Personal to create my websites.

Send your parcels with Despatch Bay! Signup using this code and get £10.00 worth of free shipping http://despatchbaypro.com/s/1H431
User 187934 Photo


Senior Advisor
20,181 posts
Online Now

I just copied your html from your cart after a hard refresh.
Here is the page with jQuery setting the background color to all the .scs_stocksold to red. All but one has it.
http://ericrohloff.com/coffeecup/ccforu … test2.html
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2062767 Photo


Registered User
166 posts

Eric, I don't want all the scs_stocksold to be the same that is the point. I want each of them to have a unique href copied from their sibling (the href containing the productid).
So that the scs_stocksold element has a link pointing to the relevent view product page the same as the image. My code returned the 1st href to all items. I need them to loop through down the list.
www.heylisflorist.co.uk - My Florist Shop.
www.woodentopstoys.co.uk - My Wooden Toy Shop.

I use CoffeeCup HTML Editor, WIS, Direct ftp, Sitemapper, Website Insite & RED Personal to create my websites.

Send your parcels with Despatch Bay! Signup using this code and get £10.00 worth of free shipping http://despatchbaypro.com/s/1H431
User 187934 Photo


Senior Advisor
20,181 posts
Online Now

Ok, I didn't touch the .prepend part. That's what you need help with?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 187934 Photo


Senior Advisor
20,181 posts
Online Now

Try this
This will wrap the .scs_stocksold in a link which has the href of the product id.
<script>
$(document).ready(function(){
$(".scs_thumbnail_wrapper").each(function(){
href = ($(this).find("a").attr("href"));
$(this).next().find(".scs_stocksold").wrap("<a href='"+href+"'></a>");
});
$(".scs_stocksold").css('background-color', 'red');
});
</script>
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2062767 Photo


Registered User
166 posts

Perfect :D Thank you Eric ;)
Take a look at it live: http://www.woodentopstoys.co.uk/shop/viewcategory.php?groupid=344
Hover over buttons, click on an "Order Now" & add to basket to see where it takes you :cool:(the clue is in the URL)
The "Get it fast" items are in stock.
The "Order Now" items are sold out.
www.heylisflorist.co.uk - My Florist Shop.
www.woodentopstoys.co.uk - My Wooden Toy Shop.

I use CoffeeCup HTML Editor, WIS, Direct ftp, Sitemapper, Website Insite & RED Personal to create my websites.

Send your parcels with Despatch Bay! Signup using this code and get £10.00 worth of free shipping http://despatchbaypro.com/s/1H431
User 187934 Photo


Senior Advisor
20,181 posts
Online Now

Great, Glad I could help
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.