You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
I want to change the product display for the Category View to show the Image, Title, Quantity, and Add to Cart (with options), and with NO description.
I have looked at:
ClickCartPro > Displays: Skins, Menus, XHTML Includes and Messages > Manage Catalog Product Displays: Category View
Out of the 5 Display choices listed, I can't find one that doesn't also display the description along with the Add button.
Do I need to create a new Product Display? I thought about cloning the 'With Add Button' display, and removing the part in the code that prints the description, but I can't seem to find it in there. (I probably don't know what to look for.)
I appreciate any help with this.
Thanks,
Cyndi
Offline
I created this category display: http://www.thepictureframingexperts.co. … ccessories
The code is:
<?php // +-- // | Get variables we need to draw this display. // +-- $app = $this->globals('khxc.app'); $eol = $this->globals('khxc.eol'); $proddisp = $this->globals('ecom.prod_proddisp'); $id = $proddisp['id']; $formid = $app . '--prodaddtocartX--' . $id; $quanid = $formid . '--quantity'; $this->globals('ecom.prod_priceinfo',$proddisp['khxc.priceinfo']); // +-- // | Set our add_ok flag. // +-- $add_ok = 1; if (($proddisp['useinv']) && (!($proddisp['invlevel'] > 0))) {$add_ok = 0;} if ($proddisp['pricestatus'] == 'D') {$add_ok = 0;} // +-- // | Create the product name and link. // +-- $prodname = $this->xhtml_encode($proddisp['name']); $proddesc = $this->xhtml_encode($proddisp['descshort']); $prodlink = $this->link_namespace($app,'prodshow',$proddisp['id']); // +-- // | Create the image tag. // +-- $imgname = $proddisp['imgsm']; if (empty($imgname)) {$imgname = 'none.png';} $imgwidth = $this->globals('khxc_settings.' . $app . '.imgsizeprodsm'); $imgurl = 'media/' . $app . '/prodsm/' . $imgname; $imgtag = '<img src="' . $imgurl . '" '; if ($imgwidth) {$imgtag .= 'width="' . $imgwidth . '" ';} $imgtag .= 'alt="' . $prodname . '" />'; // +-- // | Print the display. // +-- if (empty($imgwidth)) {$imgwidth = 100;} ?> <table class="khxc_ghost"><tr><td class="khxc_ghost" style="width: <?php print $imgwidth; ?>px; text-align:center;"> <a href="<?php print $prodlink; ?>" title="<?php print $prodname; ?>"><?php print $imgtag; ?></a> <p><a href="<?php print $prodlink; ?>" title="<?php print $prodname; ?>"><?php print $prodname; ?></a></p> <?php $this->include_file($app,'pricedisp.php'); ?> <?php if ($add_ok) { ?> <?php $this->xhtml_quickform_header($formid,$app,'addcart',array()); ?> <?php $this->include_namespace($app,'prodshowoptlite',array('form' => $formid, 'showquan' => 1, 'headfoot' => 0)); ?> <?php $this->xhtml_quickform_footer($formid,'Add To Cart',1); ?> <?php } ?> </td></tr></table>
Is that what you require??
Rob
Offline
Rob, thanks so much for the code! There's one thing I should have mentioned in my original post: I am using Product Multi-Add Indicator set to True, so that customers can put in a quantity by each item, then click the Add to Cart button at the bottom of the list.
Would your code above need to be altered to allow for the Product Multi-Add?
Thanks,
Cyndi
Offline
Rob, I created a new Product Display, Category View using your code in Post #2. However, it did not change the product display when viewing a category. The short description is still displayed, and I don't want any description at all, just the image, title, and options.
I looked at your link in your post #2, and I did not see any description, which is what I want to do. I just need to be able to use that display with the Product Multi-Add so there is only one Add to Cart button at the bottom of the list.
Maybe I did something wrong?
Cyndi
Last edited by posnpretty (09-28-2008 04:19:39)
Offline
Hi
If it is themulti add display you want to change you will need to edit the Product Multi Add Display include here:
Home > ClickCartPro (GBU) > Displays: Skins, Menus, XHTML Includes and Messages > Manage XHTML Includes
I don't use the multi add and have never edited it.
Regarding your last post - You will have to go back into the category via MANAGE ONLINE CATEGORIES and change the product display type to your newly created display for the changes to take effect.
Rob
Offline
zanart wrote:
If it is themulti add display you want to change you will need to edit the Product Multi Add Display include here:
Home > ClickCartPro (GBU) > Displays: Skins, Menus, XHTML Includes and Messages > Manage XHTML Includes
Okay, I checked the Product Multi-Add Display Include, and there is a line to print the product short description. I found it within this If statement:
print '<td class="' . $tdclass . '">'; print '<p><a href="' . $prodlink . '" title="' . $prodname . '">'; print $prodname . '</a></p>' . $eol; if (!(empty($proddesc))) {print '<p>' . $proddesc . '</p>' . $eol;} $this->globals('ecom.prod_proddisp',$prod); $this->globals('ecom.prod_priceinfo',$prod['khxc.priceinfo']); $this->include_file($app,'pricedisp.php'); if ($add_ok) { $this->include_namespace($app,'prodshowoptlite',array('form' => $formid . '--' . $prodid, 'showquan' => 0, 'headfoot' => 0)); } // End of if statement.
Do you know if I can just delete this one line?
if (!(empty($proddesc))) {print '<p>' . $proddesc . '</p>' . $eol;}
Or, do I need to change something else in the code?
Regarding your last post - You will have to go back into the category via MANAGE ONLINE CATEGORIES and change the product display type to your newly created display for the changes to take effect.
I did go back into the Category via Manage Online Categories and changed to the new Product Display type that I created. However, since I am using the Multi-Add display, it must override any display settings in the Category.
Now I just need to know how to correctly edit the Multi-Add include to not display the short descriptions for my products.
Thanks,
Cyndi
Offline
Followup:
I commented out one line in the Product Multi-Add Display include, like this:
//Remove the # in front of the line below to show product short description #if (!(empty($proddesc))) {print '<p>' . $proddesc . '</p>' . $eol;}
It appears to be working; at least the description is no longer showing for the product list in Category View, and I was able to add an item to the cart. Hopefully, I didn't mess anything else up with this change!
Cyndi
Last edited by posnpretty (09-28-2008 05:25:30)
Offline
The best way to learn is to keep trying different things - just make sure you've keep a backup of the original code
Offline
zanart wrote:
The best way to learn is to keep trying different things - just make sure you've keep a backup of the original code
Thanks, Rob! I use Notepad a LOT, saving the original code and then editing in a separate Notepad file. I tried using Dreamweaver, but it kept changing the coding, even though I selected in the program to NOT change php codes.
Thanks again for your help!
Cyndi
Last edited by posnpretty (09-28-2008 06:08:29)
Offline