Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Oct 2008
    Posts
    55
    Plugin Contributions
    0

    Default product listing page - format add to cart btn and quantity

    Hi, I would like to reformat the product listing page - I want the add to cart button and quantity box to be on the same line. right now they are sitting on top of each other and i would like them side by side.

    any pointers? i'm guessing either a css change or a php code change inside tpl_index_product_list.php but i can't seem to figure it out.

    Thanks

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

    Default Re: product listing page - format add to cart btn and quantity

    Yes it will be a CSS or PHP adjustment. But can't tell you what to do with out seeing a link so we can see your current code?

  3. #3
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: product listing page - format add to cart btn and quantity

    The stock product_listing.php does not give any class or id tags to manipulate that part of the page. Find this:
    PHP Code:
            case 'PRODUCT_LIST_PRICE':
            
    $lc_price zen_get_products_display_price($listing->fields['products_id']) . '<br />';
            
    $lc_align 'right';
            
    $lc_text =  $lc_price;

            
    // more info in place of buy now
            
    $lc_button '';

    ... [
    lots of code] ...

            }
            
    $the_button $lc_button;
            
    $products_link '<a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . ( ($_GET['manufacturers_id'] > and $_GET['filter_id']) > zen_get_generated_category_path_rev($_GET['filter_id']) : $_GET['cPath'] > 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 />' '') : '');

            break; 
    To simply put the price inline before the add button, you can delete the
    . '<br />'
    in this line:

    $lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />';

    leaving

    $lc_price = zen_get_products_display_price($listing->fields['products_id']);

    To get more control over styling, you can add divs with classes or ids to various parts of the code in this section.
    One example:
    PHP Code:
            case 'PRODUCT_LIST_PRICE':
            
    $lc_text '<div class="listingPrice">';
            
    $lc_price zen_get_products_display_price($listing->fields['products_id']);
            
    $lc_text .=  $lc_price;
            
    $lc_text .= '</div>';

            
    // more info in place of buy now
            
    $lc_button ''

  4. #4
    Join Date
    Oct 2008
    Posts
    55
    Plugin Contributions
    0

    Default Re: product listing page - format add to cart btn and quantity

    gjh42 BIG help. I'm almost there. check out the page...

    (i might have it fixed by the time you respond)
    otherwise:
    http://spectechind.com/store/index.p...th=659_662_669


    I need to align the quantity and button - see how they are a little off center? Thanks again

 

 

Similar Threads

  1. v139h Style quantity and add to cart button on product listing
    By barendfaber in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 16 Aug 2012, 03:39 PM
  2. Add an add to cart button under each product quantity on the category page
    By buxton1 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 21 Apr 2010, 06:37 PM
  3. Change Quantity to Add to cart on Product Listing Page
    By sweetie1 in forum General Questions
    Replies: 4
    Last Post: 21 Jan 2008, 04:32 PM

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