Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2008
    Posts
    60
    Plugin Contributions
    0

    Default Move price, quantity and Add to Cart to below description

    I've been searching the forum for a way to do this, and none of the suggestions I've found so far have worked. I am trying to get the products on the product listing to look like the image I've included.



    Using a column layout, like the Column Layout Grid mod, will put the price, quantity box and add to cart button below the description like I want it to be (with a few little tweaks to left align everything), but the product image then appears above the description, which I do not want. I want it to remain on the left and all the other elements to be aligned to the right of it, as in the picture.

    So, basically, what I want to do is eliminate the Price "column" and move its contents to below the description, leaving everything else the way that it is.

    I'm aware that this will probably require some code changes, which is fine.

    If anyone can help with this, I'd really appreciate it.

  2. #2
    Join Date
    Nov 2008
    Posts
    60
    Plugin Contributions
    0

    Default Re: Move price, quantity and Add to Cart to below description

    I just thought I'd mention that I managed to figure out for myself how to do this. If anyone else wants to know how to do it, let me know, and I'll post the instructions here.

  3. #3
    Join Date
    Aug 2008
    Posts
    3
    Plugin Contributions
    0

    Default Re: Move price, quantity and Add to Cart to below description

    Hi, MureenT

    What you've done is what I've wanted to do.
    Would you please tell me how you did it?

    Best regards,
    Forest (not in Nottingham but in Japan)

  4. #4
    Join Date
    Nov 2008
    Posts
    60
    Plugin Contributions
    0

    Default Re: Move price, quantity and Add to Cart to below description

    Sure thing! I should first mention that this mod is for version 1.3.8. I do not know how different the code on earlier versions would be.

    STEP ONE
    If you have not already done so, you should left-align the product name and description and make it so that their vertical alignment is to the top rather than centered. You do this by creating the following styles in stylesheet.css, if they do not already exist:

    Code:
    .itemTitle {
        text-align: left;
    }
    
    .listingDescription {
        text-align: left;
    }
    
    .productListing-odd td, .productListing-even td {
        vertical-align: top;
        padding: 0.5em;
        margin-bottom: 1em;
        border-bottom: 3px double #000000;
    }
    That third style also adds some space between the product picture and the title/description (padding:0.5em), some space between products (margin-bottom: 1em), and a black double-line divider between the products. The line can be removed or changed to whatever style or color you wish it to be. You can also increase or decrease the spacing by changing the padding and margin settings.

    STEP TWO
    Make the code changes below to includes/modules/product_listing.php and save the altered file to /includes/modules/YOUR_TEMPLATE/ so that you're not overwriting the default file. It's possible that you may have already changed that file with some other mod, so check on that first. You wouldn't want to overwrite changes you've already made.

    Replace:
    Code:
            if (isset($_GET['manufacturers_id'])) {
              $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>' ;
            } else {
              $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>';
            }
    With:
    Code:
            if (isset($_GET['manufacturers_id'])) {
              $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '<br /><br />';
    
    //adds price below description
    			$lc_text .= '<div class="productPrices">' . zen_get_products_display_price($listing->fields['products_id']) . '</div>';
    //end price below description
    
    //adds quantity box and add to cart button or "more info" below price
            // more info in place of buy now
            $lc_button = '';
            if (zen_has_product_attributes($listing->fields['products_id']) or PRODUCT_LIST_PRICE_BUY_NOW == '0') {
              $lc_button = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? $_GET['cPath'] : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
            } else {
              if (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0) {
                if (
                    // not a hide qty box product
                    $listing->fields['products_qty_box_status'] != 0 &&
                    // product type can be added to cart
                    zen_get_products_allow_add_to_cart($listing->fields['products_id']) != 'N'
                    &&
                    // product is not call for price
                    $listing->fields['product_is_call'] == 0
                    &&
                    // product is in stock or customers may add it to cart anyway
                    ($listing->fields['products_quantity'] > 0 || SHOW_PRODUCTS_SOLD_OUT_IMAGE == 0) ) {
                  $how_many++;
                }
                // hide quantity box
                if ($listing->fields['products_qty_box_status'] == 0) {
                  $lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
                } else {
                  $lc_button = TEXT_PRODUCT_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $listing->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
                }
              } else {
    // qty box with add to cart button
                if (PRODUCT_LIST_PRICE_BUY_NOW == '2' && $listing->fields['products_qty_box_status'] != 0) {
                  $lc_button= zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($listing->fields['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing->fields['products_id']), 'post', 'enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($listing->fields['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</form>';
                } else {
                  $lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
                }
              }
            }
            $the_button = $lc_button;
            $products_link = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . ( ($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : $_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id'])) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
            $lc_text .= '<br />' . zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($listing->fields['products_id']);
            $lc_text .= '<br />' . (zen_get_show_product_switch($listing->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? (zen_get_product_is_always_free_shipping($listing->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '') : '');
    //end quantity box and add to cart button or "more info" below price
    
    		$lc_text .= '</div>' ;
            } else {
              $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '<br /><br />';
    
    //adds price below description
    			$lc_text .= '<div class="productPrices">' . zen_get_products_display_price($listing->fields['products_id']) . '</div>';
    //end price below description
    
    //adds quantity box and add to cart button or "more info" below price
            // more info in place of buy now
            $lc_button = '';
            if (zen_has_product_attributes($listing->fields['products_id']) or PRODUCT_LIST_PRICE_BUY_NOW == '0') {
              $lc_button = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? $_GET['cPath'] : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
            } else {
              if (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0) {
                if (
                    // not a hide qty box product
                    $listing->fields['products_qty_box_status'] != 0 &&
                    // product type can be added to cart
                    zen_get_products_allow_add_to_cart($listing->fields['products_id']) != 'N'
                    &&
                    // product is not call for price
                    $listing->fields['product_is_call'] == 0
                    &&
                    // product is in stock or customers may add it to cart anyway
                    ($listing->fields['products_quantity'] > 0 || SHOW_PRODUCTS_SOLD_OUT_IMAGE == 0) ) {
                  $how_many++;
                }
                // hide quantity box
                if ($listing->fields['products_qty_box_status'] == 0) {
                  $lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
                } else {
                  $lc_button = TEXT_PRODUCT_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $listing->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
                }
              } else {
    // qty box with add to cart button
                if (PRODUCT_LIST_PRICE_BUY_NOW == '2' && $listing->fields['products_qty_box_status'] != 0) {
                  $lc_button= zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($listing->fields['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing->fields['products_id']), 'post', 'enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($listing->fields['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</form>';
                } else {
                  $lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
                }
              }
            }
            $the_button = $lc_button;
            $products_link = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . ( ($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : $_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id'])) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
            $lc_text .= '<br />' . zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($listing->fields['products_id']);
            $lc_text .= '<br />' . (zen_get_show_product_switch($listing->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? (zen_get_product_is_always_free_shipping($listing->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '') : '');
    //end quantity box and add to cart button or "more info" below price
    
    		$lc_text .= '</div>' ;
            }
    STEP THREE
    Go into your admin area to Configuration > Product Listing and set "Display Product Price/Add to Cart" to 0, which will remove the column that has those things.

    And that should do it. Be aware that if you display the manufacturer column on your product listing page, it will still be to the right of the title, description, etc. This mod does not move that, although it's quite easy to move it to wherever you want it to be. I'll be happy to explain how to anyone who wants to know.

    This mod only changes how the product listing page looks. It does not affect All Products, New Products, etc., unless you have your store set up so that all those pages are laid out the same as the product listing page. if you want to know how to do that, check out the post at:

    http://www.zen-cart.com/forum/showth...emplate&page=8

  5. #5
    Join Date
    Aug 2008
    Posts
    3
    Plugin Contributions
    0

    Default Re: Move price, quantity and Add to Cart to below description

    Thanks!

    I'll try it.

 

 

Similar Threads

  1. Product Description/Info page: can I move price right below model without space?
    By scott_ease in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 27 Jun 2012, 01:38 AM
  2. In product price by attribute selected and quantity button disapper from add to cart
    By ronaldlb in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 14 Feb 2011, 05:08 PM
  3. Help moving attribute, price, and add to cart on prod description page
    By MULISH in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 21 May 2009, 01:39 AM
  4. Move Add to Cart Below Product Price on Product Info Page
    By dave_nextexit in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 15 Apr 2008, 09:20 PM
  5. Add to Cart move Below Attributes
    By mitchcecg in forum General Questions
    Replies: 2
    Last Post: 8 Mar 2008, 12:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR