Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Attribute Image in Cart [not product image]

Attribute Image in Cart [not product image]

Locked

Views: 3,289

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
29 Sep 2009, 1:33 AM
#1
corygatz avatar

corygatz

New Zenner

Join Date:
Sep 2009
Posts:
71
Plugin Contributions:
0

Attribute Image in Cart [not product image]

I am just wondering if it is possible in version 1.3.8 to have the Attribute image appear in the shopping cart, and not the product image. It is causing some confusion on my site due to the fact I have a color change in my product that is done by an attribute that does not show up when added to the cart.

I have searched high and low and have come up with nothing on this topic except for dead ends. :frusty: Please let me know either way.

If you would like to take a peak at what I have, the site I am working on is https://www.alsliquor.com

Thanks in advance for any help.

29 Sep 2009, 4:54 PM
#3
corygatz avatar

corygatz

New Zenner

Join Date:
Sep 2009
Posts:
71
Plugin Contributions:
0

Re: Attribute Image in Cart [not product image]

I am sorry to post in different areas, but I was finding it hard to get someone to reply (probably my fault).

As for DrByte's Post; I didn't know the answer was "it can be done, it just not simple." I will take it however that this task will not be able to be acomplished by myself. Thank you for your time Kobra.

30 Sep 2009, 7:36 AM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Attribute Image in Cart [not product image]

I didn't know the answer was "it can be done, it just not simple." I will take it however that this task will not be able to be acomplished by myself.
If important to your idea of your cart - - You might post in the commercial help wanted area and be VERY specific about what you want.
You can then make a business decision based on the estimated costs you receive

30 Sep 2009, 2:15 PM
#5
corygatz avatar

corygatz

New Zenner

Join Date:
Sep 2009
Posts:
71
Plugin Contributions:
0

Re: Attribute Image in Cart [not product image]

Great, Thanks Kobra.

14 Nov 2009, 12:54 PM
#7
makenoiz avatar

makenoiz

Zen Follower

Join Date:
Mar 2006
Posts:
284
Plugin Contributions:
0

Re: Attribute Image in Cart [not product image]

This is what has worked for me. Please back up your files. I cant guarantee this will work for you.

includes/module/pages/shopping_cart/header_php.php <<<<<<<<<<<<<<
line 93 for me:
change

$attributes = "SELECT popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix 

to

$attributes = "SELECT popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pa.attributes_image

line 123 for me:
after

$attrArray[$option]['price_prefix'] = $attributes_values->fields['price_prefix'];

Add:

$attrArray[$option]['attributes_image'] = $attributes_values->fields['attributes_image']; 

templates/template_default/templates/tpl_shopping_cart_default.php <<<<<<<<<<<<<<

change line 85 from (line 85 for me)

<a href="<?php echo $product['linkProductsName']; ?>"><span id="cartImage" class="back"><?php echo $product['productsImage']; ?></span><span id="cartProdTitle"><?php echo $product['productsName'] . '<span class="alert bold">' . $product['flagStockCheck'] . '</span>'; ?></span></a>

to

<a href="<?php echo $product['linkProductsName']; ?>"><span id="cartProdTitle"><?php echo $product['productsName'] . '<span class="alert bold">' . $product['flagStockCheck'] . '</span>'; ?></span></a>

line 89 for me:
before:

echo  $product['attributeHiddenField']; 

ADD:

if (isset($product['attributes']) && is_array($product['attributes'])) {
echo '';
 	  
}else {
 	?><span id="cartImage" class="back"><?php echo $product['productsImage']; ?></span><?PHP
}

line 101 for me:
directly after

foreach ($product['attributes'] as $option => $value) {

add

echo zen_image(DIR_WS_IMAGES . $value['attributes_image'], $products[$i]['name'], IMAGE_SHOPPING_CART_WIDTH, IMAGE_SHOPPING_CART_HEIGHT);	
25 Nov 2009, 3:16 PM
#8
corygatz avatar

corygatz

New Zenner

Join Date:
Sep 2009
Posts:
71
Plugin Contributions:
0

Re: Attribute Image in Cart [not product image]

Thank you so much MakeNoiz! That worked great for me. However you have created more work for me in having to go back and edit previous carts I have set up (not a bad thing at all). Thanks Again.

Cory