Results 1 to 10 of 17

Hybrid View

  1. #1
    Join Date
    May 2006
    Posts
    67
    Plugin Contributions
    0

    Idea or Suggestion PHP pro coders help needed, product layout

    Hello, this is a TM template code i think and not standard Zen code. Hope someone can help.

    I believe this is the right part of the code that is displaying what i am looking to change. Basically at present the products on the main page are displayed with description on the right hand side i.e
    image *****************************
    image*************
    image************
    image************
    image******************************

    This also includes a price and a button for more description.

    What i want:

    Have two products in a line with description underneath it so i can display more products in each page. two in a line all the way down.
    From the wanted image you will see what i mean exactly. Also for some reason i havent got the buy now button on it too maybe its in admin somewhere which i need to turn on, however not really fussed about it as long as i have change the display in this way.

    Hope someone can help, will appreciate it greatly.

    code:

    <?php
    //templatemonster function
    function tm_listing2($href, $img, $name, $desc, $price)
    {

    $price = preg_replace('/(Save:&nbsp;\d+%\soff)/i', '', $price);
    $price = preg_replace('/(<span class="normalprice">)/i', '<span class="ee">', $price);
    //$price = preg_replace('/(<br)/i', '<font', $price);
    //$price = preg_replace('/(<span class="productPriceDiscount"><br>)/i', '<span>', $price);
    echo '<!--main cell -->
    <div class="dt m_t_dr" >
    <div class="dr">
    <div class="dc m_t_r" >'.zen_image(DIR_WS_TEMPLATE.'images/m-l-t.gif').'</div>
    </div>
    </div>
    <div class="dt m_l" >
    <div class="dr">
    <div class="dc m_r " ><div class="m_pad">
    <div class="main_cell_h_l">'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '1px').'</div>
    <div class="dt" >
    <div class="dr">
    <div class="dc main_cell_c1" ><a href="'.$href.'">'.$img.'</a></div>
    <div class="dc main_cell_c2" >
    <div class="main_cell_c2_margin">
    <font>'.$name.'</font><br>'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '8px').'<br>
    '.substr(strip_tags($desc),0,80).'<br>'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '8px').'<br>
    <div class="dt price_block" >
    <div class="dr">
    <div class="dc c1" ><span class="price_text">'.$price.'</span></div>
    <div class="dc c2" ><a href="'.$href.'">'.zen_image(DIR_WS_TEMPLATE.'images/button_details.gif').'</a></div>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div></div>
    </div>
    </div>
    <div class="dt m_b_dr" >
    <div class="dr">
    <div class="dc m_b_r" >'.zen_image(DIR_WS_TEMPLATE.'images/m-l-b.gif').'</div>
    </div>
    </div>
    <!--main cell end -->'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '3px').'<br>';
    }

    function tm_listing($href, $img, $name, $desc, $price)
    {
    /*echo '<div class="dt center_block1" >
    <div class="dr">
    <div class="dc center_block1_c1" ><a href="'.$href.'">'.$img.'</a><br>
    </div>
    <div class="dc" >
    <br style="line-height:17px;">
    <div class="c_b_h_text">'.$name.'</div>
    <br style="line-height:10px;">
    <div class="c_b_m_text">'.substr($desc,0,80).'</div>
    <br style="line-height:11px;">
    <div class="h_l3">'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '1px').'</div>
    <br style="line-height:3px;">
    <div class="price_block price_text"><strong>Our price:</strong> <span >'.$price.'</span>'.zen_image(DIR_WS_TEMPLATE.'images/v-l.gif', '', '', '','style="margin-left:10px; margin-right:10px; vertical-align:middle; margin-top:-2px;"').'<a href="'.$href.'">'.zen_image(DIR_WS_TEMPLATE.'images/button_details.gif').'</a></div>
    </div>
    </div>
    </div>
    <!--center block1 end -->
    <br style="line-height:3px;">
    <!--center block2 -->
    <div class="h_l2">'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '1px').'</div>';*/
    $price = preg_replace('/(Save:&nbsp;\d+%\soff)/i', '', $price);
    $price = preg_replace('/(<span class="normalprice">)/i', '<span class="ee">', $price);
    //$price = preg_replace('/(<br)/i', '<span', $price);
    $price = preg_replace('/(<span class="productPriceDiscount"><br)/i', '<span', $price);
    echo '<!--main cell -->
    <div class="dt m_t_dr" >
    <div class="dr">
    <div class="dc m_t_r" >'.zen_image(DIR_WS_TEMPLATE.'images/m-l-t.gif').'</div>
    </div>
    </div>
    <div class="dt m_l" >
    <div class="dr">
    <div class="dc m_r " ><div class="m_pad">
    <div class="main_cell_h_l">'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '1px').'</div>
    <div class="dt" >
    <div class="dr">
    <div class="dc main_cell_c1" ><a href="'.$href.'">'.$img.'</a></div>
    <div class="dc main_cell_c2" >
    <div class="main_cell_c2_margin">
    <font>'.$name.'</font><br>'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '8px').'<br>
    '.substr(strip_tags($desc),0,80).'<br>'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '8px').'<br>
    <div class="dt price_block" >
    <div class="dr">
    <div class="dc c1" ><span class="price_text">'.$price.'</span></div>
    <div class="dc c2" ><a href="'.$href.'">'.zen_image(DIR_WS_TEMPLATE.'images/button_details.gif').'</a></div>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div></div>
    </div>
    </div>
    <div class="dt m_b_dr" >
    <div class="dr">
    <div class="dc m_b_r" >'.zen_image(DIR_WS_TEMPLATE.'images/m-l-b.gif').'</div>
    </div>
    </div>
    <!--main cell end -->'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '3px').'<br>';
    }


    function tm_head($text)
    {
    echo '<!-- head cell -->
    <div class="dt m_t_dr" >
    <div class="dr">
    <div class="dc m_t_r" >'.zen_image(DIR_WS_TEMPLATE.'images/m-l-t.gif').'</div>
    </div>
    </div>
    <div class="dt m_l" >
    <div class="dr">
    <div class="dc m_r " ><div class="m_pad">
    <div class="m3_dr m3_pad"><span class="m3_h_text">'.$text.'</span></div></div>
    </div>
    </div>
    </div>
    <div class="dt m_b_dr" >
    <div class="dr">
    <div class="dc m_b_r" >'.zen_image(DIR_WS_TEMPLATE.'images/m-l-b.gif').'</div>
    </div>
    </div>
    <!-- head cell end -->'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '2px').'<br>';
    }
    function tm_head_end()
    {
    echo '';
    }

    function tm_box_head($text, $link = false, $style = 'style1')
    {
    if (!empty($link))
    {
    $text = $text.' (<a href="'.zen_href_link($link).'" class="rr">more</a>)';
    }
    switch ($style)
    {
    case 'style1':
    {
    $ret = '<div class="m_t_dr" >
    <div class="dr">
    <div class="dc m_t_r" >'.zen_image(DIR_WS_TEMPLATE.'images/m-l-t.gif').'</div>
    </div>
    </div>
    <div class="dt m_l" >
    <div class="dr">
    <div class="dc m_r" ><div class="m_pad">
    <div class="m_top m_top_pad">
    <span class="m_h1_text">'.$text.':</span><br>
    </div></div>
    </div>
    </div>
    </div>
    <div class="dt m_l" >
    <div class="dr">
    <div class="dc m_r " ><div class="m_pad1">
    <div class="m_h_l">'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '1px').'</div></div>
    </div>
    </div>
    </div>';
    break;
    }
    case 'style2':
    {
    $ret = '<div class="dt m_t_dr" >
    <div class="dr">
    <div class="dc m_t_r" >'.zen_image(DIR_WS_TEMPLATE.'images/m-l-t.gif').'</div>
    </div>
    </div>
    <div class="dt m_l" >
    <div class="dr">
    <div class="dc m_r" ><div class="m_pad">
    <div class="m_top m_top_pad">
    <span class="m_h_text">'.$text.':</span><br>
    </div></div>
    </div>
    </div>
    </div>
    <div class="dt m_l" >
    <div class="dr">
    <div class="dc m_r " ><div class="m_pad1">
    <div class="m_h_l">'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '1px').'</div></div>
    </div>
    </div>
    </div>';
    break;
    }
    }
    return $ret;
    }
    function tm_box_cont($text,$style = 'style1')
    {
    switch ($style){
    case 'style1':
    {
    $ret = '<div class="dt m_l" >
    <div class="dr">
    <div class="dc m_r" ><div class="m_pad">
    <div class="m_bot"><div class="m_bot_pad">
    '.$text.'</div>
    </div></div>
    </div>
    </div>
    </div>
    <div class="dt m_b_dr" >
    <div class="dr">
    <div class="dc m_b_r" >'.zen_image(DIR_WS_TEMPLATE.'images/m-l-b.gif').'</div>
    </div>
    </div>
    <!-- cont col1 cell1 end -->'.zen_image(DIR_WS_TEMPLATE.'images/spacer.gif', '', '1px', '3px').'<br>';

    break;
    }
    case 'style2':
    {
    $ret = $text.'';
    break;
    }

    }
    return $ret;
    }
    ?>
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	current.gif 
Views:	264 
Size:	13.6 KB 
ID:	2624   Click image for larger version. 

