Forums / Templates, Stylesheets, Page Layout / product listing page - format add to cart btn and quantity

product listing page - format add to cart btn and quantity

Locked

Views: 1,322

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
6 Nov 2008, 9:23 PM
#1
stalb33 avatar

stalb33

New Zenner

Join Date:
Oct 2008
Posts:
55
Plugin Contributions:
0

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

7 Nov 2008, 2:25 AM
#2
tingtongmaak avatar

tingtongmaak

New Zenner

Join Date:
Nov 2008
Posts:
5
Plugin Contributions:
0

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?

7 Nov 2008, 7:01 AM
#3
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

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
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'] > 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 />' : '') : '');

    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
        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 = '';
10 Nov 2008, 4:32 PM
#4
stalb33 avatar

stalb33

New Zenner

Join Date:
Oct 2008
Posts:
55
Plugin Contributions:
0

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.php?main_page=index&cPath=659_662_669

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