Zen Cart Logo
Forums / General Questions / Where does this CRAZY encrypted number come from?

Where does this CRAZY encrypted number come from?

Locked

Views: 1,203

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
3 Dec 2008, 6:51 PM
#1
dmfelder avatar

dmfelder

Zen Follower

Join Date:
Nov 2006
Posts:
102
Plugin Contributions:
0

Where does this CRAZY encrypted number come from?

I use the attribute image changing routine. Everything works great until I add an item to my cart and then click my cart link to return to the product. The problem is a bit of code that becomes embedded in my page after the add.

<select name="id[3]" id="attrib-3" onchange="getattribimage('id[2]',270,270, this.value,3:61a814e571cc23679040247e4fa9615f);">

What is the information following the "3:"? Is it a cart session? Is it critical?

3 Dec 2008, 7:01 PM
#2
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Where does this CRAZY encrypted number come from?

It is critical, think of it as the "id" of the attributes chosen.

3 Dec 2008, 7:06 PM
#3
dmfelder avatar

dmfelder

Zen Follower

Join Date:
Nov 2006
Posts:
102
Plugin Contributions:
0

Re: Where does this CRAZY encrypted number come from?

Thank you. But...if I remove it from the link in the shopping cart (back to the product page), it will still function, correct?

Based on some A/B testing, it looks like this crazy number is messing up my javascript (probably the colon). I can remove it FROM THE CART LINK ONLY and I think the cart will still function properly. Correct?

I am currently looking at parsing the right side after the colon.

THANKS!

3 Dec 2008, 10:00 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Where does this CRAZY encrypted number come from?

The entire number including the colon and hash after the colon are important if someone is attempting to edit the actual items already in the shopping cart. If you don't want to let them do that, feel free to remove the colon and hash.

But wouldn't it be better instead to url-encode the colon from within your script that's breaking things?

3 Dec 2008, 10:40 PM
#5
dmfelder avatar

dmfelder

Zen Follower

Join Date:
Nov 2006
Posts:
102
Plugin Contributions:
0

Re: Where does this CRAZY encrypted number come from?

I think you're probably correct about coding, but once I realized the link was NOT relative and there were two colons in the address (the full string actually includes the http://), I decided to simply customize the code and link back to the product category anyway.

In case anyone is interested, use this line to link back to the category from the shopping cart product.

<a href="index.php?main_page=index&cPath=<?php echo zen_get_products_category_id($product['id']);?>"><span id="cartImage" class="back"><?php echo $product['productsImage']; ?></span><span id="cartProdTitle"><?php echo zen_get_categories_name_from_product($product['id']) . ' - ' . zen_get_products_description($product['id']) . ' ' . $product['productsName'] . '<span class="alert bold">' . $product['flagStockCheck'] . '</span>'; ?></span></a>

What I'm curious about now is how to show an attribute-specific image in the cart. In my case, I have a "red" shirt image tied to the attribute "red". It displays the correct image when I select the attribute, but it displays the base image in the cart. Any thoughts?