Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / display product attributes on checkout payment page

display product attributes on checkout payment page

Views: 3,967

Results 21 to 40 of 40
17 Feb 2012, 7:58 PM
#21
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

display product attributes on checkout payment page

You are pulling the Product Image ...

the attribute image should be something line:
zen_image(DIR_WS_IMAGES . $value['attributes_image'])

17 Feb 2012, 9:01 PM
#22
gokeypa avatar

gokeypa

New Zenner

Join Date:
Sep 2011
Posts:
86
Plugin Contributions:
0

Re: display product attributes on checkout payment page

I do not Have that in tpl_shopping_cart_default.php

The only code that comes close on the page is

</td> <td class="cartProductDisplay"> <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> <br class="clearBoth" /> <?php echo $product['attributeHiddenField']; if (isset($product['attributes']) && is_array($product['attributes'])) { echo '<div class="cartAttribsList">'; echo '<ul>'; reset($product['attributes']); foreach ($product['attributes'] as $option => $value) { ?>
17 Feb 2012, 10:32 PM
#23
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: display product attributes on checkout payment page

Do you have the code that you posted in post #2 in the:
/includes/modules/shopping_cart/header_php.php

17 Feb 2012, 11:30 PM
#24
gokeypa avatar

gokeypa

New Zenner

Join Date:
Sep 2011
Posts:
86
Plugin Contributions:
0

Re: display product attributes on checkout payment page

I did NOT add that code, because you did not mention it so I thought that it would not work in ver 1.3.9, I can certainly add it if you say it is ok.

17 Feb 2012, 11:48 PM
#25
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: display product attributes on checkout payment page

You need that code so that you can get the attribute image ...

18 Feb 2012, 12:33 AM
#26
gokeypa avatar

gokeypa

New Zenner

Join Date:
Sep 2011
Posts:
86
Plugin Contributions:
0

Re: display product attributes on checkout payment page

I am SOOOO close,

I get the original white image showing and now I get the black attribute image below, then below that a small box saying image not avalable, so I got something wrong some were.

in:tpl_shopping_cart_default.php

line 85: reads:

echo zen_image(DIR_WS_IMAGES . $value['attributes_image'], $products[$i]['name'], IMAGE_SHOPPING_CART_WIDTH, IMAGE_SHOPPING_CART_HEIGHT);

line 89 through 102 reads:

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

}
echo $product['attributeHiddenField'];
if (isset($product['attributes']) && is_array($product['attributes'])) {
echo '<div class="cartAttribsList">';
echo '<ul>';
reset($product['attributes']);
foreach ($product['attributes'] as $option => $value) {echo zen_image(DIR_WS_IMAGES . $value['attributes_image'], $products[$i]['name'], IMAGE_SHOPPING_CART_WIDTH, IMAGE_SHOPPING_CART_HEIGHT);
?>

18 Feb 2012, 12:39 AM
#27
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: display product attributes on checkout payment page

Do you want the Product Image? If not, do not echo it out ...

On the Attribute image, test if:
$value['attributes_image']

is blank, and if so, do not echo it ...

18 Feb 2012, 12:54 AM
#28
gokeypa avatar

gokeypa

New Zenner

Join Date:
Sep 2011
Posts:
86
Plugin Contributions:
0

Re: display product attributes on checkout payment page

I am trying to follow you but, you are about 5000 miles over my head.

I do not want the product image to show if the black top is selected.

18 Feb 2012, 1:14 AM
#29
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: display product attributes on checkout payment page

Find this section of code on the tpl_shopping_cart_default.php

<?php
  echo $product['attributeHiddenField'];
  if (isset($product['attributes']) && is_array($product['attributes'])) {
  echo '<div class="cartAttribsList">';
  echo '<ul>';
    reset($product['attributes']);
    foreach ($product['attributes'] as $option => $value) {
?>

<!-- <li><?php echo $value['products_options_name'] . TEXT_OPTION_DIVIDER . nl2br($value['products_options_values_name']); ?></li> -->
<?php echo ($value['attributes_image'] != '' ? '<li>' . $value['products_options_name'] . TEXT_OPTION_DIVIDER . zen_image(DIR_WS_IMAGES . $value['attributes_image']) . '</li>' : '<li>' . $value['products_options_name'] . TEXT_OPTION_DIVIDER . nl2br($value['products_options_values_name']) . '</li>'); ?>

<?php
    }
  echo '</ul>';
  echo '</div>';
  }
?>

The line in BLUE is the original line of code commented out ...

The line in RED displays the attribute image if it exists ... otherwise just the regular code for the attribute ...

See if that helps you in displaying the Attribute Image ...

18 Feb 2012, 1:27 AM
#30
gokeypa avatar

gokeypa

New Zenner

Join Date:
Sep 2011
Posts:
86
Plugin Contributions:
0

Re: display product attributes on checkout payment page

Ok, I did excatly what you said, and now I have three images (lol)

The original image, the same size black image, and now a little larger black image.

Should I reomve the two images from the attribute controler?

18 Feb 2012, 2:00 AM
#31
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: display product attributes on checkout payment page

If you NEVER want to display the Product Image, try this:

       <td class="cartProductDisplay">
<!-- <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> -->
<a href="<?php echo $product['linkProductsName']; ?>"><span id="cartProdTitle"><?php echo $product['productsName'] . '<span class="alert bold">' . $product['flagStockCheck'] . '</span>'; ?></span></a>
<br class="clearBoth" />

The code in BLUE is the original line ...

The code in RED is the new line to not show the Product Image ...

18 Feb 2012, 3:17 AM
#32
gokeypa avatar

gokeypa

New Zenner

Join Date:
Sep 2011
Posts:
86
Plugin Contributions:
0

Re: display product attributes on checkout payment page

Ok, well I rechecked me code, and I did have a small error, so now I still have the original small white top and below that the little larger black attribute top.

18 Feb 2012, 3:25 AM
#33
gokeypa avatar

gokeypa

New Zenner

Join Date:
Sep 2011
Posts:
86
Plugin Contributions:
0

Re: display product attributes on checkout payment page

Ok, I have the new code you sent and it does hide the original tank. The only thing is that the attribute words below the image says color: then black (ie it does not say anything) It did at one time say black.

Then I need to hide the two new attribute images from the product page, I know you sent the code to add to the style sheet, but should I add the style control to the prodcut page?

18 Feb 2012, 3:39 AM
#34
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: display product attributes on checkout payment page

Did you try the code for the stylesheet to see if it acheived the desired look?

18 Feb 2012, 3:45 AM
#35
gokeypa avatar

gokeypa

New Zenner

Join Date:
Sep 2011
Posts:
86
Plugin Contributions:
0

Re: display product attributes on checkout payment page

I did and I forgot to refresh the page after adding it so now the attribute images are NO longer showing on the product page :clap:

Do you think we could add the text back to the shopping cart saying the attribute color?

BY the way, you have done an amazing job in fixing the issue and in putting up with a total beginner.

18 Feb 2012, 4:13 AM
#36
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: display product attributes on checkout payment page

I believe you just need to add in there:
$value['products_options_values_name']

18 Feb 2012, 4:16 AM
#37
gokeypa avatar

gokeypa

New Zenner

Join Date:
Sep 2011
Posts:
86
Plugin Contributions:
0

Re: display product attributes on checkout payment page

that is in there, this is the line of code:

<?php echo ($value['attributes_image'] != '' ? '<li>' . $value['products_options_name'] . TEXT_OPTION_DIVIDER . zen_image(DIR_WS_IMAGES . $value['attributes_image']) . '</li>' : '<li>' . $value['products_options_name'] . TEXT_OPTION_DIVIDER . nl2br($value['products_options_values_name']) . '</li>'); ?>

Do you think the image could be over lapping the color name?

18 Feb 2012, 4:30 AM
#38
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: display product attributes on checkout payment page

That is in the IF where if there is NO Attribute Image it shows the name ... IF there IS an Attributes Image it shows the attribute image ...

If you want the name you need to have it on both parts of that ...

18 Feb 2012, 4:33 AM
#39
gokeypa avatar

gokeypa

New Zenner

Join Date:
Sep 2011
Posts:
86
Plugin Contributions:
0

Re: display product attributes on checkout payment page

Yup that did it.

THANK YOU SO MUCH:smile:

18 Feb 2012, 4:49 AM
#40
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: display product attributes on checkout payment page

Glad that you have everything working now ... :smile: