Home Forums Plugins Related Products Support [Resolved] Best way to make this horizontally displayed?

Welcome to our community support forums! We're here to help - but if you have an urgent request for a Pro Plugin, you will get a prioritised response through our Premium Support page.

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #6799
    cyhwebby
    Participant

    I need to make my related products list display horizontally. Since this plugin is done through a combination of php code and tables, what’s the best way to do this? (I had mistakenly assumed it would be an CSS change, but it’s not).

    Help would be very appreciated!

    Thanks Michael for your great work. I wish more developers were producing really useful products for WP E-commerce like you are. I appreciate it.

    #6800
    Michael Visser
    Keymaster

    Hi cyhwebby, have you had a look at the template.php file within /wp-content/plugins/wp-e-commerce-related-products/includes/?

    The current release by default displays a table grid which is vertical, I will make a priority to include a list-based template, unfortunately for now you’ll need to manually change the HTML within this template.php file from TABLE, TR, TD to UL, LI and then apply the CSS styles DISPLAY and FLOAT to list related products horizontally. I’ll add this as a feature in 1.7

    #6801
    cyhwebby
    Participant

    Thanks Michael, that worked perfectly. I’ll copy and paste my code here on the off chance that someone would like to replicate what I’ve done:

    <div class="vl_wpscrp">
    	<h3>Related Products</h3>
    <?php if( $vl_wpscrp_products ) { ?>
    	<ul style="display:inline; width:500px; list-style-type:none">
    	<?php	foreach( $vl_wpscrp_products as $vl_wpscrp_product ) { ?>
    					<li style="width:75px; float:left">
    		<?php if( get_option( 'show_thumbnails' ) ) { ?>
    			<?php if( $vl_wpscrp_product->image ) { ?>
    				<a>id ); ?>" title="<?php echo $vl_wpscrp_product->name; ?>"><img class="product_image" style="height:75px; width:75px" id="product_image_<?php echo $vl_wpscrp_product->id; ?>" alt="<?php echo $vl_wpscrp_product->name; ?>" title="<?php echo $vl_wpscrp_product->name; ?>" src="<?php echo vl_wpscrp_product_thumbnail( $vl_wpscrp_product->id, $vl_wpscrp_product->image ); ?>" /></a>
    			<?php } else { ?>
    				<div class="no_image image"><a>id ); ?>" title="<?php echo $vl_wpscrp_product->name; ?>">
    #6802
    Conor
    Participant

    Hello!

    And thanks for the code above, but i seem to have a whole lot of mark-up rendering around my product images? Any ideas on what happening? not to mention the error ‘uasort() expects parameter 1 to be array’ prior to the related products…

    ANy help would be great – http://powderroomessentials.com.au/conor/?page_id=8&category=5&product_id=7

    thanks
    conor

    #6803
    Conor
    Participant

    Well after looking at the above snippet for half an hour, i figured it was missing a bit of code after each of the <a> tags, so was able to fix that up but still showing the uasort parameter error???

    hopefully it will crack it in less than 30 mins this time?

    FYI replaced <a>id ); ?>" with <a class="title" href="<?php echo wpsc_product_url( $vl_wpscrp_product->id ); ?>"

    #6804
    Michael Visser
    Keymaster

    Hi Conor, I’ve just released a Plugin update that resolves all this.

    http://www.visser.com.au/blog/related-products-gets-templates-and-admin-options/

    I’ve included 4 templates for Related Products covering:

    * Table – Horizontal
    * Table – Vertical
    * List – Ordered
    * List – Unordered

    Update to the latest release and let me know your thoughts and how it can be improved in future releases.

    #6805
    Conor
    Participant

    Thanks Michael,

    Have done, the display is working well – but I still seem to be getting an error just before the title tag?

    Warning: uasort() expects parameter 1 to be array – is this related?

    #6806
    cyhwebby
    Participant

    I thought I’d pop back in here and say I integrated some javascript with mine using this page as a tutorial:

    http://valums.com/scroll-menu-jquery/

    So my code (not having upgraded yet) currently is:

    <div class="vl_wpscrp">
        <!-- <h3>Related Products</h3> -->
             <div class="sc_menu">
    
    <ul class="sc_menu">
    <?php if( $vl_wpscrp_products ) { ?>
        <?php    foreach( $vl_wpscrp_products as $vl_wpscrp_product ) { ?>
            <li class="sc_menu">
            <?php if( get_option( 'show_thumbnails' ) ) { ?>
                <?php if( $vl_wpscrp_product->image ) { ?>
                    <a>id ); ?>" title="<?php echo $vl_wpscrp_product->name; ?>"><img class="product_image" id="product_image_<?php echo $vl_wpscrp_product->id; ?>" alt="<?php echo $vl_wpscrp_product->name; ?>" title="<?php echo $vl_wpscrp_product->name; ?>" src="<?php echo vl_wpscrp_product_thumbnail( $vl_wpscrp_product->id, $vl_wpscrp_product->image ); ?>" /></a>
                <?php } else { ?>
                    <div class="no_image image"><a>id ); ?>" title="<?php echo $vl_wpscrp_product->name; ?>">

    #6807
    Michael Visser
    Keymaster

    Hi Conor, I’ll take a look at that tomorrow. uasort() randomises the Products array.

    Hi cyhwebby, that looks great! Just wondering how I can make it easier to template Related Products.

    #6808
    Conor
    Participant

    G’day Michael, I’ve been a bit busy of late… looks like you have been too.

    Thought someone here might be familar with this error (uasort() expects parameter 1 to be array) with this plug-in?
    any help would be great!

    thanks conor

    #6809
    Conor
    Participant

    Hello, unfortunately I still haven’t been able to fix this error? Any chance you could take a look MV.

    Thanks Conor

    #6810
    Conor
    Participant

    mmmm yep still workin on it (no real programming background mind you…), I have moved the site to the main directory eg: http://powderroomessentials.com.au/?page_id=8&category=4&product_id=129

    As you can see the error on the page above, I tried to insert something like this but to no luck???

    if( !$vl_wpscrp_rotation ) {
    $vl_wpscrp_productdata_sql = "SELECT name, image FROM ".$wpdb->prefix."wpsc_product_list WHERE id = '".$vl_wpscrp_manual_products."' LIMIT 1";
                                                    $vl_wpscrp_productdata = $wpdb->get_row( $vl_wpscrp_productdata_sql );
                                                    if( $vl_wpscrp_productdata ) {
                                                              $vl_wpscrp_products[] = array(
                                                              'id' => $vl_wpscrp_manual_products,
                                                              'name' => $vl_wpscrp_productdata->name,
                                                              'image' => $vl_wpscrp_productdata->image
                                                              );
                                                    }
    uasort( $vl_wpscrp_products,'vl_wpscrp_scmp' );
    }

    Am I on the right track? no idea???

    #6811
    Conor
    Participant

    (FYI)

    Sorry, I had to put the redirect back on the site as there are a few things not ready for it to go live. I have copy and pasted the error though – Warning: uasort() expects parameter 1 to be array, object given in /home/powderro/public_html/wp-content/plugins/wp-e-commerce-related-products/wp-e-commerce-related-products.php on line 386

    #6812
    Michael Visser
    Keymaster

    Hi Conor, I’m about to push out a fix for this uasort issue, I’m not sure what’s triggered it as it was behaving normal in earlier releases. In the meantime you can remove the line from your Plugin, I’ll be making a minor Plugin update tomorrow to resolve this.

    uasort() is responsible for randomising the presentation of Related Products on the single Product page.

    #6813
    Conor
    Participant

    Great! Yeah i thought it was odd when no one else mentioned they had the same problem?
    Thanks once again, look forward to it.

Viewing 15 posts - 1 through 15 (of 16 total)
  • The topic ‘[Resolved] Best way to make this horizontally displayed?’ is closed to new replies.