Zen Cart Logo

Layout of products

Locked

Views: 3,081

Results 1 to 20 of 21
This thread is locked. New replies are disabled.
11 Dec 2007, 2:04 PM
#1
pb4 avatar

pb4

Totally Zenned

Join Date:
Nov 2007
Posts:
555
Plugin Contributions:
0

Layout of products

Hi,

I have installed the red passion template and I am wanting to change the listing of products.

I want all of my products listed when you click through from the category link in the sidebox and I want it to have a similar layout as this site - http://www.flyjumperstore.com/home.php?cat=3

Image to the left - product name in bold to the right with info underneith. I then want the more info link (ideally a button) to be under the info.

How can I do this?

Can I do this just through the admin??

I have played about and looked through the forum but can't inf the answers.

Thanks

11 Dec 2007, 3:33 PM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: Layout of products

That is almost a standard layout which you can get through admin > Configuration > Product Listing, except for the price/add bit below the description.

It will require some recoding of /includes/modules/your_template/product_listing.php.
You need to have the price block selected as active in admin, and then put the code to display it under the description output code, and hide the regular price block and its heading.

The Gallery Category mod can point the way to seamlessly hiding the regular price block. (That is part of its usual function.) You would strip out the conditional part so it always applies.

11 Dec 2007, 3:58 PM
#3
pb4 avatar

pb4

Totally Zenned

Join Date:
Nov 2007
Posts:
555
Plugin Contributions:
0

Re: Layout of products

ok. In admin I have the follwing set at 3 - Display Product Price/Add to Cart

Is that right?

This is the code in the product file...not sure which bit I move where as I want the title, than description and then I want the more info button?

As you will see from my page - http://ampmgraphicsprint.com/shop/index.php?main_page=index&cPath=86

Its all squashed. How do I get rid of the price column? have the title and description stretch across and have more info below that?

switch ($column_list[$col]) {
case 'PRODUCT_LIST_MODEL':
$lc_text = TABLE_HEADING_MODEL;
$lc_align = '';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_NAME':
$lc_text = TABLE_HEADING_PRODUCTS;
$lc_align = '';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_MANUFACTURER':
$lc_text = TABLE_HEADING_MANUFACTURER;
$lc_align = '';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_PRICE':
$lc_text = TABLE_HEADING_PRICE;
$lc_align = 'right' . (PRODUCTS_LIST_PRICE_WIDTH > 0 ? '" width="' . PRODUCTS_LIST_PRICE_WIDTH : '');
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_QUANTITY':
$lc_text = TABLE_HEADING_QUANTITY;
$lc_align = 'right';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_WEIGHT':
$lc_text = TABLE_HEADING_WEIGHT;
$lc_align = 'right';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_IMAGE':
$lc_text = TABLE_HEADING_IMAGE;
$lc_align = 'center';
$zc_col_count_description++;
break;
}

11 Dec 2007, 4:31 PM
#4
gjh42 avatar

gjh42

Black Belt

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

Re: Layout of products

