Found it.
Open
/public_html/YOURSTORE/includes/templates/YOUR TEMPLATE OVERIDES/templates/tpl_product_info_display.php
Changing text in RED to the path to your template file.
I copied the whole section of add to cart code from
<!--bof Add to Cart Box -->
to
<!--eof Add to Cart Box-->
and pasted it between
<!--eof Category Icon -->
Paste here (as shown in RED below)
<br clear="all" />
<!--bof Main Product Image -->
And I now have two Add to Cart buttons, with this mod there will be one at the top of the page. If you only wanted one, the original code could be removed.
*********************************************
<!--bof Category Icon -->
<?php if ($module_show_categories != 0) {?>
<?php
/**
* display the category icons
*/
require($template->get_template_dir('/tpl_modules_category_icon_display.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_category_icon_display.php'); ?>
<?php } ?>
<!--eof Category Icon -->
<!--bof Add to Cart Box -->
<?php
if (CUSTOMERS_APPROVAL == 3 and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') {
// do nothing
} else {
?>
<?php
$display_qty = (($flag_show_product_info_in_cart_qty == 1 and $_SESSION['cart']->in_cart($_GET['products_id'])) ? '<p>' . PRODUCTS_ORDER_QTY_TEXT_IN_CART . $_SESSION['cart']->get_quantity($_GET['products_id']) . '</p>' : '');
if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
// hide the quantity box and default to 1
$the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
} else {
// show the quantity box
$the_button = PRODUCTS_ORDER_QTY_TEXT . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($_GET['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
}
$display_button = zen_get_buy_now_button($_GET['products_id'], $the_button);
?>
<?php if ($display_qty != '' or $display_button != '') { ?>
<div id="cartAdd">
<?php
echo $display_qty;
echo $display_button;
?>
</div>
<?php } // display qty and button ?>
<?php } // CUSTOMERS_APPROVAL == 3 ?>
<!--eof Add to Cart Box-->
<br clear="all" />
<!--bof Main Product Image -->
<?php
if (zen_not_null($products_image)) {
?>
<?php
/**
* display the main product image
*/
require($template->get_template_dir('/tpl_modules_main_product_jquery_image.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_main_product_jquery_image.php'); ?>
<?php
}
?>
<!--eof Main Product Image-->
Hope this helps![]()
This REALLY helped me! THANK YOU! :)
I have made it so that I have 2 Add to Cart buttons, which I want in most instances on my site. Alot of the time my products have alot of attributes and I wanted the customer to be able to add to cart at the top of them and below them.
ie:
See here.
http://www.nappyshoppe.com/store/hap...per-p-187.html
However, there are some situations where I only want one add to cart button. When there are no attributes. I am not sure how to write the code to check for if there are attributes, only show the top add to cart box and hide the bottom one.
Like here.
http://www.nappyshoppe.com/store/fli...rts-p-645.html
Thanks in advance for any help.
Sharni
You could check to see if the product has attributes with a function in the functions_lookups.php for:
Code:/* * Check if product has attributes values */ function zen_has_product_attributes_values($products_id) {
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
How would you implement using this code.
Do you use the line you quoted, or all of the function as follows:
/*
* Check if product has attributes values
*/
function zen_has_product_attributes_values($products_id) {
global $db;
$attributes_query = "select sum(options_values_price) as total
from " . TABLE_PRODUCTS_ATTRIBUTES . "
where products_id = '" . (int)$products_id . "'";
$attributes = $db->Execute($attributes_query);
if ($attributes->fields['total'] != 0) {
return true;
} else {
return false;
}
}
I have my add to cart button located in tpl_modules_attributes.php in order to get the look I wanted. I now have some products that do not have any attributes so tpl_modules_attributes.php is not being called and therefore neither is my add to cart.
Therefore if I could check for attributes and then call the add to cart only when attributes are not present (in the file tpl_shopping_cart_default.php) it would be very helpful.
All attempts of inserting your code breaks the cart, could you provide some advice?
Thank You
Sorry, my bad ...
You could use:
Code:if (zen_has_product_attributes($_GET['products_id'])) { // show second button code }
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Ok So I'm Having some trouble with this. I'm trying to make it where my pictures are on top of the description along with the add button and product details no matter what I do it is not working. I'm using a pure green template. I have set the <br> codes to remove and it is still not working? Some one please help. Thank You.