There are parameters you can add to zen_image() to specify the size... I will have to look up an example. I have other stuff to do now - be back later.
There are parameters you can add to zen_image() to specify the size... I will have to look up an example. I have other stuff to do now - be back later.
The image code used in the shopping cart page:You could apply it in the cart header asPHP Code:
zen_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], IMAGE_SHOPPING_CART_WIDTH, IMAGE_SHOPPING_CART_HEIGHT)
PHP Code:
zen_image(DIR_WS_IMAGES . $cart_header_products[$item]['image'], $cart_header_products[$item]['name'], IMAGE_SHOPPING_CART_WIDTH, IMAGE_SHOPPING_CART_HEIGHT)
Glenn,
Your'e a Rock Star!
It works great. The shopping cart image was a little too big so I substituted SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT. Check out my site.
This is exactly what I was hoping for. Now that it is dialed in, I have a few more questions.
Is there a way to limit the number of products to display in the dropdown? I make my sites on an HP laptop. If I place more than 5 products in the shopping cart the dropdown reaches the bottom of the screen. If I add 6 or more products to the shopping cart the dropdown extends below the screen and the checkout button is not visible. Is there a way to limit the array(?) to four products and create a fifth item or output that says "More..."?
Can you help with adding the product attributes? I looked at the shopping cart to see how it is done, but cannot figure out how to adapt it to your plugin.
Thanks again!
Hi Glenn & JackOlive
I was following your conversations as I was looking to do exactly what jackolive was doing. Thank you Glenn for the solution that you have provided jackolive as it helped me as well. I was able to get an image of the product in the shopping cart drop down that I created, however - when I add more than 1 product and try to hover over the shopping cart link on the menu, the images and product titles, prices etc. are all over the place. Is there a way in CSS to control multiple products to display side by side? I tried searching on these forums as well as google but I can't seem to figure it out. Any help or direction will be appreciated.
Edited: I can't seem to provide the link to my production site as it is being built to sell adult novelties. If either of you can help, I can PM you the site link.
http://www.kinkykupid.com. WARNING: Please note that this site is intended to sell Adult Toys, Novelties and Costumes. Please do not click the link if you may find it offensive.
Is it not the site in your sig? If the forum obfuscates the actual link text, you can add spaces to break up the words.
It should be possible to alter the layout with CSS to fit whatever you want; some rearrangements may require moving PHP code to change output order.
Yes, you can add a bit inside the for() loop.Is there a way to limit the number of products to display in the dropdown?
Add to your define filePHP Code:
//bof products
$cart_header_products = $_SESSION['cart']->get_products();
echo '<div id="cartProducts">';
for ($item=0; $item<sizeof($cart_header_products); $item++) {
echo '<a href="' . zen_href_link(zen_get_info_page($cart_header_products[$item]['id']), 'products_id=' . $cart_header_products[$item]['id']) . '"><span class="cartProdImage">' . zen_image(DIR_WS_IMAGES . $cart_header_products[$item]['image'], IMAGE_SHOPPING_CART_WIDTH, IMAGE_SHOPPING_CART_HEIGHT) . '</span><span class="cartProdQty">' . CART_PRODUCT_QTY_PRE . $cart_header_products[$item]['quantity'] . CART_PRODUCT_QTY_POST . '</span><span class="cartProdTitle">' . $cart_header_products[$item]['name'] . '</span></a>' . "\n";
if ($item >= 3) { //adjust to suit
echo '<a href="' . zen_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">' . CART_HEADER_MORE . '</a>';
$item = sizeof($cart_header_products);
}
}
echo '</div>';
//eof products
Tested on my local site.PHP Code:
define('CART_HEADER_MORE', 'More...');
Hi Glenn
The site in my signature is all set. I'm working on a new site for myself where I'm trying to add this functionality. The new site where I'm having this issue can be seen at www dot just - d i l d o.com / zencart. ** NOTE ** Site is being designed to sell adult novelty items.
Add to your stylesheet
Code:#cartProducts>a {display: block; float: left; max-width: 12em; margin-right: 1em;}
Wow. Thank you for the quick response and solution.
http://www.kinkykupid.com. WARNING: Please note that this site is intended to sell Adult Toys, Novelties and Costumes. Please do not click the link if you may find it offensive.
where is the mod for this?
Ignore this I found it here http://www.zen-cart.com/downloads.php?do=file&id=990
Sorry
Last edited by Kevin205; 17 Jan 2013 at 09:12 AM.
Using Zen Cart 1.5.1
Bookmarks