Name:	wanted.gif 
Views:	253 
Size:	14.3 KB 
ID:	2625  

  2. #2
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: PHP pro coders help needed, product layout

    You need to talk to TM about this.
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  3. #3
    Join Date
    May 2006
    Posts
    67
    Plugin Contributions
    0

    Default Re: PHP pro coders help needed, product layout

    i am sure how everyone knows how TM operates. Especially they dont help with something which the template is not meant to do i.e change the format etc etc. Just thought someone here might be able to point me to the right code.

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

    Default Re: PHP pro coders help needed, product layout

    Put in a ticket with them first; even though it probably won't get results, enough complaints may eventually convince them to change the way they make templates. Then fix the problem yourself.

    The
    function tm_listing($href, $img, $name, $desc, $price)

    is what forces the "details" button instead of the standard flexible Zen Cart functionality.
    Compare this line with the add to cart functionality in /includes/modules/product_listing.php to see what to put in. There is quite a bit misssing, and it will take some close examination. It is possible that the information needed for the ZC standard code to work is not available in this function - you will have to try it and see. You may have to settle for recoding the button to another fixed purpose... or else scrap this code altogether and get product_listing.php back in the loop.

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

    Default Re: PHP pro coders help needed, product layout

    Oops - left out the line I was referencing!
    PHP Code:
    <div class="price_block price_text"><strong>Our price:</strong> <span >'.$price.'</span>'.zen_image(DIR_WS_TEMPLATE.'images/v-l.gif', '', '', '','style="margin-left:10px; margin-right:10px; vertical-align:middle; margin-top:-2px;"').'<a href="'.$href.'">'.zen_image(DIR_WS_TEMPLATE.'imag es/button_details.gif').'</a></div

  6. #6
    Join Date
    May 2006
    Posts
    67
    Plugin Contributions
    0

    Default Re: PHP pro coders help needed, product layout

    Cheers guys thanks for the help on this. Will see how i get on with it. Might play around with it myself as its a waste of time with TM as i have experience with it.

 

 

Similar Threads

  1. v151 Urgent help needed setting up PayPal Payments Pro (USA)
    By andilyn in forum PayPal Website Payments Pro support
    Replies: 5
    Last Post: 18 Feb 2014, 06:35 PM
  2. Replies: 5
    Last Post: 17 Feb 2010, 05:13 PM
  3. category / product layout help needed
    By boogily in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 2 Nov 2009, 04:14 AM
  4. Product Reviews Layout... Help Needed!
    By gee38l in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 9 Dec 2008, 12:25 AM

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