What you have posted is the heading section of the code. You will be manipulating the lower section which runs through a similar switch/case block.```php
switch ($column_list[$col]) {
case 'PRODUCT_LIST_MODEL':
$lc_align = '';
$lc_text = $listing->fields['products_model'];
break;
case 'PRODUCT_LIST_NAME':
$lc_align = '';
if (isset($_GET['manufacturers_id'])) {
$lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_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']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . '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>';
}
break;
case 'PRODUCT_LIST_MANUFACTURER':
$lc_align = '';
$lc_text = '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a>';
break;
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 = '';
    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']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . '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']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . '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 start, you would copy nearly all of the 'PRODUCT_LIST_PRICE' block into the bottom of the 'PRODUCT_LIST_NAME' block, with a few tweaks:php
switch ($column_list[$col]) {
case 'PRODUCT_LIST_MODEL':
$lc_align = '';
$lc_text = $listing->fields['products_model'];
break;
case 'PRODUCT_LIST_NAME':
$lc_align = '';
if (isset($_GET['manufacturers_id'])) {
$lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_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);
} else {
$lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . '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);
}
/* 'PRODUCT_LIST_PRICE' section ---------------------------------*/
$lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />';
$lc_align = 'right';
$lc_text_pr = $lc_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']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . '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']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . 'products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
$lc_text_pr .= '<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_pr .= '<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 'PRODUCT_LIST_PRICE' section -----------------------------*/
$lc_text .= $lc_text_pr . '</div>';
break;

I haven't tested this particular code, though I know from experience that the principle works.
This should display the price and add to cart below the description. It won't remove the regular price block; that is another part of the code, which will be based on Gallery Category code.

You may be able to prune out large chunks of the price block code here, depending on how much info you want to show.
11 Dec 2007, 4:46 PM
#5
pb4 avatar

pb4

Totally Zenned

Join Date:
Nov 2007
Posts:
555
Plugin Contributions:
0

Re: Layout of products

Thanks for taking the time to help :smile:

hmm?? Have copied and pasted the code and nothing has changed??

Sorry I must have done something wrong?

11 Dec 2007, 5:00 PM
#6
pb4 avatar

pb4

Totally Zenned

Join Date:
Nov 2007
Posts:
555
Plugin Contributions:
0

Re: Layout of products

Ok, so I think I am getting there. Fiddled about a bit more and now I have the more info under the title and descriptions but I now have two titles and descriptions?

Also how do I have the title and descriptions stretch across?

Thanks

11 Dec 2007, 5:27 PM
#7
pb4 avatar

pb4

Totally Zenned

Join Date:
Nov 2007
Posts:
555
Plugin Contributions:
0

Re: Layout of products

Think I have made it worse now :(

Heres the code: (sorry if I am not suppose to paste code here, as I know its a lot - Just say if its best not to.

  switch ($column_list[$col]) {
      case 'PRODUCT_LIST_MODEL':
      $lc_align = '';
      $lc_text = $listing->fields['products_model'];
      break;
      case 'PRODUCT_LIST_NAME':
      $lc_align = '';
      if (isset($_GET['manufacturers_id'])) {
        $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_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']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . '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>';
      }
      break;
      case 'PRODUCT_LIST_MANUFACTURER':
      $lc_align = '';
      $lc_text = '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a>';
      break;
      /* 'PRODUCT_LIST_PRICE' section ---------------------------------*/
      $lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />';
      $lc_align = 'right';
      $lc_text_pr =  $lc_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']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . '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']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . 'products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
      $lc_text_pr .= '<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_pr .= '<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 'PRODUCT_LIST_PRICE' section -----------------------------*/


      // 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']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . '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']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . '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;
      case 'PRODUCT_LIST_QUANTITY':
      $lc_align = 'right';
      $lc_text = $listing->fields['products_quantity'];
      break;
      case 'PRODUCT_LIST_WEIGHT':
      $lc_align = 'right';
      $lc_text = $listing->fields['products_weight'];
      break;
      case 'PRODUCT_LIST_IMAGE':
      $lc_align = 'center';
      if ($listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
        $lc_text = '';
      } else {
        if (isset($_GET['manufacturers_id'])) {
          $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';
        } else {
          $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . 'products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';
        }
      }
      break;
    }

    $list_box_contents[$rows][$col] = array('align' => $lc_align,
                                            'params' => 'class="productListing-data"',
                                            'text'  => $lc_text);
  }
11 Dec 2007, 5:29 PM
#8
gjh42 avatar

gjh42

Black Belt

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

Re: Layout of products

I'm not sure why you have the name and description duplicated - I suspect you have copied something to where it shouldn't be.
Can you post the switch section of the file as you have it? Use ```
[php] and [/php]


Oops - I see you have already posted it. You have a few minutes still to go back and put the tags around the code.
11 Dec 2007, 5:30 PM
#9
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Layout of products

You could paste in inside the php tag to make it look better.

11 Dec 2007, 5:40 PM
#10
gjh42 avatar

gjh42

Black Belt

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

Re: Layout of products

You do have things a bit messed up... you pasted the price section into the manufacturer case instead of the name case, and it runs on into the price case (which has its "case" eliminated).

I'm still not sure how what I see there translates to what shows on the page, but I think it would be easiest to start fresh and just carefully copy the second window in my post over the name block in your file.
(Don't copy the top "switch" and "case...MODEL...break" parts.)

11 Dec 2007, 5:43 PM
#11
pb4 avatar

pb4

Totally Zenned

Join Date:
Nov 2007
Posts:
555
Plugin Contributions:
0

Re: Layout of products

So I just paste all of this?

        /* 'PRODUCT_LIST_PRICE' section ---------------------------------*/ 
        $lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />'; 
        $lc_align = 'right'; 
        $lc_text_pr =  $lc_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']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . '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']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . 'products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>'; 
        $lc_text_pr .= '<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_pr .= '<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 'PRODUCT_LIST_PRICE' section -----------------------------*/ 


        // 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']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . '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']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . '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; 
        case 'PRODUCT_LIST_QUANTITY': 
        $lc_align = 'right'; 
        $lc_text = $listing->fields['products_quantity']; 
        break; 
        case 'PRODUCT_LIST_WEIGHT': 
        $lc_align = 'right'; 
        $lc_text = $listing->fields['products_weight']; 
        break; 
        case 'PRODUCT_LIST_IMAGE': 
        $lc_align = 'center'; 
        if ($listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) { 
          $lc_text = ''; 
        } else { 
          if (isset($_GET['manufacturers_id'])) { 
            $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>'; 
          } else { 
            $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . 'products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>'; 
          } 
        } 
        break; 
      } 

      $list_box_contents[$rows][$col] = array('align' => $lc_align, 
                                              'params' => 'class="productListing-data"', 
                                              'text'  => $lc_text); 
    }  
