The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Adding session ID to end of every link on cart under FoxyCart 2.0?

Within my cart template I have the following...

<div class="product_block">
<div class="image_column">
<a class="add_product" href="https://^^store_domain^^/cart?name=Product Name&price=6.99">
<img src="http://somestore.com/wp-content/images/product-pouch-thumb.jpg">
</a>
</div>
<div class="description_column">
<p class="product_title">Product Name - <span class="product_price">6.99</span></p>
<p>
Product description...blah, blah, blah
</p>
</div>
</div>
Bear in mind that I have changed a number of things in the above code to dummy values but essentially the code outputs a product image with some descriptive text next to it. When a user clicks the product image the relevent Javascript is supposed to attach the session ID to each such product link on the cart so that a quantity of 1 of that product is added to the cart.

Was working well under 0.7.2.

Now under 2.0 it doesn't work at all. When one clicks on the product image the page goes completely blank.

In my Javascript I have the following (which I have modified a bit to hopefully work under 2.0).

FC.client.on('ready.done', function() {
jQuery(document).ready(function() {
jQuery("add_product").each(function() {
jQuery(this).attr("href", jQuery(this).attr("href") + "&fcsid=" + fc_json.session_id);
});
});
});
The javascript above is supposed to add the session ID to every link as described above.

Under 0.7.2 the following code was working fine...

window.onload = function() {
jQuery(document).ready(function() {
jQuery("add_product").each(function() {
jQuery(this).attr("href", jQuery(this).attr("href") + "&fcsid=" + fc_json.session_id);
});
});
}
The 2.0 modifications aren't working at all and I am wondering if someone can give me some input on why they aren't.

Thanks.

Carlos

Comments
Sign In or Register to comment.