11 Dec 2007, 5:53 PM
#12
pb4 avatar

pb4

Totally Zenned

Join Date:
Nov 2007
Posts:
555
Plugin Contributions:
0

Re: Layout of products

Still not doing it -

Here is the whole code for the page below the header bit

      switch ($column_list[$col]) {
        case 'PRODUCT_LIST_MODEL':
        $lc_align = '';
        $lc_text = $listing->fields['products_model'];
        break;
        case 'PRODUCT_LIST_NAME':
        $lc_align = '';
        if (isset($_GET['manufacturers_id'])) {
          $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_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']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . '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>';
        }
        break;
        case 'PRODUCT_LIST_MANUFACTURER':
        $lc_align = '';
        $lc_text = '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a>';
        break;
		/* 'PRODUCT_LIST_PRICE' section ---------------------------------*/ 
        $lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />'; 
        $lc_align = 'right'; 
        $lc_text_pr =  $lc_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']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . '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']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . 'products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>'; 
        $lc_text_pr .= '<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_pr .= '<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 'PRODUCT_LIST_PRICE' section -----------------------------*/ 


        // 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']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . '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']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . '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; 
        case 'PRODUCT_LIST_QUANTITY': 
        $lc_align = 'right'; 
        $lc_text = $listing->fields['products_quantity']; 
        break; 
        case 'PRODUCT_LIST_WEIGHT': 
        $lc_align = 'right'; 
        $lc_text = $listing->fields['products_weight']; 
        break; 
        case 'PRODUCT_LIST_IMAGE': 
        $lc_align = 'center'; 
        if ($listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) { 
          $lc_text = ''; 
        } else { 
          if (isset($_GET['manufacturers_id'])) { 
            $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>'; 
          } else { 
            $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . 'products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>'; 
          } 
        } 
        break; 

       // 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']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . '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']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . '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;
        case 'PRODUCT_LIST_QUANTITY':
        $lc_align = 'right';
        $lc_text = $listing->fields['products_quantity'];
        break;
        case 'PRODUCT_LIST_WEIGHT':
        $lc_align = 'right';
        $lc_text = $listing->fields['products_weight'];
        break;
        case 'PRODUCT_LIST_IMAGE':
        $lc_align = 'center';
        if ($listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
          $lc_text = '';
        } else {
          if (isset($_GET['manufacturers_id'])) {
            $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';
          } else {
            $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . 'products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';
          }
        }
        break;
      }

      $list_box_contents[$rows][$col] = array('align' => $lc_align,
                                              'params' => 'class="productListing-data"',
                                              'text'  => $lc_text);
    }

    // add description and match alternating colors
    //if (PRODUCT_LIST_DESCRIPTION > 0) {
    //  $rows++;
    //  if ($extra_row == 1) {
    //    $list_box_description = "productListing-data-description-even";
    //    $extra_row=0;
    //  } else {
    //    $list_box_description = "productListing-data-description-odd";
    //    $extra_row=1;
    //  }
    //  $list_box_contents[$rows][] = array('params' => 'class="' . $list_box_description . '" colspan="' . $zc_col_count_description . '"',
    //  'text' => zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION));
    //}
    $listing->MoveNext();
  }
  $error_categories = false;
} else {
  $list_box_contents = array();

  $list_box_contents[0] = array('params' => 'class="productListing-odd"');
  $list_box_contents[0][] = array('params' => 'class="productListing-data"',
                                              'text' => TEXT_NO_PRODUCTS);

  $error_categories = true;
}

if (($how_many > 0 and $show_submit == true and $listing_split->number_of_rows > 0) and (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 1 or  PRODUCT_LISTING_MULTIPLE_ADD_TO_CART == 3) ) {
  $show_top_submit_button = true;
} else {
  $show_top_submit_button = false;
}
if (($how_many > 0 and $show_submit == true and $listing_split->number_of_rows > 0) and (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART >= 2) ) {
  $show_bottom_submit_button = true;
} else {
  $show_bottom_submit_button = false;
}



  if ($how_many > 0 && PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0 and $show_submit == true and $listing_split->number_of_rows > 0) {
  // bof: multiple products
    echo zen_draw_form('multiple_products_cart_quantity', zen_href_link(FILENAME_DEFAULT, zen_get_all_get_params(array('action')) . 'action=multiple_products_add_product'), 'post', 'enctype="multipart/form-data"');
  }

?>

which bits are not right?

I have tried it over and over but i can't get it to work..

11 Dec 2007, 6:01 PM
#13
gjh42 avatar

gjh42

Black Belt

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

Re: Layout of products

You don't want to paste the

    break; 
    case 'PRODUCT_LIST_QUANTITY':  

etc.

I made some small changes to the price block code, so you should copy what is in my post, not from your own file. I have noticed a couple of improvements to my first code, so use this instead, and paste in just above the ```php
break;
case 'PRODUCT_LIST_MANUFACTURER':

```php
        /* 'PRODUCT_LIST_PRICE' section ---------------------------------*/
        $lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />';
        $lc_text_pr =  $lc_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']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . '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']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . 'products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
        $lc_text_pr .= '<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_pr .= '<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 'PRODUCT_LIST_PRICE' section -----------------------------*/
        $lc_text .= $lc_text_pr; /*add in price below description*/

I'll show you how to remove the "Price" column later.

Delete the copy you have been working on and start with a new copy of the file. That will make life much easier.

11 Dec 2007, 6:08 PM
#14
pb4 avatar

pb4

Totally Zenned

Join Date:
Nov 2007
Posts:
555
Plugin Contributions:
0

Re: Layout of products

:bigups:

Thanks - getting there. So now I have the title with the description under it followed by the more info below that...so how do I get rid of the price column so I can have the title/description stretch across?

I also want the title and description text aligned to the left.

Thanks:smile:

11 Dec 2007, 6:10 PM
#15
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Layout of products

Most of your requirements can be done by playing with the css file instead of messing around with php code.

11 Dec 2007, 6:13 PM
#16
pb4 avatar

pb4

Totally Zenned

Join Date:
Nov 2007
Posts:
555
Plugin Contributions:
0

Re: Layout of products

Yeah - I understand that the alignment will be css - just want to sort out the columns etc (main layout) before other smaller changes.

Have been playing about trying to lay it out how I want it for ages now and to no avail - that was mainly through the css style sheet and admin.

Thought I better ask for help before I mess up the site! :mellow:

11 Dec 2007, 6:19 PM
#17
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Layout of products

Are you making changes on the real site?
Never do that, set up a test site, which can be in a sub-folder on you real site, with a test-database (copy from your current database).

11 Dec 2007, 6:25 PM
#18
gjh42 avatar

gjh42

Black Belt

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

Re: Layout of products

Thanks for the nudge, yellow! I know more CSS than I did the first time I worked this problem out, so I can say that it is possible to hide the price column with CSS alone. I thought that might leave a blank space, but it apparently doesn't.
So... paste this into the bottom of your stylesheet:```
.productListing-data+.productListing-data+.productListing-data, #listCell0-2 {display: none;}

11 Dec 2007, 6:38 PM
#19
pb4 avatar

pb4

Totally Zenned

Join Date:
Nov 2007
Posts:
555
Plugin Contributions:
0

Re: Layout of products

You genius :clap:

Thank you so much for taking the time to help.

Just want to check a couple of other things, one of which I have looked into and not managed.

  • How do I align the title & description text to the left and then the more info to the right?

Two things I havnt looked into yet are

1/ changing the 'more info' text into a image - is this possible and if so how/where would I do this?

2/ Why is the first product on a white background and the second on a grey?
Can I change this?

Also I presume when I add more products they will all just be listed on the same page one below the other?

Sorry for all the extra questions.

Thanks again - learning loads here :smile:

11 Dec 2007, 6:53 PM
#20
gjh42 avatar

gjh42

Black Belt

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

Re: Layout of products

To control the title and description, you can style
h3.itemTitle {text-align: left;}
and
.listingDescription {text-align: left;}

To control the more info bit, you can use the adjacent sibling rule again:

.productListing-data br+a {float: right;}

Look at .productListing-even and .productListing-odd for the alternating colors.

The button for more info has been discussed before - search on it.